MtaStageData
Configures message processing rules for the SMTP DATA stage.
This object can be configured from the WebUI under Settings › MTA › Session › DATA Stage
Fields
addAuthResultsHeader
Type:
Expression· default:{"else":"false","match":[{"if":"local_port == 25","then":"true"}]}Whether to add an Authentication-Results header to the message
Available variables:
MtaRcptToVariable.
addDateHeader
Type:
Expression· default:{"else":"false","match":[{"if":"local_port == 25","then":"true"}]}Whether to add a Date header to the message
Available variables:
MtaRcptToVariable.
addDeliveredToHeader
Type:
Boolean· default:trueWhether to add a Delivered-To header to the message
addMessageIdHeader
Type:
Expression· default:{"else":"false","match":[{"if":"local_port == 25","then":"true"}]}Whether to add a Message-Id header to the message
Available variables:
MtaRcptToVariable.
addReceivedHeader
Type:
Expression· default:{"else":"false","match":[{"if":"local_port == 25","then":"true"}]}Whether to add a Received header to the message
Available variables:
MtaRcptToVariable.
addReceivedSpfHeader
Type:
Expression· default:{"else":"false","match":[{"if":"local_port == 25","then":"true"}]}Whether to add a Received-SPF header to the message
Available variables:
MtaRcptToVariable.
addReturnPathHeader
Type:
Expression· default:{"else":"false","match":[{"if":"local_port == 25","then":"true"}]}Whether to add a Return-Path header to the message
Available variables:
MtaRcptToVariable.
maxMessages
Type:
Expression· default:{"else":"10"}Maximum number of messages that can be submitted per SMTP session
Available variables:
MtaRcptToVariable.
maxReceivedHeaders
Type:
Expression· default:{"else":"50"}Maximum limit on the number of Received headers, which helps to prevent message loops
Available variables:
MtaRcptToVariable.
maxMessageSize
Type:
Expression· default:{"else":"104857600"}Maximum size of a message in bytes
Available variables:
MtaRcptToVariable.
script
Type:
Expression· default:{"else":"false"}Which Sieve script to run after the client sends a DATA command
Available variables:
MtaRcptToVariable.
enableSpamFilter
Type:
Expression· default:{"else":"is_empty(authenticated_as)"}Whether to enable the spam filter for incoming messages
Available variables:
MtaRcptToVariable.
JMAP API
The MtaStageData singleton is available via the urn:stalwart:jmap capability.
x:MtaStageData/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 sysMtaStageDataGet permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaStageData/get",
{
"ids": [
"singleton"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
x:MtaStageData/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 sysMtaStageDataUpdate permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaStageData/set",
{
"update": {
"singleton": {
"addAuthResultsHeader": {
"else": "false",
"match": [
{
"if": "local_port == 25",
"then": "true"
}
]
}
}
}
},
"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-data
Update
stalwart-cli update mta-stage-data --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:
MtaRcptToVariable(Variables)