Skip to content

HttpLookup

Defines an HTTP-based lookup list.

This object can be configured from the WebUI under Settings › Lookups › HTTP Lists

Type: String · read-only

Unique identifier for this store when used in lookups

Type: Boolean · default: true

Whether to enable this HTTP list

Type: HttpLookupFormat · required

Format of the list

Type: Boolean · default: false

Whether to use gzip compression when downloading the list

Type: UnsignedInt · default: 100000 · max: 1048576 · min: 1

Maximum number of entries allowed in the list. The list is truncated if it exceeds this limit.

Type: Size · default: 512 · max: 1048576 · min: 1

Maximum length of an entry in the list.

Type: Size · default: "100mb" · max: 1073741824 · min: 10

Maximum size of the list. The list is truncated if it exceeds this size.

Type: Duration · default: "12h"

How often to refresh the list

Type: Duration · default: "1h"

How long to wait before retrying to download the list in case of failure.

Type: Duration · default: "30s"

How long to wait for the list to download before timing out

Type: Uri · required

URL of the list

The HttpLookup object is available via the urn:stalwart:jmap capability.

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

This method requires the sysHttpLookupGet permission.

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

Supports create, update, and destroy operations in a single call.

This operation requires the sysHttpLookupCreate permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:HttpLookup/set",
{
"create": {
"new1": {
"format": {
"@type": "Csv"
},
"url": "https://example.com"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysHttpLookupUpdate permission.

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

This operation requires the sysHttpLookupDestroy permission.

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

This is a standard Foo/query method as defined in RFC 8620, Section 5.5.

This method requires the sysHttpLookupQuery permission.

Terminal window
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:HttpLookup/query",
{
"filter": {}
},
"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 HttpLookup id1
Terminal window
stalwart-cli create HttpLookup \
--field 'format={"@type":"Csv"}' \
--field url=https://example.com
Terminal window
stalwart-cli query HttpLookup
Terminal window
stalwart-cli update HttpLookup id1 --field enable=true
Terminal window
stalwart-cli delete HttpLookup --ids id1

Format of HTTP lookup lists.

  • Csv: CSV. Carries the fields of HttpLookupCsv.
  • List: List. No additional fields.

CSV parsing settings for HTTP lookup lists.

Type: UnsignedInt · default: 0

The position of the key field in the HTTP List.

Type: UnsignedInt?

The position of the value field in the HTTP List.

Type: String · default: ","

The separator character used to parse the HTTP list.

Type: Boolean · default: false

Whether to skip the first line of the list