summary refs log tree commit diff
path: root/nixos/modules/services/mail/postfix.nix
diff options
context:
space:
mode:
authorViktor Kleen <viktor@kleen.org>2016-01-05 02:59:16 -0800
committerViktor Kleen <viktor@kleen.org>2016-01-05 02:59:16 -0800
commitebd8e2c380c42e375f9860347a20245f01fbfc24 (patch)
tree85ebd6c5b8c685e0685df04302532e4b3f2eedde /nixos/modules/services/mail/postfix.nix
parent8fad959b15cba08a11a1f95b2f8fec6f977b06d1 (diff)
downloadnixpkgs-ebd8e2c380c42e375f9860347a20245f01fbfc24.tar
nixpkgs-ebd8e2c380c42e375f9860347a20245f01fbfc24.tar.gz
nixpkgs-ebd8e2c380c42e375f9860347a20245f01fbfc24.tar.bz2
nixpkgs-ebd8e2c380c42e375f9860347a20245f01fbfc24.tar.lz
nixpkgs-ebd8e2c380c42e375f9860347a20245f01fbfc24.tar.xz
nixpkgs-ebd8e2c380c42e375f9860347a20245f01fbfc24.tar.zst
nixpkgs-ebd8e2c380c42e375f9860347a20245f01fbfc24.zip
postfix service: include configuration option for transport maps
Diffstat (limited to 'nixos/modules/services/mail/postfix.nix')
-rw-r--r--nixos/modules/services/mail/postfix.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/nixos/modules/services/mail/postfix.nix b/nixos/modules/services/mail/postfix.nix
index c18ed599868..2b9175036be 100644
--- a/nixos/modules/services/mail/postfix.nix
+++ b/nixos/modules/services/mail/postfix.nix
@@ -83,6 +83,9 @@ let
     + optionalString (cfg.virtual != "") ''
       virtual_alias_maps = hash:/etc/postfix/virtual
     ''
+    + optionalString (cfg.transport != "") ''
+      transport_maps = hash:/etc/postfix/transport
+    ''
     + cfg.extraConfig;
 
   masterCf = ''
@@ -142,6 +145,7 @@ let
   virtualFile = pkgs.writeText "postfix-virtual" cfg.virtual;
   mainCfFile = pkgs.writeText "postfix-main.cf" mainCf;
   masterCfFile = pkgs.writeText "postfix-master.cf" masterCf;
+  transportFile = pkgs.writeText "postfix-transport" cfg.transport;
 
 in
 
@@ -314,6 +318,13 @@ in
         ";
       };
 
+      transport = mkOption {
+        default = "";
+        description = "
+          Entries for the transport map, cf. man-page transport(8).
+        ";
+      };
+
       extraMasterConf = mkOption {
         default = "";
         example = "submission inet n - n - - smtpd";
@@ -392,6 +403,7 @@ in
           ln -sf ${virtualFile} /var/postfix/conf/virtual
           ln -sf ${mainCfFile} /var/postfix/conf/main.cf
           ln -sf ${masterCfFile} /var/postfix/conf/master.cf
+          ln -sf ${transportFile} /var/postfix/conf/transport
 
           ${pkgs.postfix}/sbin/postalias -c /var/postfix/conf /var/postfix/conf/aliases
           ${pkgs.postfix}/sbin/postmap -c /var/postfix/conf /var/postfix/conf/virtual