MtaStageAuth
Configures SMTP authentication requirements and error handling.
This object can be configured from the WebUI under Settings › MTA › Session › AUTH Stage
Fields
maxFailures
Type:
Expression· default:{"else":"3"}Maximum number of authentication errors allowed before the session is disconnected
Available variables:
MtaEhloVariable.
waitOnFail
Type:
Expression· default:{"else":"5s"}Time interval to wait after an authentication failure
Available variables:
MtaEhloVariable.
saslMechanisms
Type:
Expression· default:{"else":"false","match":[{"if":"local_port != 25 && is_tls","then":"[plain, login, oauthbearer, xoauth2]"},{"if":"local_port != 25","then":"[oauthbearer, xoauth2]"}]}A list of SASL authentication mechanisms offered to clients, or an empty list to disable authentication. Stalwart supports PLAIN, LOGIN, and OAUTHBEARER mechanisms
Available variables:
MtaEhloVariable.Available constants:
MtaAuthTypeConstant.
mustMatchSender
Type:
Expression· default:{"else":"true"}Specifies whether the authenticated user or any of their associated e-mail addresses must match the sender of the email message
Available variables:
MtaMailFromVariable.
require
Type:
Expression· default:{"else":"local_port != 25"}Specifies whether authentication is necessary to send email messages
Available variables:
MtaEhloVariable.
JMAP API
The MtaStageAuth singleton is available via the urn:stalwart:jmap capability.
x:MtaStageAuth/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 sysMtaStageAuthGet permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaStageAuth/get",
{
"ids": [
"singleton"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
x:MtaStageAuth/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 sysMtaStageAuthUpdate permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaStageAuth/set",
{
"update": {
"singleton": {
"maxFailures": {
"else": "3"
}
}
}
},
"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-auth
Update
stalwart-cli update mta-stage-auth --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:
MtaEhloVariable(Variables)MtaAuthTypeConstant(Constants)MtaMailFromVariable(Variables)