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
Fields
Section titled “Fields”rateLimitAuthenticated
Section titled “rateLimitAuthenticated”Type:
Rate?· default:{"count":1000,"period":"1m"}Specifies the request rate limit for authenticated users
rateLimitAnonymous
Section titled “rateLimitAnonymous”Type:
Rate?· default:{"count":100,"period":"1m"}Specifies the request rate limit for unauthenticated users
allowedEndpoints
Section titled “allowedEndpoints”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.
enableHsts
Section titled “enableHsts”Type:
Boolean· default:falseSpecifies whether to enable HTTP Strict Transport Security for the HTTP server.
usePermissiveCors
Section titled “usePermissiveCors”Type:
Boolean· default:falseSpecifies whether to allow all origins in the CORS policy for the HTTP server
responseHeaders
Section titled “responseHeaders”Type:
Map<String, String>Additional headers to include in HTTP responses
useXForwarded
Section titled “useXForwarded”Type:
Boolean· default:falseSpecifies whether to use the Forwarded or X-Forwarded-For header to determine the client’s IP address
JMAP API
Section titled “JMAP API”The Http singleton is available via the urn:stalwart:jmap capability.
x:Http/get
Section titled “x:Http/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 sysHttpGet permission.
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" ] }'x:Http/set
Section titled “x:Http/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 sysHttpUpdate permission.
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.
stalwart-cli get HttpUpdate
Section titled “Update”stalwart-cli update Http --field rateLimitAuthenticated='{"count":1000,"period":"1m"}'Nested types
Section titled “Nested types”Defines a rate limit as a count over a time period.
Type:
UnsignedInt· default:0· min: 1 · max: 1000000Count
period
Section titled “period”Type:
Duration· default:"0s"· min: 1Period
Expression
Section titled “Expression”A conditional expression with match rules and a default value.
Type:
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
Expression references
Section titled “Expression references”The following expression contexts are used by fields on this page:
HttpVariable(Variables)