git.iko.soy/typeable/nixpkgs
on master help sign in
postfix service: include configuration option for transport maps
commitebd8e2c380c42e375f9860347a20245f01fbfc24 authorViktor Kleen <viktor@kleen.org> dateTue 5 Jan 2016, 02:59 (11 years ago) parent8fad959
1 file changed+12
nixos/modules/services/mail/postfix.nix+12
nixos/modules/services/mail/postfix.nix+12
@@ -83,6 +83,9 @@ let
8383 + optionalString (cfg.virtual != "") ''
8484 virtual_alias_maps = hash:/etc/postfix/virtual
8585 ''
86+ + optionalString (cfg.transport != "") ''
87+ transport_maps = hash:/etc/postfix/transport
88+ ''
8689 + cfg.extraConfig;
8790
8891 masterCf = ''
@@ -142,6 +145,7 @@ let
142145 virtualFile = pkgs.writeText "postfix-virtual" cfg.virtual;
143146 mainCfFile = pkgs.writeText "postfix-main.cf" mainCf;
144147 masterCfFile = pkgs.writeText "postfix-master.cf" masterCf;
148+ transportFile = pkgs.writeText "postfix-transport" cfg.transport;
145149
146150in
147151
@@ -314,6 +318,13 @@ in
314318 ";
315319 };
316320
321+ transport = mkOption {
322+ default = "";
323+ description = "
324+ Entries for the transport map, cf. man-page transport(8).
325+ ";
326+ };
327+
317328 extraMasterConf = mkOption {
318329 default = "";
319330 example = "submission inet n - n - - smtpd";
@@ -392,6 +403,7 @@ in
392403 ln -sf ${virtualFile} /var/postfix/conf/virtual
393404 ln -sf ${mainCfFile} /var/postfix/conf/main.cf
394405 ln -sf ${masterCfFile} /var/postfix/conf/master.cf
406+ ln -sf ${transportFile} /var/postfix/conf/transport
395407
396408 ${pkgs.postfix}/sbin/postalias -c /var/postfix/conf /var/postfix/conf/aliases
397409 ${pkgs.postfix}/sbin/postmap -c /var/postfix/conf /var/postfix/conf/virtual