Skip to content

MtaConnectionStrategy

Defines a connection strategy for outbound message delivery.

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

Type: String · read-only

Short identifier for the strategy

Type: String?

Short description of the connection strategy

Type: HostName?

Overrides the EHLO hostname that will be used when connecting using this strategy

Type: MtaConnectionIpHost[]

List of local IPv4 and IPv6 addresses to use when delivering emails to remote SMTP servers

Type: Duration · default: "5m"

Maximum time to wait for the connection to be established

Type: Duration · default: "10m"

Maximum time to wait for the DATA command response

Type: Duration · default: "5m"

Maximum time to wait for the EHLO command response

Type: Duration · default: "5m"

Maximum time to wait for the SMTP greeting message

Type: Duration · default: "5m"

Maximum time to wait for the MAIL-FROM command response

Type: Duration · default: "5m"

Maximum time to wait for the RCPT-TO command response

The MtaConnectionStrategy 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 sysMtaConnectionStrategyGet permission.

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

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

This operation requires the sysMtaConnectionStrategyUpdate permission.

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

This operation requires the sysMtaConnectionStrategyDestroy permission.

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

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

The x:MtaConnectionStrategy/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 MtaConnectionStrategy id1
Terminal window
stalwart-cli create MtaConnectionStrategy \
--field 'sourceIps={}'
Terminal window
stalwart-cli query MtaConnectionStrategy
stalwart-cli query MtaConnectionStrategy --where name=example
Terminal window
stalwart-cli update MtaConnectionStrategy id1 --field description='updated value'
Terminal window
stalwart-cli delete MtaConnectionStrategy --ids id1

Defines a source IP address and optional EHLO hostname override for outbound connections.

Type: HostName?

Overrides the EHLO hostname that will be used when connecting from this IP address

Type: IpAddr · required

Local IPv4 and IPv6 address to use when delivering emails to remote SMTP servers