MailingList
MailingList
Section titled “MailingList”Defines a mailing list that distributes messages to a group of recipients.
This object can be configured from the WebUI under Management › Directory › Mailing Lists
Fields
Section titled “Fields”Type:
EmailLocalPart· requiredName of the mailing list, typically an email address local part.
domainId
Section titled “domainId”Type:
Id<Domain>· requiredIdentifier for the domain this mailing list belongs to. This is used to determine the email address of the mailing list, which is formed as name@domain.
emailAddress
Section titled “emailAddress”Type:
EmailAddress· server-setThe email address of the mailing list, formed as name@domain.
description
Section titled “description”Type:
String?Description of the mailing list
aliases
Section titled “aliases”Type:
EmailAlias[]List of email aliases for the mailing list
memberTenantId
Section titled “memberTenantId”Type:
Id<Tenant>?Identifier for the tenant this mailing list belongs to
recipients
Section titled “recipients”Type:
EmailAddress[]List of email addresses that are members of the mailing list
JMAP API
Section titled “JMAP API”The MailingList object is available via the urn:stalwart:jmap capability.
x:MailingList/get
Section titled “x:MailingList/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysMailingListGet permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MailingList/get", { "ids": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:MailingList/set
Section titled “x:MailingList/set”This is a standard Foo/set method as defined in RFC 8620, Section 5.3.
Supports create, update, and destroy operations in a single call.
Create
Section titled “Create”This operation requires the sysMailingListCreate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MailingList/set", { "create": { "new1": { "aliases": {}, "domainId": "<Domain id>", "name": "alice", "recipients": {} } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Update
Section titled “Update”This operation requires the sysMailingListUpdate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MailingList/set", { "update": { "id1": { "description": "updated value" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Destroy
Section titled “Destroy”This operation requires the sysMailingListDestroy permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MailingList/set", { "destroy": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:MailingList/query
Section titled “x:MailingList/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysMailingListQuery permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MailingList/query", { "filter": { "text": "example" } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'The x:MailingList/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):
| Condition | Kind |
|---|---|
text | text |
memberTenantId | id of Tenant |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get MailingList id1Create
Section titled “Create”stalwart-cli create MailingList \ --field name=alice \ --field 'domainId=<Domain id>' \ --field 'aliases={}' \ --field 'recipients={}'stalwart-cli query MailingListstalwart-cli query MailingList --where text=exampleUpdate
Section titled “Update”stalwart-cli update MailingList id1 --field description='updated value'Delete
Section titled “Delete”stalwart-cli delete MailingList --ids id1Nested types
Section titled “Nested types”EmailAlias
Section titled “EmailAlias”Defines an email alias for an account or mailing list.
enabled
Section titled “enabled”Type:
Boolean· default:trueWhether this email alias is enabled
Type:
EmailLocalPart· requiredThe local part of the email alias (the part before the @ symbol)
domainId
Section titled “domainId”Type:
Id<Domain>· requiredIdentifier for the domain of the email alias (the part after the @ symbol).
description
Section titled “description”Type:
String?Description of the email alias