Merge pull request #12155 from vkleen/postfix-configuration-options
Postfix configuration options
This commit is contained in:
commit
f4b2c3d510
@ -83,6 +83,9 @@ let
|
|||||||
+ optionalString (cfg.virtual != "") ''
|
+ optionalString (cfg.virtual != "") ''
|
||||||
virtual_alias_maps = hash:/etc/postfix/virtual
|
virtual_alias_maps = hash:/etc/postfix/virtual
|
||||||
''
|
''
|
||||||
|
+ optionalString (cfg.transport != "") ''
|
||||||
|
transport_maps = hash:/etc/postfix/transport
|
||||||
|
''
|
||||||
+ cfg.extraConfig;
|
+ cfg.extraConfig;
|
||||||
|
|
||||||
masterCf = ''
|
masterCf = ''
|
||||||
@ -108,10 +111,14 @@ let
|
|||||||
flush unix n - n 1000? 0 flush
|
flush unix n - n 1000? 0 flush
|
||||||
proxymap unix - - n - - proxymap
|
proxymap unix - - n - - proxymap
|
||||||
proxywrite unix - - n - 1 proxymap
|
proxywrite unix - - n - 1 proxymap
|
||||||
|
''
|
||||||
|
+ optionalString cfg.enableSmtp ''
|
||||||
smtp unix - - n - - smtp
|
smtp unix - - n - - smtp
|
||||||
relay unix - - n - - smtp
|
relay unix - - n - - smtp
|
||||||
-o smtp_fallback_relay=
|
-o smtp_fallback_relay=
|
||||||
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
|
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
|
||||||
|
''
|
||||||
|
+ ''
|
||||||
showq unix n - n - - showq
|
showq unix n - n - - showq
|
||||||
error unix - - n - - error
|
error unix - - n - - error
|
||||||
retry unix - - n - - error
|
retry unix - - n - - error
|
||||||
@ -138,6 +145,7 @@ let
|
|||||||
virtualFile = pkgs.writeText "postfix-virtual" cfg.virtual;
|
virtualFile = pkgs.writeText "postfix-virtual" cfg.virtual;
|
||||||
mainCfFile = pkgs.writeText "postfix-main.cf" mainCf;
|
mainCfFile = pkgs.writeText "postfix-main.cf" mainCf;
|
||||||
masterCfFile = pkgs.writeText "postfix-master.cf" masterCf;
|
masterCfFile = pkgs.writeText "postfix-master.cf" masterCf;
|
||||||
|
transportFile = pkgs.writeText "postfix-transport" cfg.transport;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -154,6 +162,11 @@ in
|
|||||||
description = "Whether to run the Postfix mail server.";
|
description = "Whether to run the Postfix mail server.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableSmtp = mkOption {
|
||||||
|
default = true;
|
||||||
|
description = "Whether to enable smtp in master.cf.";
|
||||||
|
};
|
||||||
|
|
||||||
setSendmail = mkOption {
|
setSendmail = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
description = "Whether to set the system sendmail to postfix's.";
|
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 {
|
extraMasterConf = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
example = "submission inet n - n - - smtpd";
|
example = "submission inet n - n - - smtpd";
|
||||||
@ -383,6 +403,7 @@ in
|
|||||||
ln -sf ${virtualFile} /var/postfix/conf/virtual
|
ln -sf ${virtualFile} /var/postfix/conf/virtual
|
||||||
ln -sf ${mainCfFile} /var/postfix/conf/main.cf
|
ln -sf ${mainCfFile} /var/postfix/conf/main.cf
|
||||||
ln -sf ${masterCfFile} /var/postfix/conf/master.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/postalias -c /var/postfix/conf /var/postfix/conf/aliases
|
||||||
${pkgs.postfix}/sbin/postmap -c /var/postfix/conf /var/postfix/conf/virtual
|
${pkgs.postfix}/sbin/postmap -c /var/postfix/conf /var/postfix/conf/virtual
|
||||||
|
Loading…
x
Reference in New Issue
Block a user