Keith Ivey wrote:
I had another situation where a message was looping forever, being repeatedly delivered from my server to itself, and causing a high load. The problem is that the MX record looks like this:

conservation.com.       3600    IN      MX      1000 0.0.0.0.

I've previously encountered the same problem with other domains. Since the message is coming from inside my network and has a local FROM address, it's accepted for relaying. Then because of the MX record it gets "relayed" from the server to itself and queued for relaying again and again.

With qmail-smtpd, this wouldn't go on for long, because there's primitive loop detection, counting the number of "Received" and "Delivered-To" lines. But qpsmtpd is missing that.

I've attached a plugin that duplicates the loop-checking in qmail-smtpd.

Actually, not detecting 0.0.0.0 as a local address is considered a "bug" in qmail and a patch to fix it is one of the Recommended Patches [1] on qmail.org.

[1] http://qmail.org/top.html#patches

Perhaps a better approach to fix this problem would be to add similar checking to the qpsmtpd core code? It's only a couple of lines in qmail:

--- qmail-1.03/ipme.c   Mon Jun 15 06:53:16 1998
+++ qmail-1.03-sg/ipme.c        Mon Jan 29 02:27:38 2001
@@ -46,6 +46,11 @@
   ipme.len = 0;
   ix.pref = 0;

+  /* 0.0.0.0 is a special address which always refers to
+   * "this host, this network", according to RFC 1122, Sec. 3.2.1.3a.
+  */
+  byte_copy(&ix.ip,4,"\0\0\0\0");
+  if (!ipalloc_append(&ipme,&ix)) { return 0; }
   if ((s = socket(AF_INET,SOCK_STREAM,0)) == -1) return -1;

   len = 256;


I'm not sure where the corresponding change should be made in qpsmtpd.

R.

--
http://robinbowes.com

If a man speaks in a forest,
and his wife's not there,
is he still wrong?

Reply via email to