Skip to main content

Configuration

Reference

config

api_version: string (default: *)

name: string (default: ``)

interfaces

addr: array (default: [])

addr_submission: array (default: [])

addr_submissions: array (default: [])

esmtp

auth: null

starttls: bool (default: false)

pipelining: bool (default: false)

size: number (default: 0)

dsn: bool (default: false)

errors

soft_count: number (default: 0)

hard_count: number (default: 0)

delay

secs: number (default: 0)

nanos: number (default: 0)

max_clients: number (default: 0)

message_size_limit: number (default: 0)

tls

preempt_cipherlist: bool (default: false)

handshake_timeout: string (default: 0s)

protocol_version: array (default: [])

cipher_suite: array (default: [])

queues

quarantine: string (default: quarantine)

no_route: string (default: no-route)

dead: string (default: dead)

submit: null

scripts

path: string (default: ``)

storage: string (default: ``)

broker

uri: string (default: ``)

scheme: string (default: Amqps)

logs

queue: string (default: log)

facility: string (default: Console)

level: array (default: ["warn"])

Example

Here is an example script with all parameters accepted by the service.

/etc/vsmtp/smtp-receiver/conf.d/config.rhai
fn on_config(config) {
config.interfaces = #{
// list of ip addresses to listen on for MTA->MTA communication.
addr: [
"192.168.1.254:25", // ipv4
"192.168.1.254:10025/tcp", // ipv4 for TCP
"[::]:10025", // ipv6
"[::]:10025/udp", // ipv6 for UDP
"[::]:10025/quic", // ipv6 for QUIC
"[fe80::1:2:3:4%eth0]:25" // ipv6 with scope id
],
// list of ip addresses to listen on for MUA->MSA communication (clair and tls).
addr_submission: [
"192.168.1.254:587"
],
addr_submissions: [
"192.168.1.254:465"
],
};

config.tls = #{
handshake_timeout: "30s",
protocol_version: [ "TLSv1.2", "TLSv1.3" ],
private_key: load_rsa("path/to/rsa"),
certificate: load_cert("path/to/rsa"),
preempt_cipherlist: true | false,
cipher_suite: "...",
root_store: null | [
load_rsa("path/to/rootCA"),
load_rsa("path/to/rootCA.dev"),
],
};

// Maximum number of clients authorized at the same time.
config.max_clients = 64; // -1 for unlimited and by default.
// Maximum allowed size of an incomming email.
config.message_size_limit = 20000000; // default: 20MB.

// EHLO extensions.
config.esmtp? = #{
auth?: #{
// Some mechanisms are considered unsecure under non-TLS connections.
// If `false`, the server will allow to use them even on clair connections.
enable_dangerous_mechanism_in_clair: false,
// List of mechanisms supported by the server.
mechanisms: ["PLAIN", "LOGIN", "CRAM-MD5", "ANONYMOUS"],
// If the AUTH exchange is canceled, the server will not consider the connection as closing,
// increasing the number of attempt failed, until `attempt_count_max`, producing an error.
attempt_count_max: 10,
}, // Authentication policy
starttls?: true,
pipelining?: true,
size?: 20000000, // 20MB
};

config.error = #{
soft_count: -1, // -1 to disable.
hard_count: -1, // -1 to disable.
delay: "2s",
};

config.storage = "/var/vsmtp/storage"; // previously `config.app.dirpath`
return config;
}