Skip to content

NetworkListener

Defines a network listener for accepting incoming connections.

This object can be configured from the WebUI under Settings › Network › Listeners

Type: String · read-only

Unique identifier for the listener

Type: Set<SocketAddr> · min items: 1

The addresses the listener will bind to

Type: NetworkListenerProtocol · default: "smtp"

The protocol used by the listener

Type: Set<IpMask>

Enable proxy protocol for connections from these networks

Type: UnsignedInt? · default: 1024 · min: 1

The maximum number of incoming connections that can be pending in the backlog queue

Type: Boolean · default: true

Whether the Nagle algorithm should be disabled for the socket

Type: UnsignedInt? · min: 1

The size of the buffer used for receiving data

Type: Boolean · default: true

Whether the socket can be bound to an address that is already in use by another socket

Type: Boolean · default: true

Whether multiple sockets can be bound to the same address and port

Type: UnsignedInt? · min: 1

The size of the buffer used for sending data

Type: UnsignedInt? · min: 1

The type of service (TOS) value for the socket, which determines the priority of the traffic sent through the socket

Type: UnsignedInt? · min: 1

Time-to-live (TTL) value for the socket, which determines how many hops a packet can make before it is discarded

Type: Boolean · default: true

Whether to enable TLS for this listener

Type: Set<TlsCipherSuite>

Which cipher suites to disable

Type: Set<TlsVersion>

Which TLS protocols to disable

Type: Boolean · default: true

Whether to ignore the client’s cipher order

Type: Boolean · default: false

Whether to use implicit TLS

Type: Duration? · default: 60000

TLS handshake timeout

Type: TlsClientAuth · default: {"@type":"Disabled"}

Whether clients must present a TLS certificate issued by a trusted certificate authority before the connection is accepted

Type: UnsignedInt? · min: 1

The maximum number of concurrent connections this listener accepts, shared by all its bind addresses. If not set, the default from System Settings applies

The NetworkListener 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 sysNetworkListenerGet permission.

Terminal window
curl -X POST https://mail.example.com/jmap/ \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:NetworkListener/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 the following operations in a single call: create, update, destroy.

This operation requires the sysNetworkListenerCreate permission.

Terminal window
curl -X POST https://mail.example.com/jmap/ \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:NetworkListener/set",
{
"create": {
"new1": {
"bind": {},
"overrideProxyTrustedNetworks": {},
"tlsDisableCipherSuites": {},
"tlsDisableProtocols": {}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'

This operation requires the sysNetworkListenerUpdate permission.

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

This operation requires the sysNetworkListenerDestroy permission.

Terminal window
curl -X POST https://mail.example.com/jmap/ \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:NetworkListener/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 sysNetworkListenerQuery permission.

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

The x:NetworkListener/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):

ConditionKind
nametext

stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.

Terminal window
stalwart-cli get NetworkListener id1
Terminal window
stalwart-cli create NetworkListener \
--field 'bind={}' \
--field 'overrideProxyTrustedNetworks={}' \
--field 'tlsDisableCipherSuites={}' \
--field 'tlsDisableProtocols={}'
Terminal window
stalwart-cli query NetworkListener
stalwart-cli query NetworkListener --where name=example
Terminal window
stalwart-cli update NetworkListener id1 --field bind='{}'
Terminal window
stalwart-cli delete NetworkListener --ids id1

Client certificate requirement for connections accepted by a listener.

  • Disabled: Not requested. No additional fields.
  • Required: Required. Carries the fields of TlsClientAuthRequired.

Clients must present a valid certificate issued by one of the trusted certificate authorities, otherwise the TLS handshake fails. Requires implicit TLS on the listener. The certificate only gates the connection: clients still authenticate as usual. Changes, including new revocation lists, take effect after a restart.

Type: PublicText · required

Certificate authorities in PEM format that issue the client certificates accepted by the listener

Type: PublicTextOptional · default: {"@type":"None"}

Certificate revocation lists in PEM format; client certificates revoked by any of them are rejected. Certificates issued by an authority without a matching list are accepted

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

A text value provided directly.

Type: Text · required

Text 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

An optional text value provided directly, from an environment variable, or from a file, or none.

  • None: No value. No additional fields.
  • Text: Text value. Carries the fields of PublicTextValue.
  • EnvironmentVariable: Text value read from environment variable. Carries the fields of SecretKeyEnvironmentVariable.
  • File: Text value read from file. Carries the fields of SecretKeyFile.
ValueLabel
smtpSMTP
lmtpLMTP
httpHTTP
imapIMAP4
pop3POP3
manageSieveManageSieve
ValueLabel
tls13-aes-256-gcm-sha384TLS1.3 AES256 GCM SHA384
tls13-aes-128-gcm-sha256TLS1.3 AES128 GCM SHA256
tls13-chacha20-poly1305-sha256TLS1.3 CHACHA20 POLY1305 SHA256
tls-ecdhe-ecdsa-with-aes-256-gcm-sha384ECDHE ECDSA AES256 GCM SHA384
tls-ecdhe-ecdsa-with-aes-128-gcm-sha256ECDHE ECDSA AES128 GCM SHA256
tls-ecdhe-ecdsa-with-chacha20-poly1305-sha256ECDHE ECDSA CHACHA20 POLY1305 SHA256
tls-ecdhe-rsa-with-aes-256-gcm-sha384ECDHE RSA AES256 GCM SHA384
tls-ecdhe-rsa-with-aes-128-gcm-sha256ECDHE RSA AES128 GCM SHA256
tls-ecdhe-rsa-with-chacha20-poly1305-sha256ECDHE RSA CHACHA20 POLY1305 SHA256
ValueLabel
tls12TLS version 1.2
tls13TLS version 1.3