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
name
Type:
EmailLocalPart· requiredName of the mailing list, typically an email address local part.
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
Type:
EmailAddress· server-setThe email address of the mailing list, formed as name@domain.
description
Type:
String?Description of the mailing list
aliases
Type:
EmailAlias[]List of email aliases for the mailing list
memberTenantId
Type:
Id<Tenant>?Identifier for the tenant this mailing list belongs to
recipients
Type:
EmailAddress[]List of email addresses that are members of the mailing list
JMAP API
The MailingList object is available via the urn:stalwart:jmap capability.
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
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
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": [],
"description": "Example",
"domainId": "<Domain id>",
"memberTenantId": "<Tenant id>",
"name": "alice",
"recipients": []
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
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
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
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 |
CLI
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
Fetch
stalwart-cli get mailing-list id1
Create
stalwart-cli create mailing-list \
--field name=alice \
--field 'domainId=<Domain id>' \
--field description=Example \
--field 'aliases=[]' \
--field 'memberTenantId=<Tenant id>' \
--field 'recipients=[]'
Query
stalwart-cli query mailing-list
stalwart-cli query mailing-list --where text=example
Update
stalwart-cli update mailing-list id1 --field description='Updated'
Delete
stalwart-cli delete mailing-list --ids id1
Nested types
EmailAlias
Defines an email alias for an account or mailing list.
enabled
Type:
Boolean· default:trueWhether this email alias is enabled
name
Type:
EmailLocalPart· requiredThe local part of the email alias (the part before the @ symbol)
domainId
Type:
Id<Domain>· requiredIdentifier for the domain of the email alias (the part after the @ symbol).
description
Type:
String?Description of the email alias