MaskedEmail
MaskedEmail
Section titled “MaskedEmail”Defines a masked email address for privacy protection.
This object can be configured from the WebUI under Account › Masked Addresses
Fields
Section titled “Fields”enabled
Section titled “enabled”Type:
Boolean· default:trueWhether this masked email address is enabled
accountId
Section titled “accountId”Type:
Id<Account>· read-onlyIdentifier for the account this masked email address belongs to
Type:
String· server-setThe masked email address
description
Section titled “description”Type:
String?Description of the masked email address
forDomain
Section titled “forDomain”Type:
String?The domain name of the site this address was created for, e.g. “https://example.com”. This is intended to be added automatically by password managers.
createdAt
Section titled “createdAt”Type:
UTCDateTime· server-setThe date-time the email address was created.
createdBy
Section titled “createdBy”Type:
String?The name of the client that created this email address. This will be set by the server automatically based on the credentials used to authenticate the request, e.g. “ACME Password Manager”.
expiresAt
Section titled “expiresAt”Type:
UTCDateTime?· read-onlyExpiration date of the email address
Type:
String?A URL pointing back to the integrator’s use of this email address, e.g. a custom-uri to open “ACME Password Manager” at the appropriate entry.
emailPrefix
Section titled “emailPrefix”Type:
EmailLocalPart?· read-onlyThis is only used on create and otherwise ignored; if supplied, the server-assigned email will start with the given prefix. The string MUST be <= 64 characters in length and MUST only contain characters a-z, 0-9 and _ (underscore).
emailDomain
Section titled “emailDomain”Type:
DomainName?· read-onlyThis is only used on create and otherwise ignored; if supplied, the server-assigned email will end with the given domain.
JMAP API
Section titled “JMAP API”The MaskedEmail object is available via the urn:stalwart:jmap capability.
x:MaskedEmail/get
Section titled “x:MaskedEmail/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysMaskedEmailGet permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MaskedEmail/get", { "ids": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:MaskedEmail/set
Section titled “x:MaskedEmail/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 sysMaskedEmailCreate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MaskedEmail/set", { "create": { "new1": {} } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Update
Section titled “Update”This operation requires the sysMaskedEmailUpdate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MaskedEmail/set", { "update": { "id1": { "description": "updated value" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Destroy
Section titled “Destroy”This operation requires the sysMaskedEmailDestroy permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MaskedEmail/set", { "destroy": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:MaskedEmail/query
Section titled “x:MaskedEmail/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysMaskedEmailQuery permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MaskedEmail/query", { "filter": { "accountId": "id1" } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'The x:MaskedEmail/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):
| Condition | Kind |
|---|---|
accountId | id of Account |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get MaskedEmail id1Create
Section titled “Create”stalwart-cli create MaskedEmailstalwart-cli query MaskedEmailstalwart-cli query MaskedEmail --where accountId=id1Update
Section titled “Update”stalwart-cli update MaskedEmail id1 --field description='updated value'Delete
Section titled “Delete”stalwart-cli delete MaskedEmail --ids id1