github viridIT/vSMTP v2.0.0

latest releases: v3.0-rc.1, v2.2.1, v2.2.0...
20 months ago

[2.0.0] - 2023-01-09

Plugin System

To extend the functionality of vSMTP, we have added a plugin system. You will be able to choose plugins you
are interested in by importing them in your vSL script.

Plugins are implemented as dynamic libraries, and are imported in rhai scripts using
rhai-dylib. (#753)

Example:

// import the dynamic library in Rhai.
import "/usr/lib/vsmtp/libvsmtp-plugin-csv" as db;

// use functions defined in the library.
db::csv(#{ ... });

Implementing csv and mysql databases as a plugins. (#625)

Configuration in vSL

Previous configurations were written in TOML, now they are written in vSL. (#685)

fn on_config(config) {
  config.version_requirement = ">=2.0.0, <3.0.0";

  config.server.name = "my.fqdn.com";

  config.server.system = #{
      user: "root",
      group: "root",
  };

  config.server.interfaces = #{
      addr: ["127.0.0.1:25"],
      addr_submission: ["127.0.0.1:587"],
      addr_submissions: ["127.0.0.1:465"],
  };

  config
}

The toml vsl module has been renamed to cfg. (#709)

Filtering enhancement

  • The policy execution has changed, it depends on the virtual domain
    and the transaction types (incoming, outgoing, internal). (#709)
/etc/vsmtp
┣ vsmtp.vsl
┣ conf.d/
┃     ┣ config.vsl
┃     ┣ interfaces.vsl
┃     ┣ logs.vsl
┃     ┗ other.vsl
┣ domain-available/
┃     ┣ main.vsl            # Rules executed before the 'mail' stage
┃     ┣ fallback.vsl        # Rules executed if the domain is not handled.
┃     ┣ example.com/
┃     ┃    ┣ incoming.vsl   # Sender domain unknown, recipient domain is 'example.com'.
┃     ┃    ┣ outgoing.vsl   # Sender domain is 'example.com', recipient domain is different.
┃     ┃    ┗ internal.vsl   # Sender & recipient domain are both 'example.com'.
┃     ┗ test.com/
┃         ┗ ...
┗ domain-enabled/
      ┗ example.com -> /etc/vsmtp/domain-available/example.com
  • Changed the API of objects to be simple rhai functions, removing implicit export of
    objects. (#647)
// Old syntax
object localhost ip4 = "127.0.0.1";
// New syntax
const localhost = ip4("127.0.0.1");
  • Remove Group object & function, replaced by Rhai arrays. (#660)
const localhost = ip4("127.0.0.1");
const john = identifier("john.doe");

// declaration of a group.
const group = [ localhost, john ];
  • Moved vSL syntax to a crate for better reusability. (#660)
  • Remove File object, replaced by Rhai arrays. (#660)
// This returns an Array of addresses.
const whitelist = file("/etc/vsmtp/whitelist.txt", "address");

for addr in whitelist {
  // ...
}
  • Add the support of null reverse path
  • A delegation cargo feature on vsmtp-rule-engine. (#660)

Don't miss a new vSMTP release

NewReleases is sending notifications on new releases.