Skip to content

Encryption

Configures encryption at rest and the encryption gateway.

This object can be configured from the WebUI under Settings › Encryption › Key Discovery, Settings › Encryption › Gateway, Settings › Encryption › Encryption at Rest, Settings › Encryption › S/MIME Trust

Type: Boolean · default: true

Encrypt stored messages for accounts that configured encryption at rest

Type: Boolean · default: false

Enable the encryption gateway, which encrypts messages for remote recipients and maintains their public keys

Type: Expression · default: {"else":"opportunistic","match":{"0":{"if":"is_local_domain(rcpt_domain)","then":"disable"}}}

When to encrypt a message for a recipient with a stored key

Available variables: MtaQueueRcptVariable.

Available constants: EncryptionModeConstant.

Type: Expression · default: {"else":"harvested"}

Minimum trust level a key needs before it is used for a recipient

Available variables: MtaQueueRcptVariable.

Available constants: KeyTrustConstant.

Type: Set<PublicKeyKind> · default: {"openPgp":true,"smime":true}

Key types the gateway encrypts with; when a DNS lookup returns both an OpenPGP key and an S/MIME certificate for a new key, the certificate is stored

Type: HeaderProtection · default: "baseline"

Header protection for messages encrypted for remote recipients. Signed messages are not header protected.

Type: Boolean · default: true

Whether to encrypt messages that are signed but not encrypted

Type: Expression · default: {"else":"!is_local_domain(sender_domain)"}

Whether to learn the S/MIME certificate or Autocrypt key of an authenticated sender from a received message; a valid OpenPGP signature on the message raises the trust level of an Autocrypt key

Available variables: EncryptionHarvestVariable.

Type: Set<Uri>

Keyservers queried for keys that use the HKP discovery method

Type: Uri?

HTTP proxy for key fetches and certificate revocation list downloads

Type: Duration · default: 5000

Maximum time spent fetching one key

Type: Duration · default: 86400000

How often keys are fetched again from their discovery method

Type: Duration · default: 86400000

How long an address with no key is remembered before the store is read again

Type: Boolean · default: true

Trust the bundled Mozilla S/MIME root certificates when validating recipient certificates

Type: Size · default: 20000000 · min: 1

Maximum size of a downloaded certificate revocation list

The Encryption singleton is available via the urn:stalwart:jmap capability.

This is a standard Foo/get method as defined in RFC 8620, Section 5.1.

For singletons, the ids argument should be the literal singleton (or null to return the single instance).

This method requires the sysEncryptionGet permission.

Terminal window
curl -X POST https://mail.example.com/jmap/ \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Encryption/get",
{
"ids": [
"singleton"
]
},
"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.

For singletons, only the update argument with id singleton is accepted; create and destroy arguments are rejected.

This method requires the sysEncryptionUpdate permission.

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

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

Terminal window
stalwart-cli get Encryption
Terminal window
stalwart-cli update Encryption --field atRestEnable=true

A conditional expression with match rules and a default value.

Type: List<ExpressionMatch>

List of conditions and their corresponding results

Type: String · required

Else condition

A single condition-result pair in an expression.

Type: String · required

If condition

Type: String · required

Then clause

ValueLabel
openPgpOpenPGP
smimeS/MIME
ValueLabel
noneNone
noConfidentialityProtected, headers visible
baselineProtected, Subject hidden

The following expression contexts are used by fields on this page: