MtaStageAuth
MtaStageAuth
Section titled “MtaStageAuth”Configures SMTP authentication requirements and error handling.
This object can be configured from the WebUI under Settings › MTA › Session › AUTH Stage
Fields
Section titled “Fields”maxFailures
Section titled “maxFailures”Type:
Expression· default:{"else":"3"}Maximum number of authentication errors allowed before the session is disconnected
Available variables:
MtaEhloVariable.
waitOnFail
Section titled “waitOnFail”Type:
Expression· default:{"else":"5s"}Time interval to wait after an authentication failure
Available variables:
MtaEhloVariable.
saslMechanisms
Section titled “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
Section titled “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
Section titled “require”Type:
Expression· default:{"else":"local_port != 25"}Specifies whether authentication is necessary to send email messages
Available variables:
MtaEhloVariable.
JMAP API
Section titled “JMAP API”The MtaStageAuth singleton is available via the urn:stalwart:jmap capability.
x:MtaStageAuth/get
Section titled “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
Section titled “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" ] }'stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get MtaStageAuthUpdate
Section titled “Update”stalwart-cli update MtaStageAuth --field maxFailures='{"else":"3"}'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:
MtaEhloVariable(Variables)MtaAuthTypeConstant(Constants)MtaMailFromVariable(Variables)