summary refs log tree commit diff
path: root/nixos/modules/services/mail
diff options
context:
space:
mode:
authorGregor Kleen <pngwjpgh@users.noreply.github.com>2017-01-02 15:40:54 +0100
committerGregor Kleen <pngwjpgh@users.noreply.github.com>2017-01-02 15:40:54 +0100
commit58fa71b39c9e5d0af7b8329a0c3ebf99f305bc71 (patch)
tree86411f773b048eb167a65571a6e9c4f9cd12e150 /nixos/modules/services/mail
parent82291bae49fd9e6aa2b899fb5464747a58051822 (diff)
downloadnixpkgs-58fa71b39c9e5d0af7b8329a0c3ebf99f305bc71.tar
nixpkgs-58fa71b39c9e5d0af7b8329a0c3ebf99f305bc71.tar.gz
nixpkgs-58fa71b39c9e5d0af7b8329a0c3ebf99f305bc71.tar.bz2
nixpkgs-58fa71b39c9e5d0af7b8329a0c3ebf99f305bc71.tar.lz
nixpkgs-58fa71b39c9e5d0af7b8329a0c3ebf99f305bc71.tar.xz
nixpkgs-58fa71b39c9e5d0af7b8329a0c3ebf99f305bc71.tar.zst
nixpkgs-58fa71b39c9e5d0af7b8329a0c3ebf99f305bc71.zip
postgrey: allow additional whitelists
Diffstat (limited to 'nixos/modules/services/mail')
-rw-r--r--nixos/modules/services/mail/postgrey.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/nixos/modules/services/mail/postgrey.nix b/nixos/modules/services/mail/postgrey.nix
index 7bf1c30fc67..7db4e4d1c21 100644
--- a/nixos/modules/services/mail/postgrey.nix
+++ b/nixos/modules/services/mail/postgrey.nix
@@ -118,6 +118,16 @@ in {
         default = 5;
         description = "Whitelist clients after successful delivery of N messages";
       };
+      whitelistClients = mkOption {
+        type = listOf path;
+        default = [];
+        description = "Client address whitelist files (see postgrey(8))";
+      };
+      whitelistRecipients = mkOption {
+        type = listOf path;
+        default = [];
+        description = "Recipient address whitelist files (see postgrey(8))";
+      };
     };
   };
 
@@ -156,7 +166,7 @@ in {
       '';
       serviceConfig = {
         Type = "simple";
-        ExecStart = ''${pkgs.postgrey}/bin/postgrey ${bind-flag} --group=postgrey --user=postgrey --dbdir=/var/postgrey --delay=${toString cfg.delay} --max-age=${toString cfg.maxAge} --retry-window=${toString cfg.retryWindow} ${if cfg.lookupBySubnet then "--lookup-by-subnet" else "--lookup-by-host"} --ipv4cidr=${toString cfg.IPv4CIDR} --ipv6cidr=${toString cfg.IPv6CIDR} ${optionalString cfg.privacy "--privacy"} --auto-whitelist-clients=${toString (if cfg.autoWhitelist == null then 0 else cfg.autoWhitelist)} --greylist-text="${cfg.greylistText}" --x-greylist-header="${cfg.greylistHeader}" --greylist-action=${cfg.greylistAction}'';
+        ExecStart = ''${pkgs.postgrey}/bin/postgrey ${bind-flag} --group=postgrey --user=postgrey --dbdir=/var/postgrey --delay=${toString cfg.delay} --max-age=${toString cfg.maxAge} --retry-window=${toString cfg.retryWindow} ${if cfg.lookupBySubnet then "--lookup-by-subnet" else "--lookup-by-host"} --ipv4cidr=${toString cfg.IPv4CIDR} --ipv6cidr=${toString cfg.IPv6CIDR} ${optionalString cfg.privacy "--privacy"} --auto-whitelist-clients=${toString (if cfg.autoWhitelist == null then 0 else cfg.autoWhitelist)} --greylist-text="${cfg.greylistText}" --x-greylist-header="${cfg.greylistHeader}" --greylist-action=${cfg.greylistAction} ${concatMapStringsSep " " (x: "--whitelist-clients=" + x) cfg.whitelistClients} ${concatMapStringsSep " " (x: "--whitelist-recipients=" + x) cfg.whitelistRecipients}'';
         Restart = "always";
         RestartSec = 5;
         TimeoutSec = 10;