github viridIT/vSMTP v2.2.0
Release 2.2.0

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

[2.2.0] - 2023-03-19

BREAKING CHANGES

  • the spf::check function takes a map of parameters. (#1079)
spf::check(#{ header: "spf", policy: "soft" })

Added

  • transport::forward parameters can be passed as url. (#1018)
#{
  action "forward to my server" || {
    let user = "foo";
    let pass = "bar";
    let host = "smtp.mydomain.tld";
    let port = 25;

    transport::forward_all(`smtp://${user}:${pass}@${host}:${port}`);
    // or simply
    transport::forward_all(env("MY_VAR"));


    // you can configure the tls policy:
    transport::forward_all("smtp://[::1]?tls=opportunistic");
    // `tls` value being among [none, opportunistic, required, tunnel]

    transport::forward_all("smtps://domain.tld");
    // is equivalent to
    transport::forward_all("smtp://domain.tld?tls=tunnel");
  }
}
  • A LDAP plugin, enabling you to search and compare attributes in an active directory. (#928)
import "plugins/libvsmtp_plugin_ldap" as ldap;

// A service used to connect to and query an active directory.
export const directory = ldap::connect(#{
  url: "ldap://openldap:1389",
  connections: 4,
  timeout: "20s",
  bind: #{
    dn: "cn=admin,dc=example,dc=org",
    pw: "admin",
  }
});
#{
  mail: [
    rule "search for user in AD" || {
      let user = ctx::mail_from().local_part;
      let address = ctx::mail_from().to_string();

      let search = directory.search(
          "dc=example,dc=org",
          // Search the whole tree.
          "sub",
          // Match on the user id and address.
          `(|(uid=${user})(mail=${address}))`,
          // Get all attributes from the entries.
          []
      );

      if search.result == "error" {
          log("warn", `User could not be found in database: ${search.error}`);
          return state::deny();
      }

      log("info", `Entry for ${user} found in AD.`);

      // Log every entry and their attributes.
      for entry in search.entries {
          log("info", `dn=${entry.dn}`);
          log("info", `dn=${entry.attrs}`);
          for attr in entry.attrs.keys() {
              for value in entry.attrs.get(attr) {
                  log("info", `  attr=${attr},value=${value}`);
              }
          }
      }

      state::next()
    }
  ]
}
  • config.server.tls.certificate & config.server.tls.private_key (optional) used when a SNI is not provided or not found among the virtuals server

Modified

  • vSMTP loads /etc/vsmtp/vsmtp.vsl by default if -c flag is missing, and stops if no configuration could be found in this path. (#1020)
  • Better Rhai API documentation. (#1079)

Fixed

  • deliver (default transport method) will accept the CN correctly (#1018)

    Before a MX mta-01.smtp.mydomain.tld in the dns zone of mydomain.tld must had a certificate with the CN being mydomain.tld.
    Now mta-01.smtp.mydomain.tld, smtp.mydomain.tld or mydomain.tld will be accepted.

  • action completely ignores it's return value. (#1024)

  • spf::check can be used from the mail stage. (#1027)

Removed

  • the is_default properties in the on_domain_config()
  • the assignation of a default vritual server using a symlink named default

Don't miss a new vSMTP release

NewReleases is sending notifications on new releases.