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
Fields
Section titled “Fields”atRestEnable
Section titled “atRestEnable”Type:
Boolean· default:trueEncrypt stored messages for accounts that configured encryption at rest
gatewayEnable
Section titled “gatewayEnable”Type:
Boolean· default:falseEnable the encryption gateway, which encrypts messages for remote recipients and maintains their public keys
gatewayOutbound
Section titled “gatewayOutbound”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.
gatewayMinTrust
Section titled “gatewayMinTrust”Type:
Expression· default:{"else":"harvested"}Minimum trust level a key needs before it is used for a recipient
Available variables:
MtaQueueRcptVariable.Available constants:
KeyTrustConstant.
gatewayMethods
Section titled “gatewayMethods”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
gatewayHeaderProtection
Section titled “gatewayHeaderProtection”Type:
HeaderProtection· default:"baseline"Header protection for messages encrypted for remote recipients. Signed messages are not header protected.
gatewayEncryptSigned
Section titled “gatewayEncryptSigned”Type:
Boolean· default:trueWhether to encrypt messages that are signed but not encrypted
harvestKeys
Section titled “harvestKeys”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.
hkpServers
Section titled “hkpServers”Type:
Set<Uri>Keyservers queried for keys that use the HKP discovery method
discoveryProxy
Section titled “discoveryProxy”Type:
Uri?HTTP proxy for key fetches and certificate revocation list downloads
sourceTimeout
Section titled “sourceTimeout”Type:
Duration· default:5000Maximum time spent fetching one key
keyRefreshInterval
Section titled “keyRefreshInterval”Type:
Duration· default:86400000How often keys are fetched again from their discovery method
negativeCacheTtl
Section titled “negativeCacheTtl”Type:
Duration· default:86400000How long an address with no key is remembered before the store is read again
useBundledRoots
Section titled “useBundledRoots”Type:
Boolean· default:trueTrust the bundled Mozilla S/MIME root certificates when validating recipient certificates
maxCrlSize
Section titled “maxCrlSize”Type:
Size· default:20000000· min: 1Maximum size of a downloaded certificate revocation list
JMAP API
Section titled “JMAP API”The Encryption singleton is available via the urn:stalwart:jmap capability.
x:Encryption/get
Section titled “x:Encryption/get”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.
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" ] }'x:Encryption/set
Section titled “x:Encryption/set”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.
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.
stalwart-cli get EncryptionUpdate
Section titled “Update”stalwart-cli update Encryption --field atRestEnable=trueNested types
Section titled “Nested types”Expression
Section titled “Expression”A conditional expression with match rules and a default value.
Type:
List<ExpressionMatch>List of conditions and their corresponding results
Type:
String· requiredElse condition
ExpressionMatch
Section titled “ExpressionMatch”A single condition-result pair in an expression.
Type:
String· requiredIf condition
Type:
String· requiredThen clause
PublicKeyKind
Section titled “PublicKeyKind”| Value | Label |
|---|---|
openPgp | OpenPGP |
smime | S/MIME |
HeaderProtection
Section titled “HeaderProtection”| Value | Label |
|---|---|
none | None |
noConfidentiality | Protected, headers visible |
baseline | Protected, Subject hidden |
Expression references
Section titled “Expression references”The following expression contexts are used by fields on this page:
EncryptionModeConstant(Constants)MtaQueueRcptVariable(Variables)KeyTrustConstant(Constants)EncryptionHarvestVariable(Variables)