]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/mail/postfix.nix
Remove deleted-to-trash dovecot plugin
[perso/Immae/Config/Nix.git] / modules / private / mail / postfix.nix
index 53bf6501bc0fb1b85623d2748fff5bb1ae91c67b..ee4ac35159e09da2b057f168fc9a862514d97e88 100644 (file)
@@ -77,7 +77,7 @@
     }
   ];
 
-  config.networking.firewall.allowedTCPPorts = [ 25 587 ];
+  config.networking.firewall.allowedTCPPorts = [ 25 465 587 ];
 
   config.nixpkgs.overlays = [ (self: super: {
     postfix = super.postfix.override { withMySQL = true; };
       milter_macro_daemon_name = "ORIGINATING";
       smtpd_milters = "unix:${config.myServices.mail.milters.sockets.opendkim}";
     };
+    # FIXME: Mail adressed to localhost.immae.eu will still have mx-1 as
+    # prioritized MX, which provokes "mail for localhost.immae.eu loops
+    # back to myself" errors. This transport entry forces to push
+    # e-mails to its right destination.
+    transport = ''
+      localhost.immae.eu   smtp:[immae.eu]:25
+      '';
     destination = ["localhost"];
     # This needs to reverse DNS
     hostname = "eldiron.immae.eu";
     sslKey = "/var/lib/acme/mail/key.pem";
     recipientDelimiter = "+";
     masterConfig = {
+      submissions = {
+        type = "inet";
+        private = false;
+        command = "smtpd";
+        args = ["-o" "smtpd_tls_wrappermode=yes" ] ++ (let
+          mkKeyVal = opt: val: [ "-o" (opt + "=" + val) ];
+        in lib.concatLists (lib.mapAttrsToList mkKeyVal config.services.postfix.submissionOptions)
+        );
+      };
       dovecot = {
         type = "unix";
         privileged = true;