SMTP Mania

Ok, so SAIX finally pushed me over my limits.  I’ve actually had to go make code modifications to exim now to work around the fact that they’re issuing incorrect error codes for their particular errors.

In particular, they’re issuing:

554 <x@y>: Recipient address rejected: Policy Rejection- Sender Hourly Mail Quota Exceeded.

From the error message, it’s quite clear that this is a TEMPORARY error, and thus should be rejected with a 4xx error.  Using a normal mail client, this is pretty much indifferent as something like Outlook/Thunderbird really does treat temporary vs permanent errors as temporary errors (it’ll keep on retrying until it does get out).

For some other software (eg, Pastel, exim, Exchange, sendmail, postfix, web applications and the like) this is a killer.  A 5xx response causes the mail to bounce.  And guess what?  SAIX doesn’t deliver those either!  They are effectively FORCING people to violate RFC specifications by actually sending bounces with a return path (which can go to :blackhole: … but it’s still not correct imho – bounces CAN bounce, and these bounces can again bounce …).

So what can be done?  Well, in the case of exim the following (simple patch) will SAIX-proof your exim install (at least, regarding the 554 Hourly Mail Quote issue):

diff -Nrau exim-4.69.orig/src/transports/smtp.c exim-4.69/src/transports/smtp.c
— exim-4.69.orig/src/transports/smtp.c        2007-09-28 14:21:57.000000000 +0200
+++ exim-4.69/src/transports/smtp.c     2009-03-17 22:00:20.000000000 +0200
@@ -728,6 +728,12 @@
setflag(addr, af_pass_message);
deliver_msglog(“%s %s\n”, tod_stamp(tod_log), addr->message);

+    /* SAIX-proof the code */
+    if (buffer[0] == ‘5’ && Ustrstr(buffer, “Hourly Mail Quota Exceeded”))
+      {
+      buffer[0] = ‘4’;
+      }
+
/* The response was 5xx */

if (buffer[0] == ‘5’)

Not a huge change, but not really something that I can try and get mainline in exim either without a LOT of work to properly make these configurable options.  What the above snippet of code does (in effect) is to ignore any permanent errors that contains the string “Hourly Mail Quota Exceeded” in the response string.  Well, ok, not quite ignore, but to rather treat the error as a defer (this is done by replacing the 5 indicating permanent with a 4 to indicate temporary).

Strictly speaking this is in serious violation of the RFCs, but what can one do?

Comments are closed.