SpamDnsblServer
Defines a DNSBL server used for spam filtering lookups.
This object can be configured from the WebUI under Settings › Spam Filter › DNSBL › Servers
Fields
SpamDnsblServer is a multi-variant object: each instance has an @type discriminator selecting one of the variants below, and each variant carries its own set of fields.
@type: "Any"
Any
tag
Type:
Expression· requiredExpression that returns the tag to assign to the message.
Available variables:
SpamIpVariable.
zone
Type:
Expression· requiredExpression that returns the DNS zone to query.
Available variables:
SpamGenericVariable.
name
Type:
String· read-onlyA unique name for this DNSBL server configuration
description
Type:
String?Description for the DNSBL server
enable
Type:
Boolean· default:trueWhether to enable this DNSBL server
@type: "Url"
URL
tag
Type:
Expression· requiredExpression that returns the tag to assign to the message.
Available variables:
SpamIpVariable.
zone
Type:
Expression· requiredExpression that returns the DNS zone to query.
Available variables:
SpamUrlVariable.
name
Type:
String· read-onlyA unique name for this DNSBL server configuration
description
Type:
String?Description for the DNSBL server
enable
Type:
Boolean· default:trueWhether to enable this DNSBL server
@type: "Domain"
Domain
tag
Type:
Expression· requiredExpression that returns the tag to assign to the message.
Available variables:
SpamIpVariable.
zone
Type:
Expression· requiredExpression that returns the DNS zone to query.
Available variables:
SpamGenericVariable.
name
Type:
String· read-onlyA unique name for this DNSBL server configuration
description
Type:
String?Description for the DNSBL server
enable
Type:
Boolean· default:trueWhether to enable this DNSBL server
@type: "Email"
tag
Type:
Expression· requiredExpression that returns the tag to assign to the message.
Available variables:
SpamIpVariable.
zone
Type:
Expression· requiredExpression that returns the DNS zone to query.
Available variables:
SpamEmailVariable.
name
Type:
String· read-onlyA unique name for this DNSBL server configuration
description
Type:
String?Description for the DNSBL server
enable
Type:
Boolean· default:trueWhether to enable this DNSBL server
@type: "Ip"
IP
tag
Type:
Expression· requiredExpression that returns the tag to assign to the message.
Available variables:
SpamIpVariable.
zone
Type:
Expression· requiredExpression that returns the DNS zone to query.
Available variables:
SpamIpVariable.
name
Type:
String· read-onlyA unique name for this DNSBL server configuration
description
Type:
String?Description for the DNSBL server
enable
Type:
Boolean· default:trueWhether to enable this DNSBL server
@type: "Header"
Header
tag
Type:
Expression· requiredExpression that returns the tag to assign to the message.
Available variables:
SpamIpVariable.
zone
Type:
Expression· requiredExpression that returns the DNS zone to query.
Available variables:
SpamHeaderVariable.
name
Type:
String· read-onlyA unique name for this DNSBL server configuration
description
Type:
String?Description for the DNSBL server
enable
Type:
Boolean· default:trueWhether to enable this DNSBL server
@type: "Body"
Body
tag
Type:
Expression· requiredExpression that returns the tag to assign to the message.
Available variables:
SpamIpVariable.
zone
Type:
Expression· requiredExpression that returns the DNS zone to query.
Available variables:
SpamGenericVariable.
name
Type:
String· read-onlyA unique name for this DNSBL server configuration
description
Type:
String?Description for the DNSBL server
enable
Type:
Boolean· default:trueWhether to enable this DNSBL server
JMAP API
The SpamDnsblServer object is available via the urn:stalwart:jmap capability.
x:SpamDnsblServer/get
This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysSpamDnsblServerGet permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:SpamDnsblServer/get",
{
"ids": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
x:SpamDnsblServer/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 sysSpamDnsblServerCreate permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:SpamDnsblServer/set",
{
"create": {
"new1": {
"@type": "Any",
"description": "Example",
"enable": true,
"tag": {
"else": "Example",
"match": []
},
"zone": {
"else": "Example",
"match": []
}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
Update
This operation requires the sysSpamDnsblServerUpdate permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:SpamDnsblServer/set",
{
"update": {
"id1": {
"id": "id1"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
Destroy
This operation requires the sysSpamDnsblServerDestroy permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:SpamDnsblServer/set",
{
"destroy": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
x:SpamDnsblServer/query
This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysSpamDnsblServerQuery permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:SpamDnsblServer/query",
{
"filter": {
"name": "example"
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
The x:SpamDnsblServer/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):
| Condition | Kind |
|---|---|
name | text |
CLI
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
Fetch
stalwart-cli get spam-dnsbl-server id1
Create
stalwart-cli create spam-dnsbl-server/any \
--field 'tag={"else":"Example","match":[]}' \
--field 'zone={"else":"Example","match":[]}' \
--field description=Example \
--field enable=true
Query
stalwart-cli query spam-dnsbl-server
stalwart-cli query spam-dnsbl-server --where name=example
Update
stalwart-cli update spam-dnsbl-server id1 --field description='Updated'
Delete
stalwart-cli delete spam-dnsbl-server --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
Expression references
The following expression contexts are used by fields on this page:
SpamIpVariable(Variables)SpamGenericVariable(Variables)SpamUrlVariable(Variables)SpamEmailVariable(Variables)SpamHeaderVariable(Variables)