postsrsd: additional configuration

fixes #19933

authored by

Gregor Kleen and committed by
Jörg Thalheim
d5ec2a2c cf1ec8ed

+29 -5
+29 -5
nixos/modules/services/mail/postsrsd.nix
··· 20 20 description = "Whether to enable the postsrsd SRS server for Postfix."; 21 21 }; 22 22 23 + secretsFile = mkOption { 24 + type = types.path; 25 + default = "/var/lib/postsrsd/postsrsd.secret"; 26 + description = "Secret keys used for signing and verification"; 27 + }; 28 + 23 29 domain = mkOption { 24 30 type = types.str; 25 31 description = "Domain name for rewrite"; 26 32 }; 27 33 28 - secretsFile = mkOption { 29 - type = types.path; 30 - default = "/var/lib/postsrsd/postsrsd.secret"; 31 - description = "Secret keys used for signing and verification"; 34 + separator = mkOption { 35 + type = types.enum ["-" "=" "+"]; 36 + default = "="; 37 + description = "First separator character in generated addresses"; 32 38 }; 33 39 40 + # bindAddress = mkOption { # uncomment once 1.5 is released 41 + # type = types.str; 42 + # default = "127.0.0.1"; 43 + # description = "Socket listen address"; 44 + # }; 45 + 34 46 forwardPort = mkOption { 35 47 type = types.int; 36 48 default = 10001; ··· 41 53 type = types.int; 42 54 default = 10002; 43 55 description = "Port for the reverse SRS lookup"; 56 + }; 57 + 58 + timeout = mkOption { 59 + type = types.int; 60 + default = 1800; 61 + description = "Timeout for idle client connections in seconds"; 62 + }; 63 + 64 + excludeDomains = mkOption { 65 + type = types.listOf types.str; 66 + default = []; 67 + description = "Origin domains to exclude from rewriting in addition to primary domain"; 44 68 }; 45 69 46 70 user = mkOption { ··· 86 110 path = [ pkgs.coreutils ]; 87 111 88 112 serviceConfig = { 89 - ExecStart = ''${pkgs.postsrsd}/sbin/postsrsd "-s${cfg.secretsFile}" "-d${cfg.domain}" -f${toString cfg.forwardPort} -r${toString cfg.reversePort}''; 113 + ExecStart = ''${pkgs.postsrsd}/sbin/postsrsd "-s${cfg.secretsFile}" "-d${cfg.domain}" -a${cfg.separator} -f${toString cfg.forwardPort} -r${toString cfg.reversePort} -t${toString cfg.timeout} "-X${concatStringsSep "," cfg.excludeDomains}"''; 90 114 User = cfg.user; 91 115 Group = cfg.group; 92 116 PermissionsStartOnly = true;