summary refs log tree commit diff
path: root/nixos/modules/services/mail
diff options
context:
space:
mode:
authoruwap <me@uwap.name>2016-06-09 00:15:55 +0200
committeruwap <me@uwap.name>2016-06-09 00:15:55 +0200
commitd1e4ee146d68a21c263d094acb416b050af32939 (patch)
tree26470e6defaed446dd841816976835a7211a80c6 /nixos/modules/services/mail
parente3358c1951c9e62906d51661d61a8c46a60e6919 (diff)
downloadnixlib-d1e4ee146d68a21c263d094acb416b050af32939.tar
nixlib-d1e4ee146d68a21c263d094acb416b050af32939.tar.gz
nixlib-d1e4ee146d68a21c263d094acb416b050af32939.tar.bz2
nixlib-d1e4ee146d68a21c263d094acb416b050af32939.tar.lz
nixlib-d1e4ee146d68a21c263d094acb416b050af32939.tar.xz
nixlib-d1e4ee146d68a21c263d094acb416b050af32939.tar.zst
nixlib-d1e4ee146d68a21c263d094acb416b050af32939.zip
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
Diffstat (limited to 'nixos/modules/services/mail')
-rw-r--r--nixos/modules/services/mail/postfix.nix26
1 files changed, 21 insertions, 5 deletions
diff --git a/nixos/modules/services/mail/postfix.nix b/nixos/modules/services/mail/postfix.nix
index bad9d527f9a1..e354ae668197 100644
--- a/nixos/modules/services/mail/postfix.nix
+++ b/nixos/modules/services/mail/postfix.nix
@@ -127,11 +127,14 @@ let
     #               (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
@@ -201,6 +204,19 @@ in
         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 {
         type = types.bool;