MtaStageMail
Configures MAIL FROM stage processing and sender validation.
This object can be configured from the WebUI under Settings › MTA › Session › MAIL FROM Stage
Fields
isSenderAllowed
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.
rewrite
Type:
Expression· default:{"else":"false"}Expression to rewrite the sender address
Available variables:
MtaMailFromVariable.
script
Type:
Expression· default:{"else":"false"}Which Sieve script to run after the client sends a MAIL command
Available variables:
MtaMailFromVariable.
JMAP API
The MtaStageMail singleton is available via the urn:stalwart:jmap capability.
x:MtaStageMail/get
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.
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"
]
}'
x:MtaStageMail/set
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.
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"
]
}'
CLI
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
Fetch
stalwart-cli get mta-stage-mail
Update
stalwart-cli update mta-stage-mail --field description='Updated'
Nested types
Expression
A conditional expression with match rules and a default value.
match
Type:
ExpressionMatch[]List of conditions and their corresponding results
else
Type:
String· requiredElse condition
ExpressionMatch
A single condition-result pair in an expression.
if
Type:
String· requiredIf condition
then
Type:
String· requiredThen clause
Expression references
The following expression contexts are used by fields on this page:
MtaMailFromVariable(Variables)