Your question
Can I generate a list of the members of a mailing list with stalwart-cli?
how can this be done?
Thank You, Stefan
This gives enough: stalwart-cli get MailingList <id> returns the recipients field.
Now I have enough. The mailing list’s recipients field holds the members.
Answer: Yes. Mailing lists in Stalwart are directory objects with a recipients field that holds the member email addresses, so you can fetch that with stalwart-cli get:
stalwart-cli get mailinglist <list-id> --fields name,recipients
Or in JSON form for scripting:
stalwart-cli get mailinglist <list-id> --fields name,recipients --json | jq '.recipients'
If you don’t know the list’s id, look it up first with query, e.g. stalwart-cli query mailinglist --where name=<list-name>.
Reference: Fetching a single object and MailingList object.
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.
thanks for this,
but it can’t find out the list-id.
i only get this error when running the query command:
error: jmap error: unsupportedFilter: Filter on property name is not supported or invalid
what is wrong?
I found the solution:
it must be
stalwart-cli query MailingList --where text=…