summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2016-06-10 15:15:52 +0200
committerGitHub <noreply@github.com>2016-06-10 15:15:52 +0200
commit61dba074c7eac1f41b84089f9e05c75caa10ff8e (patch)
tree6c323d499328a8f4e06a5a0035b6da602eba936c /nixos
parentd73f5d69930fe7293f53548c682cc2ef6711cfbf (diff)
parent1e72706d667f33d5282d4a8f519d32837b3aa8bd (diff)
downloadnixpkgs-61dba074c7eac1f41b84089f9e05c75caa10ff8e.tar
nixpkgs-61dba074c7eac1f41b84089f9e05c75caa10ff8e.tar.gz
nixpkgs-61dba074c7eac1f41b84089f9e05c75caa10ff8e.tar.bz2
nixpkgs-61dba074c7eac1f41b84089f9e05c75caa10ff8e.tar.lz
nixpkgs-61dba074c7eac1f41b84089f9e05c75caa10ff8e.tar.xz
nixpkgs-61dba074c7eac1f41b84089f9e05c75caa10ff8e.tar.zst
nixpkgs-61dba074c7eac1f41b84089f9e05c75caa10ff8e.zip
Merge pull request #16082 from uwap/master
Postfix: Add an option to enable Submission
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/mail/postfix.nix32
1 files changed, 27 insertions, 5 deletions
diff --git a/nixos/modules/services/mail/postfix.nix b/nixos/modules/services/mail/postfix.nix
index bad9d527f9a..cdde4144622 100644
--- a/nixos/modules/services/mail/postfix.nix
+++ b/nixos/modules/services/mail/postfix.nix
@@ -127,11 +127,11 @@ 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
+      ${concatStringsSep "\n  " (mapAttrsToList (x: y: "-o " + x + "=" + y) cfg.submissionOptions)}
+  ''
+  + ''
     pickup    unix  n       -       n       60      1       pickup
     cleanup   unix  n       -       n       -       0       cleanup
     qmgr      unix  n       -       n       300     1       qmgr
@@ -201,6 +201,28 @@ in
         default = true;
         description = "Whether to enable smtp in master.cf.";
       };
+      
+      enableSubmission = mkOption {
+        type = types.bool;
+        default = false;
+        description = "Whether to enable smtp submission";
+      };
+
+      submissionOptions = mkOption {
+        type = types.attrs;
+        default = { "smtpd_tls_security_level" = "encrypt";
+                    "smtpd_sasl_auth_enable" = "yes";
+                    "smtpd_client_restrictions" = "permit_sasl_authenticated,reject";
+                    "milter_macro_daemon_name" = "ORIGINATING";
+                  };
+        description = "Options for the submission config in master.cf";
+        example = { "smtpd_tls_security_level" = "encrypt";
+                    "smtpd_sasl_auth_enable" = "yes";
+                    "smtpd_sasl_type" = "dovecot";
+                    "smtpd_client_restrictions" = "permit_sasl_authenticated,reject";
+                    "milter_macro_daemon_name" = "ORIGINATING";
+                  };
+      };
 
       setSendmail = mkOption {
         type = types.bool;