Skip to main content
Version: 0.16

Imap

Configures IMAP protocol settings including authentication, timeouts, and rate limits.

This object can be configured from the WebUI under Settings › Network › IMAP

Fields

allowPlainTextAuth

Type: Boolean · default: false

Whether to allow plain text authentication on unencrypted connections

maxAuthFailures

Type: UnsignedInt · default: 3 · min: 1

Number of authentication attempts a user can make before being disconnected by the server

maxConcurrent

Type: UnsignedInt? · default: 16 · min: 1

The maximum number of concurrent connections

maxRequestRate

Type: Rate? · default: {"count":2000,"period":"1m"}

The maximum number of requests per minute

maxRequestSize

Type: Size · default: "50mb"

Maximum size of an IMAP request that the server will accept

timeoutAnonymous

Type: Duration · default: "1m"

Time an unauthenticated session can stay inactive before being ended by the server

timeoutAuthenticated

Type: Duration · default: "30m"

Time an authenticated session can remain idle before the server terminates it

timeoutIdle

Type: Duration · default: "30m"

Time a connection can stay idle in the IMAP IDLE state before the server breaks the connection

JMAP API

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

x:Imap/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 sysImapGet permission.

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

x:Imap/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 sysImapUpdate permission.

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

CLI

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

Fetch

stalwart-cli get imap

Update

stalwart-cli update imap --field description='Updated'

Nested types

Rate

Defines a rate limit as a count over a time period.

count

Type: UnsignedInt · default: 0 · min: 1 · max: 1000000

Count

period

Type: Duration · default: "0s" · min: 1

Period