qmail canonicalised recipient logging and more patch

As Endersys R&D team, we made simple but very useful patch to qmail-remote about the delivery report.

After this patch, qmail-remote will log sender and recipient of the email in addition to remote IP adddress.  So tracking an email result will be easier than before.

Here is the sample log file:

@400000004b1bdd4d1f89d84c delivery 10: success: <From:owner-freebsd-current@freebsd.org_To:user@remotedomain.com>_193.140.X.X_accepted_message.
/Remote_host_said:_250_ok_1260117440_qp_15626/

@400000004b1bdbb8191f1954 delivery 6: failure: <From:a@surgate.net_To:test323232@remoteserver.com>_212.252.x._does_not_like_recipient.
/Remote_host_said:_550_non-existent_recipient/alici_bulunamadi/Giving_up_on_212.252.x.x/

Here is the patch based on netqmail-1.6. You can download the patch from http://files.endersys.com/patches/qmail-remote-logging.patch

PS:  qmail-remote-logging.patch and qmail-smtp-auth-fromcheck.patch are integrated into JMS1 combined patch and Shupp Toaster patch.

URLs:

http://files.endersys.com/patches/qmail-1.03-jms1.7.08_endersys.patch

http://files.endersys.com/patches/qmail-toaster-0.9.1_endersys.patch

# diff -ruN qmail-remote.c.orig qmail-remote.c
--- qmail-remote.c.orig 2009-12-06 17:55:41.000000000 +0200
+++ qmail-remote.c      2009-12-06 18:35:31.000000000 +0200
@@ -246,15 +246,23 @@
     substdio_flush(&smtpto);
     code = smtpcode();
     if (code >= 500) {
-      out("h"); outhost(); out(" does not like recipient.\n");
+      /* added by Endersys R&D Team */
+      out("h<From:"); outsafe(&sender); out(" To:"); outsafe(&reciplist.sa[i]); out("> ");  outhost(); out(" does not like recipient.\n");
       outsmtptext(); zero();
     }
     else if (code >= 400) {
-      out("s"); outhost(); out(" does not like recipient.\n");
+      /* added by Endersys R&D Team */
+      out("s<From:"); outsafe(&sender); out(" To:"); outsafe(&reciplist.sa[i]);  out("> ");  outhost(); out(" does not like recipient.\n");
       outsmtptext(); zero();
     }
     else {
-      out("r"); zero();
+       /*
+       * James Raftery <james@now.ie>
+       * Log _real_ envelope recipient, post canonicalisation.
+       * and modified by Endersys R&D Team
+       */
+
+      out("r<From:"); outsafe(&sender); out(" To:"); outsafe(&reciplist.sa[i]); out("> "); zero();
       flagbother = 1;
     }
   }

0 Response to “qmail canonicalised recipient logging and more patch”


  • No Comments

Leave a Reply