Skip to content

SpamFileExtension

Defines a file extension classification rule for spam filtering.

This object can be configured from the WebUI under Settings › Spam Filter › Lists › File Extensions

Type: String · read-only

The file name extension

Type: Boolean · default: false

Whether this file extension is considered an archive

Type: Boolean · default: false

Whether this file extension is considered bad

Type: Boolean · default: false

Whether this file extension is considered a NZ file

Type: String[]

The MIME types associated with this file extension

The SpamFileExtension 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 sysSpamFileExtensionGet permission.

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

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

This operation requires the sysSpamFileExtensionUpdate permission.

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

This operation requires the sysSpamFileExtensionDestroy permission.

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

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

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

ConditionKind
extensiontext

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

Terminal window
stalwart-cli get SpamFileExtension id1
Terminal window
stalwart-cli create SpamFileExtension \
--field 'contentTypes={}'
Terminal window
stalwart-cli query SpamFileExtension
stalwart-cli query SpamFileExtension --where extension=example
Terminal window
stalwart-cli update SpamFileExtension id1 --field isArchive=false
Terminal window
stalwart-cli delete SpamFileExtension --ids id1