Skip to content

MtaRoute

Defines a routing rule for outbound message delivery.

This object can be configured from the WebUI under Settings › MTA › Outbound › Routes

MtaRoute is a multi-variant object: each instance has an @type discriminator selecting one of the variants below, and each variant carries its own set of fields.

Remote Delivery (MX)

Type: MtaIpStrategy · default: "v4ThenV6"

IP resolution strategy for MX hosts

Type: UnsignedInt · default: 2 · min: 1

For multi-homed remote servers, it is the maximum number of IP addresses to try on each delivery attempt

Type: UnsignedInt · default: 5 · min: 1

Maximum number of MX hosts to try on each delivery attempt

Type: String · read-only

Short identifier for the route

Type: String?

A short description of the route, which can be used to identify it in the list of routes

Relay Host

Type: String · required

The address of the remote SMTP server, which can be an IP address or a domain name

Type: SecretKeyOptional · required

The secret to use when authenticating with the remote server

Type: String?

The username to use when authenticating with the remote server

Type: UnsignedInt · default: 25 · max: 65535 · min: 1

The port number of the remote server, which is typically 25 for SMTP and 11200 for LMTP

Type: MtaProtocol · default: "smtp"

The protocol to use when delivering messages to the remote server, which can be either SMTP or LMTP

Type: Boolean · default: false

Whether to allow connections to servers with invalid TLS certificates

Type: Boolean · default: false

Whether to use TLS encryption for all connections to the remote server

Type: String · read-only

Short identifier for the route

Type: String?

A short description of the route, which can be used to identify it in the list of routes

Local Delivery

Type: String · read-only

Short identifier for the route

Type: String?

A short description of the route, which can be used to identify it in the list of routes

The MtaRoute 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 sysMtaRouteGet permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaRoute/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 sysMtaRouteCreate permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaRoute/set",
{
"create": {
"new1": {
"@type": "Mx"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysMtaRouteUpdate permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaRoute/set",
{
"update": {
"id1": {
"description": "updated value"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysMtaRouteDestroy permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaRoute/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 sysMtaRouteQuery permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaRoute/query",
{
"filter": {
"name": "example"
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

The x:MtaRoute/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):

ConditionKind
nametext

stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.

Terminal window
stalwart-cli get MtaRoute id1
Terminal window
stalwart-cli create MtaRoute/Mx
Terminal window
stalwart-cli query MtaRoute
stalwart-cli query MtaRoute --where name=example
Terminal window
stalwart-cli update MtaRoute id1 --field description='updated value'
Terminal window
stalwart-cli delete MtaRoute --ids id1

An optional secret value, or none.

  • None: No secret. No additional fields.
  • Value: Secret value. Carries the fields of SecretKeyValue.
  • EnvironmentVariable: Secret read from environment variable. Carries the fields of SecretKeyEnvironmentVariable.
  • File: Secret read from file. Carries the fields of SecretKeyFile.

A secret value provided directly.

Type: String · required · secret

Password or secret value

A secret value read from an environment variable.

Type: String · required

Environment variable name to read the secret from

A secret value read from a file.

Type: String · required

File path to read the secret from

ValueLabel
v4ThenV6IPv4 then IPv6
v6ThenV4IPv6 then IPv4
v4OnlyIPv4 Only
v6OnlyIPv6 Only
ValueLabel
smtpSMTP
lmtpLMTP