Postfix: Add an option to enable Submission

Adds services.postfix.enableSubmission and services.postfix.extraSubmissionOptions to make it easy to enable submission in master.cf

uwap d1e4ee14 e3358c19

Changed files
+21 -5
nixos
modules
services
+21 -5
nixos/modules/services/mail/postfix.nix
···
# (yes) (yes) (no) (never) (100)
# ==========================================================================
smtp inet n - n - - smtpd
-
#submission inet n - n - - smtpd
-
# -o smtpd_tls_security_level=encrypt
-
# -o smtpd_sasl_auth_enable=yes
-
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
-
# -o milter_macro_daemon_name=ORIGINATING
+
'' + optionalString cfg.enableSubmission ''
+
submission inet n - n - - smtpd
+
-o smtpd_tls_security_level=encrypt
+
-o smtpd_sasl_auth_enable=yes
+
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
+
${cfg.extraSubmissionOptions}
+
''
+
+ ''
pickup unix n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr unix n - n 300 1 qmgr
···
enableSmtp = mkOption {
default = true;
description = "Whether to enable smtp in master.cf.";
+
};
+
+
enableSubmission = mkOption {
+
type = types.bool;
+
default = false;
+
description = "Whether to enable smtp submission in master.cf.";
+
};
+
+
extraSubmissionOptions = mkOption {
+
type = types.str;
+
default = "";
+
description = "Extra options for the submission config in master.cf.";
+
example = "-o milter_macro_daemon_name=ORIGINATING";
};
setSendmail = mkOption {