Skip to content

Http

Configures HTTP server settings including rate limiting, CORS, and security headers.

This object can be configured from the WebUI under Settings › Network › HTTP › General Settings › Network › HTTP › Security

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

Specifies the request rate limit for authenticated users

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

Specifies the request rate limit for unauthenticated users

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

An expression that determines whether access to an endpoint is allowed. The expression should an HTTP status code (200, 403, etc.)

Available variables: HttpVariable.

Type: Boolean · default: false

Specifies whether to enable HTTP Strict Transport Security for the HTTP server.

Type: Boolean · default: false

Specifies whether to allow all origins in the CORS policy for the HTTP server

Type: Map<String, String>

Additional headers to include in HTTP responses

Type: Boolean · default: false

Specifies whether to use the Forwarded or X-Forwarded-For header to determine the client’s IP address

The Http 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 sysHttpGet permission.

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

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Http/set",
{
"update": {
"singleton": {
"rateLimitAuthenticated": {
"count": 1000,
"period": "1m"
}
}
}
},
"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 Http
Terminal window
stalwart-cli update Http --field rateLimitAuthenticated='{"count":1000,"period":"1m"}'

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

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

Count

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

Period

A conditional expression with match rules and a default value.

Type: 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

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