HttpLookup
HttpLookup
Section titled “HttpLookup”Defines an HTTP-based lookup list.
This object can be configured from the WebUI under Settings › Lookups › HTTP Lists
Fields
Section titled “Fields”namespace
Section titled “namespace”Type:
String· read-onlyUnique identifier for this store when used in lookups
enable
Section titled “enable”Type:
Boolean· default:trueWhether to enable this HTTP list
format
Section titled “format”Type:
HttpLookupFormat· requiredFormat of the list
isGzipped
Section titled “isGzipped”Type:
Boolean· default:falseWhether to use gzip compression when downloading the list
maxEntries
Section titled “maxEntries”Type:
UnsignedInt· default:100000· max: 1048576 · min: 1Maximum number of entries allowed in the list. The list is truncated if it exceeds this limit.
maxEntrySize
Section titled “maxEntrySize”Type:
Size· default:512· max: 1048576 · min: 1Maximum length of an entry in the list.
maxSize
Section titled “maxSize”Type:
Size· default:"100mb"· max: 1073741824 · min: 10Maximum size of the list. The list is truncated if it exceeds this size.
refresh
Section titled “refresh”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.
timeout
Section titled “timeout”Type:
Duration· default:"30s"How long to wait for the list to download before timing out
Type:
Uri· requiredURL of the list
JMAP API
Section titled “JMAP API”The HttpLookup object is available via the urn:stalwart:jmap capability.
x:HttpLookup/get
Section titled “x:HttpLookup/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysHttpLookupGet permission.
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" ] }'x:HttpLookup/set
Section titled “x:HttpLookup/set”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.
Create
Section titled “Create”This operation requires the sysHttpLookupCreate permission.
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" ] }'Update
Section titled “Update”This operation requires the sysHttpLookupUpdate permission.
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" ] }'Destroy
Section titled “Destroy”This operation requires the sysHttpLookupDestroy permission.
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" ] }'x:HttpLookup/query
Section titled “x:HttpLookup/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysHttpLookupQuery permission.
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.
stalwart-cli get HttpLookup id1Create
Section titled “Create”stalwart-cli create HttpLookup \ --field 'format={"@type":"Csv"}' \ --field url=https://example.comstalwart-cli query HttpLookupUpdate
Section titled “Update”stalwart-cli update HttpLookup id1 --field enable=trueDelete
Section titled “Delete”stalwart-cli delete HttpLookup --ids id1Nested types
Section titled “Nested types”HttpLookupFormat
Section titled “HttpLookupFormat”Format of HTTP lookup lists.
Csv: CSV. Carries the fields ofHttpLookupCsv.List: List. No additional fields.
HttpLookupCsv
Section titled “HttpLookupCsv”CSV parsing settings for HTTP lookup lists.
indexKey
Section titled “indexKey”Type:
UnsignedInt· default:0The position of the key field in the HTTP List.
indexValue
Section titled “indexValue”Type:
UnsignedInt?The position of the value field in the HTTP List.
separator
Section titled “separator”Type:
String· default:","The separator character used to parse the HTTP list.
skipFirst
Section titled “skipFirst”Type:
Boolean· default:falseWhether to skip the first line of the list