AllowedIp
AllowedIp
Section titled “AllowedIp”Defines an allowed IP address or network range.
This object can be configured from the WebUI under Settings › Security › Allowed IPs
Fields
Section titled “Fields”address
Section titled “address”Type:
IpMask· read-onlyThe IP address or mask to allow
reason
Section titled “reason”Type:
String?The reason for allowing this IP address
createdAt
Section titled “createdAt”Type:
UTCDateTime· read-onlyThe date and time when this IP address was allowed
expiresAt
Section titled “expiresAt”Type:
UTCDateTime?The date and time when this IP address allowance will expire
JMAP API
Section titled “JMAP API”The AllowedIp object is available via the urn:stalwart:jmap capability.
x:AllowedIp/get
Section titled “x:AllowedIp/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysAllowedIpGet permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:AllowedIp/get", { "ids": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:AllowedIp/set
Section titled “x:AllowedIp/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 sysAllowedIpCreate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:AllowedIp/set", { "create": { "new1": {} } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Update
Section titled “Update”This operation requires the sysAllowedIpUpdate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:AllowedIp/set", { "update": { "id1": { "reason": "updated value" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Destroy
Section titled “Destroy”This operation requires the sysAllowedIpDestroy permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:AllowedIp/set", { "destroy": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:AllowedIp/query
Section titled “x:AllowedIp/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysAllowedIpQuery permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:AllowedIp/query", { "filter": { "address": "example" } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'The x:AllowedIp/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):
| Condition | Kind |
|---|---|
address | text |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get AllowedIp id1Create
Section titled “Create”stalwart-cli create AllowedIpstalwart-cli query AllowedIpstalwart-cli query AllowedIp --where address=exampleUpdate
Section titled “Update”stalwart-cli update AllowedIp id1 --field reason='updated value'Delete
Section titled “Delete”stalwart-cli delete AllowedIp --ids id1