Merge pull request #12155 from vkleen/postfix-configuration-options

Postfix configuration options
This commit is contained in:
Peter Simons 2016-01-05 12:32:23 +01:00
commit f4b2c3d510

View File

@ -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 = ''
@ -108,10 +111,14 @@ let
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
''
+ optionalString cfg.enableSmtp ''
smtp unix - - n - - smtp
relay unix - - n - - smtp
-o smtp_fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
''
+ ''
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
@ -138,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
@ -154,6 +162,11 @@ in
description = "Whether to run the Postfix mail server.";
};
enableSmtp = mkOption {
default = true;
description = "Whether to enable smtp in master.cf.";
};
setSendmail = mkOption {
default = true;
description = "Whether to set the system sendmail to postfix's.";
@ -305,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";
@ -383,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