Skip to main content


vSMTP configuration is stored in the /etc/vsmtp/<service> directory. Each service as it's own set of configuration file and is run independently from the others.


To provide a simple yet powerful interface to configure vSMTP, every configuration file is written using the Rhai scripting language, which syntax resembles javascript.

Rhai is also used for filtering emails. We will explore this feature in the next chapter.

Configuration file

Here is an example of a possible configuration file for the SMTP Receiver service.

fn on_config(config) {
// The receiver will listen on both `` and `` addresses.
config.interfaces = #{
addr: [""],
addr_submission: [""],

// Options to connect securly with the RabbitMQ broker. = "amqps://"; = "/etc/ssl/certs/ca-certificates.crt";

// Filtering scripts configuration.
config.scripts.path = "/etc/vsmtp/smtp-receiver/rules.rhai";

// Enable pipelining and dns.
config.esmtp = #{
pipelining: true,
dsn: true,

// The configuration is done, return it !
return config;

As you can see, the configuration is done from a function entrypoint called on_config with a config parameter. To change the config, we simply have to change the values of the config object.

The fields descriptions and defaults will be described in future chapters, and are listed in the [Configuration Reference].