Skip to content

MtaMilter

Defines a Milter filter endpoint for message processing.

This object can be configured from the WebUI under Settings › MTA › Filters › Milters

Type: Boolean · default: false

Whether Stalwart should connect to a Milter filter server that has an invalid TLS certificate

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

Expression that determines whether to enable this milter

Available variables: MtaRcptToVariable.

Type: String · required

Hostname or IP address of the server where the Milter filter is running

Type: Size · default: 52428800

Maximum size, in bytes, of a response that Stalwart will accept from this Milter server

Type: Boolean · default: true

Whether to respond with a temporary failure (typically a 4xx SMTP status code) when Stalwart encounters an error while communicating with this Milter server

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: 1

Network port on the Milter filter host server

Type: MtaStage[] · default: ["data"] · min items: 1

Which SMTP stages to run the milter on

Type: Duration · default: "30s"

How long Stalwart will wait to send a command to the Milter server

Type: Duration · default: "30s"

Maximum amount of time that Stalwart will wait to establish a connection with this Milter server

Type: Duration · default: "60s"

Maximum amount of time Stalwart will wait for a response from the Milter server

Type: Boolean · default: false

Whether to use Transport Layer Security (TLS) for the connection between Stalwart and the Milter filter

Type: UnsignedInt?

Optional flags to set on the Milter connection. See the Milter protocol documentation for details on available flags.

Type: UnsignedInt?

Optional protocol flags to set on the Milter connection. See the Milter protocol documentation for details on available protocol flags.

The MtaMilter object is available via the urn:stalwart:jmap capability.

This is a standard Foo/get method as defined in RFC 8620, Section 5.1.

This method requires the sysMtaMilterGet permission.

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

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.

This operation requires the sysMtaMilterCreate permission.

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

This operation requires the sysMtaMilterUpdate permission.

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

This operation requires the sysMtaMilterDestroy permission.

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

This is a standard Foo/query method as defined in RFC 8620, Section 5.5.

This method requires the sysMtaMilterQuery permission.

Terminal window
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.

Terminal window
stalwart-cli get MtaMilter id1
Terminal window
stalwart-cli create MtaMilter \
--field hostname=Example
Terminal window
stalwart-cli query MtaMilter
Terminal window
stalwart-cli update MtaMilter id1 --field hostname='updated value'
Terminal window
stalwart-cli delete MtaMilter --ids id1

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

ValueLabel
v2Version 2
v6Version 6
ValueLabel
connectConnect
ehloEHLO
authAUTH
mailMAIL FROM
rcptRCPT TO
dataDATA

The following expression contexts are used by fields on this page: