NIx basic query

Your question

I am trying to get the stalwart-cli and plans to work with Nix, but after 4 days, I am struggling.

There are commands in the docs that don’t appear to work, such as;

stalwart-cli query Certificate --where text=domain --url https://domain --user admin
Password:
error: jmap error: unsupportedFilter: Filter on property text is not supported or invalid

It fails with or without the quoted domain.

Filters in general are giving me grief as gettings errors that ‘text’ is not a supported filter, when it is stated in the docs, as the only one supported.

I have a number of other questions, but they will have to wait.

Stalwart 0.16.9, cli 1.0.8

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

If you do;

stalwart-cli query Certificate

does it give you a list of IDs and Subject Alternative Names? You can then use the ID this way;

stalwart-cli get Certificate iw97bpmpzdaa

for example.

You mean manually filter rather than use the built in filter?

Well yes, but more I am querying that this is a bug, or the docs are wrong.

I have things working, but its complex and made more complex by not being able to filter.

Welp, I’m not sure if the response you’re receiving is a bug or not. I do know the docs say; “To list which filters an object supports, run describe <object>. The Filters: section lists each accepted key, its kind, and a label.” In the case of Certificate it is;

Certificate
  Defines a TLS certificate and its associated private key.

Fields:
    certificate              object<PublicText>  mutable
        TLS certificate in PEM format
    issuer                   string<string>  server-set
        Certificate issuer
    notValidAfter            datetime  server-set
        Expiration date of the certificate
    notValidBefore           datetime  server-set
        Issuance date of the certificate
    privateKey               object<SecretText>  mutable
        Private key in PEM format
    subjectAlternativeNames  set<string<string>>  server-set
        Subject Alternative Names (SAN) for the certificate

Filters:
    text  text  Text

But I cannot get the filters to work. When I do;

stalwart-cli query certificate --where text=autoconfig --fields subjectAlternativeNames,notValidAfter

I get;

error: jmap error: unsupportedFilter: Filter on property text is not supported or invalid

So maybe it is a bug or perhaps a known-issue?

Yes that is the error I get.

Used jq to parse the cli response for all domains, which works, except for Accounts, so I have jq for most and —where for Accounts.

It works, but feels a bit of a hack :slight_smile:

This was an error in the schema definition, the text field does not exist. It has been fixed now.