MtaConnectionStrategy
MtaConnectionStrategy
Section titled “MtaConnectionStrategy”Defines a connection strategy for outbound message delivery.
This object can be configured from the WebUI under Settings › MTA › Outbound › Connection Strategies
Fields
Section titled “Fields”Type:
String· read-onlyShort identifier for the strategy
description
Section titled “description”Type:
String?Short description of the connection strategy
ehloHostname
Section titled “ehloHostname”Type:
HostName?Overrides the EHLO hostname that will be used when connecting using this strategy
sourceIps
Section titled “sourceIps”Type:
MtaConnectionIpHost[]List of local IPv4 and IPv6 addresses to use when delivering emails to remote SMTP servers
connectTimeout
Section titled “connectTimeout”Type:
Duration· default:"5m"Maximum time to wait for the connection to be established
dataTimeout
Section titled “dataTimeout”Type:
Duration· default:"10m"Maximum time to wait for the DATA command response
ehloTimeout
Section titled “ehloTimeout”Type:
Duration· default:"5m"Maximum time to wait for the EHLO command response
greetingTimeout
Section titled “greetingTimeout”Type:
Duration· default:"5m"Maximum time to wait for the SMTP greeting message
mailFromTimeout
Section titled “mailFromTimeout”Type:
Duration· default:"5m"Maximum time to wait for the MAIL-FROM command response
rcptToTimeout
Section titled “rcptToTimeout”Type:
Duration· default:"5m"Maximum time to wait for the RCPT-TO command response
JMAP API
Section titled “JMAP API”The MtaConnectionStrategy object is available via the urn:stalwart:jmap capability.
x:MtaConnectionStrategy/get
Section titled “x:MtaConnectionStrategy/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysMtaConnectionStrategyGet permission.
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" ] }'x:MtaConnectionStrategy/set
Section titled “x:MtaConnectionStrategy/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 sysMtaConnectionStrategyCreate permission.
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" ] }'Update
Section titled “Update”This operation requires the sysMtaConnectionStrategyUpdate permission.
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" ] }'Destroy
Section titled “Destroy”This operation requires the sysMtaConnectionStrategyDestroy permission.
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" ] }'x:MtaConnectionStrategy/query
Section titled “x:MtaConnectionStrategy/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysMtaConnectionStrategyQuery permission.
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):
| Condition | Kind |
|---|---|
name | text |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get MtaConnectionStrategy id1Create
Section titled “Create”stalwart-cli create MtaConnectionStrategy \ --field 'sourceIps={}'stalwart-cli query MtaConnectionStrategystalwart-cli query MtaConnectionStrategy --where name=exampleUpdate
Section titled “Update”stalwart-cli update MtaConnectionStrategy id1 --field description='updated value'Delete
Section titled “Delete”stalwart-cli delete MtaConnectionStrategy --ids id1Nested types
Section titled “Nested types”MtaConnectionIpHost
Section titled “MtaConnectionIpHost”Defines a source IP address and optional EHLO hostname override for outbound connections.
ehloHostname
Section titled “ehloHostname”Type:
HostName?Overrides the EHLO hostname that will be used when connecting from this IP address
sourceIp
Section titled “sourceIp”Type:
IpAddr· requiredLocal IPv4 and IPv6 address to use when delivering emails to remote SMTP servers