Skip to content

MtaStageData

Configures message processing rules for the SMTP DATA stage.

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

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.

Type: Expression · default: {"else":"false","match":[{"if":"local_port == 25","then":"true"}]}

Whether to add a Date header to the message

Available variables: MtaRcptToVariable.

Type: Boolean · default: true

Whether to add a Delivered-To header to the message

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.

Type: Expression · default: {"else":"false","match":[{"if":"local_port == 25","then":"true"}]}

Whether to add a Received header to the message

Available variables: MtaRcptToVariable.

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.

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.

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

Maximum number of messages that can be submitted per SMTP session

Available variables: MtaRcptToVariable.

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

Maximum limit on the number of Received headers, which helps to prevent message loops

Available variables: MtaRcptToVariable.

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

Maximum size of a message in bytes

Available variables: MtaRcptToVariable.

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

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

Available variables: MtaRcptToVariable.

Type: Expression · default: {"else":"is_empty(authenticated_as)"}

Whether to enable the spam filter for incoming messages

Available variables: MtaRcptToVariable.

The MtaStageData 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 sysMtaStageDataGet permission.

Terminal window
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"
]
}'

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.

Terminal window
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"
]
}'

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

Terminal window
stalwart-cli get MtaStageData
Terminal window
stalwart-cli update MtaStageData --field addAuthResultsHeader='{"else":"false","match":[{"if":"local_port == 25","then":"true"}]}'

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: