Skip to content

MtaStageMail

Configures MAIL FROM stage processing and sender validation.

This object can be configured from the WebUI under Settings › MTA › Session › MAIL FROM Stage

Type: Expression · default: {"else":"!is_empty(authenticated_as) || !key_exists('spam-block', sender_domain)","match":[]}

Expression that returns true when the sender is allowed to send

Available variables: MtaMailFromVariable.

Type: Expression · default: {"else":"false"}

Expression to rewrite the sender address

Available variables: MtaMailFromVariable.

Type: Expression · default: {"else":"false"}

Which Sieve script to run after the client sends a MAIL command

Available variables: MtaMailFromVariable.

The MtaStageMail singleton is available via the urn:stalwart:jmap capability.

This is a standard Foo/get method as defined in RFC 8620, Section 5.1.

For singletons, the ids argument should be the literal singleton (or null to return the single instance).

This method requires the sysMtaStageMailGet permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaStageMail/get",
{
"ids": [
"singleton"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This is a standard Foo/set method as defined in RFC 8620, Section 5.3.

For singletons, only the update argument with id singleton is accepted; create and destroy arguments are rejected.

This method requires the sysMtaStageMailUpdate permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaStageMail/set",
{
"update": {
"singleton": {
"isSenderAllowed": {
"else": "!is_empty(authenticated_as) || !key_exists('spam-block', sender_domain)",
"match": []
}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.

Terminal window
stalwart-cli get MtaStageMail
Terminal window
stalwart-cli update MtaStageMail --field isSenderAllowed='{"else":"!is_empty(authenticated_as) || !key_exists('\''spam-block'\'', sender_domain)","match":[]}'

A conditional expression with match rules and a default value.

Type: ExpressionMatch[]

List of conditions and their corresponding results

Type: String · required

Else condition

A single condition-result pair in an expression.

Type: String · required

If condition

Type: String · required

Then clause

The following expression contexts are used by fields on this page: