MtaStageData
MtaStageData
Section titled “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
Section titled “Fields”addAuthResultsHeader
Section titled “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
Section titled “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
Section titled “addDeliveredToHeader”Type:
Boolean· default:trueWhether to add a Delivered-To header to the message
addMessageIdHeader
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Section titled “maxMessages”Type:
Expression· default:{"else":"10"}Maximum number of messages that can be submitted per SMTP session
Available variables:
MtaRcptToVariable.
maxReceivedHeaders
Section titled “maxReceivedHeaders”Type:
Expression· default:{"else":"50"}Maximum limit on the number of Received headers, which helps to prevent message loops
Available variables:
MtaRcptToVariable.
maxMessageSize
Section titled “maxMessageSize”Type:
Expression· default:{"else":"104857600"}Maximum size of a message in bytes
Available variables:
MtaRcptToVariable.
script
Section titled “script”Type:
Expression· default:{"else":"false"}Which Sieve script to run after the client sends a DATA command
Available variables:
MtaRcptToVariable.
enableSpamFilter
Section titled “enableSpamFilter”Type:
Expression· default:{"else":"is_empty(authenticated_as)"}Whether to enable the spam filter for incoming messages
Available variables:
MtaRcptToVariable.
JMAP API
Section titled “JMAP API”The MtaStageData singleton is available via the urn:stalwart:jmap capability.
x:MtaStageData/get
Section titled “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
Section titled “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" ] }'stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get MtaStageDataUpdate
Section titled “Update”stalwart-cli update MtaStageData --field addAuthResultsHeader='{"else":"false","match":[{"if":"local_port == 25","then":"true"}]}'Nested types
Section titled “Nested types”Expression
Section titled “Expression”A conditional expression with match rules and a default value.
Type:
ExpressionMatch[]List of conditions and their corresponding results
Type:
String· requiredElse condition
ExpressionMatch
Section titled “ExpressionMatch”A single condition-result pair in an expression.
Type:
String· requiredIf condition
Type:
String· requiredThen clause
Expression references
Section titled “Expression references”The following expression contexts are used by fields on this page:
MtaRcptToVariable(Variables)