MtaMilter
MtaMilter
Section titled “MtaMilter”Defines a Milter filter endpoint for message processing.
This object can be configured from the WebUI under Settings › MTA › Filters › Milters
Fields
Section titled “Fields”allowInvalidCerts
Section titled “allowInvalidCerts”Type:
Boolean· default:falseWhether Stalwart should connect to a Milter filter server that has an invalid TLS certificate
enable
Section titled “enable”Type:
Expression· default:{"else":"true"}Expression that determines whether to enable this milter
Available variables:
MtaRcptToVariable.
hostname
Section titled “hostname”Type:
String· requiredHostname or IP address of the server where the Milter filter is running
maxResponseSize
Section titled “maxResponseSize”Type:
Size· default:52428800Maximum size, in bytes, of a response that Stalwart will accept from this Milter server
tempFailOnError
Section titled “tempFailOnError”Type:
Boolean· default:trueWhether to respond with a temporary failure (typically a 4xx SMTP status code) when Stalwart encounters an error while communicating with this Milter server
protocolVersion
Section titled “protocolVersion”Type:
MilterVersion· default:"v6"Version of the Milter protocol that Stalwart should use when communicating with the Milter server
Type:
UnsignedInt· default:11332· max: 65535 · min: 1Network port on the Milter filter host server
stages
Section titled “stages”Type:
MtaStage[]· default:["data"]· min items: 1Which SMTP stages to run the milter on
timeoutCommand
Section titled “timeoutCommand”Type:
Duration· default:"30s"How long Stalwart will wait to send a command to the Milter server
timeoutConnect
Section titled “timeoutConnect”Type:
Duration· default:"30s"Maximum amount of time that Stalwart will wait to establish a connection with this Milter server
timeoutData
Section titled “timeoutData”Type:
Duration· default:"60s"Maximum amount of time Stalwart will wait for a response from the Milter server
useTls
Section titled “useTls”Type:
Boolean· default:falseWhether to use Transport Layer Security (TLS) for the connection between Stalwart and the Milter filter
flagsAction
Section titled “flagsAction”Type:
UnsignedInt?Optional flags to set on the Milter connection. See the Milter protocol documentation for details on available flags.
flagsProtocol
Section titled “flagsProtocol”Type:
UnsignedInt?Optional protocol flags to set on the Milter connection. See the Milter protocol documentation for details on available protocol flags.
JMAP API
Section titled “JMAP API”The MtaMilter object is available via the urn:stalwart:jmap capability.
x:MtaMilter/get
Section titled “x:MtaMilter/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysMtaMilterGet permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MtaMilter/get", { "ids": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:MtaMilter/set
Section titled “x:MtaMilter/set”This is a standard Foo/set method as defined in RFC 8620, Section 5.3.
Supports create, update, and destroy operations in a single call.
Create
Section titled “Create”This operation requires the sysMtaMilterCreate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MtaMilter/set", { "create": { "new1": { "hostname": "Example" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Update
Section titled “Update”This operation requires the sysMtaMilterUpdate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MtaMilter/set", { "update": { "id1": { "hostname": "updated value" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Destroy
Section titled “Destroy”This operation requires the sysMtaMilterDestroy permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MtaMilter/set", { "destroy": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:MtaMilter/query
Section titled “x:MtaMilter/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysMtaMilterQuery permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MtaMilter/query", { "filter": {} }, "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 MtaMilter id1Create
Section titled “Create”stalwart-cli create MtaMilter \ --field hostname=Examplestalwart-cli query MtaMilterUpdate
Section titled “Update”stalwart-cli update MtaMilter id1 --field hostname='updated value'Delete
Section titled “Delete”stalwart-cli delete MtaMilter --ids id1Nested 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
MilterVersion
Section titled “MilterVersion”| Value | Label |
|---|---|
v2 | Version 2 |
v6 | Version 6 |
MtaStage
Section titled “MtaStage”| Value | Label |
|---|---|
connect | Connect |
ehlo | EHLO |
auth | AUTH |
mail | MAIL FROM |
rcpt | RCPT TO |
data | DATA |
Expression references
Section titled “Expression references”The following expression contexts are used by fields on this page:
MtaRcptToVariable(Variables)