Make submission options more flexible

This commit is contained in:
uwap 2016-06-09 18:06:07 +02:00
parent d1e4ee146d
commit cc658b695a
1 changed files with 10 additions and 10 deletions

View File

@ -129,10 +129,7 @@ let
smtp inet n - n - - smtpd smtp inet n - n - - smtpd
'' + optionalString cfg.enableSubmission '' '' + optionalString cfg.enableSubmission ''
submission inet n - n - - smtpd submission inet n - n - - smtpd
-o smtpd_tls_security_level=encrypt ${concatStringsSep "\n " (mapAttrsToList (x: y: "-o " + x + "=" + y) cfg.submissionOptions)}
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
${cfg.extraSubmissionOptions}
'' ''
+ '' + ''
pickup unix n - n 60 1 pickup pickup unix n - n 60 1 pickup
@ -208,14 +205,17 @@ in
enableSubmission = mkOption { enableSubmission = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
description = "Whether to enable smtp submission in master.cf."; description = "Whether to enable smtp submission";
}; };
extraSubmissionOptions = mkOption { submissionOptions = mkOption {
type = types.str; type = types.attrs;
default = ""; default = { "smtpd_tls_security_level" = "encrypt";
description = "Extra options for the submission config in master.cf."; "smtpd_sasl_auth_enable" = "yes";
example = "-o milter_macro_daemon_name=ORIGINATING"; "smtpd_client_restrictions" = "permit_sasl_authenticated,reject";
};
description = "Options for the submission config in master.cf";
example = { "milter_macro_daemon_name" = "ORIGINATING"; };
}; };
setSendmail = mkOption { setSendmail = mkOption {