MtaInboundThrottle
Defines an inbound rate limit rule for SMTP connections.
This object can be configured from the WebUI under Settings › MTA › Rates & Quotas › Inbound Rate Limits
Fields
enable
Type:
Boolean· default:trueWhether to enable this throttle
description
Type:
String· read-onlyShort description for the throttle
key
Type:
MtaInboundThrottleKey[]Optional list of context variables that determine where this throttle should be applied
match
Type:
Expression· default:{"else":"true"}Enable the imposition of concurrency and rate limits only when a specific condition is met
Available variables:
MtaRcptToVariable.
rate
Type:
Rate· requiredNumber of incoming requests over a period of time that the rate limiter will allow
JMAP API
The MtaInboundThrottle object is available via the urn:stalwart:jmap capability.
x:MtaInboundThrottle/get
This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysMtaInboundThrottleGet permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaInboundThrottle/get",
{
"ids": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
x:MtaInboundThrottle/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
This operation requires the sysMtaInboundThrottleCreate permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaInboundThrottle/set",
{
"create": {
"new1": {
"enable": true,
"key": [],
"match": {
"else": "true"
},
"rate": {
"count": 0,
"period": "0s"
}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
Update
This operation requires the sysMtaInboundThrottleUpdate permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaInboundThrottle/set",
{
"update": {
"id1": {
"enable": true
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
Destroy
This operation requires the sysMtaInboundThrottleDestroy permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaInboundThrottle/set",
{
"destroy": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
x:MtaInboundThrottle/query
This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysMtaInboundThrottleQuery permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:MtaInboundThrottle/query",
{
"filter": {}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
CLI
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
Fetch
stalwart-cli get mta-inbound-throttle id1
Create
stalwart-cli create mta-inbound-throttle \
--field enable=true \
--field 'key=[]' \
--field 'match={"else":"true"}' \
--field 'rate={"count":0,"period":"0s"}'
Query
stalwart-cli query mta-inbound-throttle
Update
stalwart-cli update mta-inbound-throttle id1 --field description='Updated'
Delete
stalwart-cli delete mta-inbound-throttle --ids id1
Nested types
Expression
A conditional expression with match rules and a default value.
match
Type:
ExpressionMatch[]List of conditions and their corresponding results
else
Type:
String· requiredElse condition
ExpressionMatch
A single condition-result pair in an expression.
if
Type:
String· requiredIf condition
then
Type:
String· requiredThen clause
Rate
Defines a rate limit as a count over a time period.
count
Type:
UnsignedInt· default:0· min: 1 · max: 1000000Count
period
Type:
Duration· default:"0s"· min: 1Period
Enums
MtaInboundThrottleKey
| Value | Label |
|---|---|
listener | Listener |
remoteIp | Remote IP |
localIp | Local IP |
authenticatedAs | Authenticated As |
heloDomain | EHLO Domain |
sender | Sender |
senderDomain | Sender Domain |
rcpt | Recipient |
rcptDomain | Recipient Domain |
Expression references
The following expression contexts are used by fields on this page:
MtaRcptToVariable(Variables)