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 (domain: x509: ''
13 ${domain} ${lib.concatStringsSep " " x509}
19 systemd.services.postfix = {
21 install -m 400 -o root -g root ${postfix.tls_server_sni_maps} /run/keys/postfix-sni
22 ${pkgs.postfix}/bin/postmap -F hash:/run/keys/postfix-sni
27 submissions-header-cleanup = {
32 args = ["-o" ("header_checks=pcre:" + pkgs.writeText "submission_header_cleanup_rules" ''
33 # Removes sensitive headers from mails handed in via the submission or smtps port.
34 # See https://thomas-leister.de/mailserver-debian-stretch/
35 # Uses "pcre" style regex.
41 /^X-Originating-IP:/ IGNORE