]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
add X-Original-To header to e-mails + logs
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 7 Jun 2020 17:08:17 +0000 (19:08 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 7 Jun 2020 17:13:09 +0000 (19:13 +0200)
modules/private/mail/postfix.nix
modules/private/system/eldiron.nix
modules/private/websites/immae/history/_posts/2020-05-31-fix-postfix-headers.md [new file with mode: 0644]

index 0c95df57eb68e826aff10f2dd8d0f4af85de2191..c4b09b21ba1dd1ed676164dd44e3e3b412f55c9f 100644 (file)
                 ${pkgs.dovecot}/libexec/dovecot/dovecot-lda -f "$sender" -a "$original_recipient" -d "$user"
               '';
           in [
-            "flags=DRhu" "user=vhost:vhost"
+            "flags=ODRhu" "user=vhost:vhost"
             "argv=${rspamc_dovecot}/bin/rspamc_dovecot \${sender} \${original_recipient} \${user}@\${nexthop}"
           ];
         };
index 4b332d32bc6d5396f320d9b44dd10595a6331782..6ccaea5797f19cde9965856219dd2466811ae726 100644 (file)
       ''
         # The star after /var/lib/* avoids deleting all folders in case of problem
         0 3,9,15,21 * * * root rsync -e "ssh -i /var/secrets/rsync_backup/identity" --new-compress -aAXv --delete --numeric-ids --super --rsync-path="sudo rsync" /var/lib/* backup@dilion.immae.eu: > /dev/null
-        0 0 * * * root journalctl -q --since="25 hours ago" -u postfix -g "immae.eu.*Recipient address rejected"
+        0 0 * * * root journalctl -q --since="25 hours ago" -u postfix -t postfix/smtpd -g "immae.eu.*Recipient address rejected"
+        # Need a way to blacklist properly
+        # 0 0 * * * root journalctl -q --since="25 hours ago" -u postfix -t postfix/smtpd -g "NOQUEUE:"
+        0 0 * * * root journalctl -q --since="25 hours ago" -u postfix -t postfix/smtp -g "status=bounced"
       ''
     ];
   };
diff --git a/modules/private/websites/immae/history/_posts/2020-05-31-fix-postfix-headers.md b/modules/private/websites/immae/history/_posts/2020-05-31-fix-postfix-headers.md
new file mode 100644 (file)
index 0000000..95f0bb4
--- /dev/null
@@ -0,0 +1,7 @@
+---
+title: "Ajout d’un header dans les mails traités par postfix"
+category: Fix
+date: 2020-05-31
+---
+Un header X-Original-To a été ajouté aux en-têtes des e-mails reçus par
+postfix pour indiquer la cible réelle du mail.