Asn
Configures ASN and geolocation data sources for IP address lookups.
This object can be configured from the WebUI under Settings › Network › ASN & GeoIP
Fields
Section titled “Fields”Asn is a multi-variant object: each instance has an @type discriminator selecting one of the variants below, and each variant carries its own set of fields.
@type: "Disabled"
Section titled “@type: "Disabled"”Disabled
@type: "Resource"
Section titled “@type: "Resource"”URL Resource
expires
Section titled “expires”Type:
Duration· default:"1d"How often to refresh the ASN/Geo data.
maxSize
Section titled “maxSize”Type:
Size· default:"100mb"Maximum size of the ASN/Geo data file.
timeout
Section titled “timeout”Type:
Duration· default:"5m"Time after which the ASN/Geo resource fetch is considered failed.
asnUrls
Section titled “asnUrls”Type:
String[]URLs to fetch CSV file containing the IP to ASN mappings.
geoUrls
Section titled “geoUrls”Type:
String[]URLs to fetch CSV file containing the IP to country code mappings.
httpAuth
Section titled “httpAuth”Type:
HttpAuth· requiredThe type of HTTP authentication to use
httpHeaders
Section titled “httpHeaders”Type:
Map<String, String>Additional headers to include in HTTP requests
@type: "Dns"
Section titled “@type: "Dns"”DNS Lookup
indexAsn
Section titled “indexAsn”Type:
UnsignedInt· default:0The position of the ASN in the DNS TXT record.
indexAsnName
Section titled “indexAsnName”Type:
UnsignedInt?The position of the ASN Name in the DNS TXT record.
indexCountry
Section titled “indexCountry”Type:
UnsignedInt?The position of the country code in the DNS TXT record.
separator
Section titled “separator”Type:
String· default:"|"The separator character used in the DNS TXT record.
zoneIpV4
Section titled “zoneIpV4”Type:
String· requiredThe DNS zone to query for IPv4 ASN and geolocation data.
zoneIpV6
Section titled “zoneIpV6”Type:
String· requiredThe DNS zone to query for IPv6 ASN and geolocation data.
JMAP API
Section titled “JMAP API”The Asn singleton is available via the urn:stalwart:jmap capability.
x:Asn/get
Section titled “x:Asn/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 sysAsnGet permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:Asn/get", { "ids": [ "singleton" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:Asn/set
Section titled “x:Asn/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 sysAsnUpdate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:Asn/set", { "update": { "singleton": { "description": "updated value" } } }, "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 AsnUpdate
Section titled “Update”stalwart-cli update Asn --field description='updated value'Nested types
Section titled “Nested types”HttpAuth
Section titled “HttpAuth”Defines the HTTP authentication method to use for HTTP requests.
Unauthenticated: Anonymous. No additional fields.Basic: Basic Authentication. Carries the fields ofHttpAuthBasic.Bearer: Bearer Token. Carries the fields ofHttpAuthBearer.
HttpAuthBasic
Section titled “HttpAuthBasic”HTTP Basic authentication credentials.
username
Section titled “username”Type:
String· requiredUsername for HTTP Basic Authentication
secret
Section titled “secret”Type:
SecretKey· requiredPassword for HTTP Basic Authentication
SecretKey
Section titled “SecretKey”A secret value provided directly, from an environment variable, or from a file.
Value: Secret value. Carries the fields ofSecretKeyValue.EnvironmentVariable: Secret read from environment variable. Carries the fields ofSecretKeyEnvironmentVariable.File: Secret read from file. Carries the fields ofSecretKeyFile.
SecretKeyValue
Section titled “SecretKeyValue”A secret value provided directly.
secret
Section titled “secret”Type:
String· required · secretPassword or secret value
SecretKeyEnvironmentVariable
Section titled “SecretKeyEnvironmentVariable”A secret value read from an environment variable.
variableName
Section titled “variableName”Type:
String· requiredEnvironment variable name to read the secret from
SecretKeyFile
Section titled “SecretKeyFile”A secret value read from a file.
filePath
Section titled “filePath”Type:
String· requiredFile path to read the secret from
HttpAuthBearer
Section titled “HttpAuthBearer”HTTP Bearer token authentication.
bearerToken
Section titled “bearerToken”Type:
SecretKey· requiredBearer token for HTTP Bearer Authentication