Skip to content

BlockedIp

Defines a blocked IP address or network range.

This object can be configured from the WebUI under Settings › Security › Blocked IPs

Type: IpMask · read-only

The IP address or mask to block

Type: BlockReason · default: "manual"

The reason for blocking this IP address

Type: UTCDateTime · server-set

The date and time when this IP address was blocked

Type: UTCDateTime?

The date and time when this IP address block will expire

The BlockedIp 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 sysBlockedIpGet permission.

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

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

This operation requires the sysBlockedIpUpdate permission.

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

This operation requires the sysBlockedIpDestroy permission.

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

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

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

ConditionKind
addresstext

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

Terminal window
stalwart-cli get BlockedIp id1
Terminal window
stalwart-cli create BlockedIp
Terminal window
stalwart-cli query BlockedIp
stalwart-cli query BlockedIp --where address=example
Terminal window
stalwart-cli update BlockedIp id1 --field reason=manual
Terminal window
stalwart-cli delete BlockedIp --ids id1
ValueLabel
rcptToFailureExcessive failed RCPT TO commands
authFailureExcessive failed authentication attempts
loiteringExcessive loitering connections
portScanningExcessive port scanning attempts
manualManually blocked IP address
otherOther reason