1 { pkgs, lib, config, ... }:
4 inherit (config.services) postfix;
9 tls_server_sni_maps = lib.mkOption {
10 type = types.attrsOf (types.listOf types.path);
12 apply = m: pkgs.writeText "sni" (lib.concatStringsSep "\n" (lib.mapAttrsToList
14 ${domain} ${lib.concatStringsSep " " x509}
21 systemd.services.postfix = {
23 install -m 400 -o root -g root ${postfix.tls_server_sni_maps} /run/postfix/postfix-sni
24 ${pkgs.postfix}/bin/postmap -F hash:/run/postfix/postfix-sni
27 RuntimeDirectory = [ "postfix" ];
32 submissions-header-cleanup = {
39 ("header_checks=pcre:" + pkgs.writeText "submission_header_cleanup_rules" ''
40 # Removes sensitive headers from mails handed in via the submission or smtps port.
41 # See https://thomas-leister.de/mailserver-debian-stretch/
42 # Uses "pcre" style regex.
48 /^X-Originating-IP:/ IGNORE