Skip to content

Asn

Configures ASN and geolocation data sources for IP address lookups.

This object can be configured from the WebUI under Settings › Network › ASN & GeoIP

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.

Disabled

URL Resource

Type: Duration · default: "1d"

How often to refresh the ASN/Geo data.

Type: Size · default: "100mb"

Maximum size of the ASN/Geo data file.

Type: Duration · default: "5m"

Time after which the ASN/Geo resource fetch is considered failed.

Type: String[]

URLs to fetch CSV file containing the IP to ASN mappings.

Type: String[]

URLs to fetch CSV file containing the IP to country code mappings.

Type: HttpAuth · required

The type of HTTP authentication to use

Type: Map<String, String>

Additional headers to include in HTTP requests

DNS Lookup

Type: UnsignedInt · default: 0

The position of the ASN in the DNS TXT record.

Type: UnsignedInt?

The position of the ASN Name in the DNS TXT record.

Type: UnsignedInt?

The position of the country code in the DNS TXT record.

Type: String · default: "|"

The separator character used in the DNS TXT record.

Type: String · required

The DNS zone to query for IPv4 ASN and geolocation data.

Type: String · required

The DNS zone to query for IPv6 ASN and geolocation data.

The Asn 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 sysAsnGet permission.

Terminal window
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"
]
}'

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.

Terminal window
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.

Terminal window
stalwart-cli get Asn
Terminal window
stalwart-cli update Asn --field description='updated value'

Defines the HTTP authentication method to use for HTTP requests.

  • Unauthenticated: Anonymous. No additional fields.
  • Basic: Basic Authentication. Carries the fields of HttpAuthBasic.
  • Bearer: Bearer Token. Carries the fields of HttpAuthBearer.

HTTP Basic authentication credentials.

Type: String · required

Username for HTTP Basic Authentication

Type: SecretKey · required

Password for HTTP Basic Authentication

A secret value provided directly, from an environment variable, or from a file.

A secret value provided directly.

Type: String · required · secret

Password or secret value

A secret value read from an environment variable.

Type: String · required

Environment variable name to read the secret from

A secret value read from a file.

Type: String · required

File path to read the secret from

HTTP Bearer token authentication.

Type: SecretKey · required

Bearer token for HTTP Bearer Authentication