########### ### WHO ### ########### This patch was written by Scott Gifford . ############ ### WHAT ### ############ This patch may be necessary in some configurations that involve network address translation or port forwarding. It prevents a problem caused by an MX or other mail routing directive instructing qmail to connect to itself without realizing it's connecting to itself. When this happens, it accepts the message, finds out where to deliver it to (itself), and promptly reconnects to itself to deliver the message. Eventually, when it has done this 20 or 30 times, it will give up and bounce the message, but not before sucking up all of your CPU while it's happening. Normally, qmail can detect what IP addresses refer to itself by getting a list of all network interfaces with IP addresses from the operating system. It uses this list to determine whether connecting to an address will cause it to connect to itself, and avoid the situation (it calls the perm_ambigmx() function, which prints the message: Sorry. Although I'm listed as a best-preference MX or A for that host, it isn't in my control/locals file, so I don't treat it as local. (#5.4.6) But in situations where the OS is not aware of all IP addresses that connect back to itself, this detection fails, causing the CPU-sucking phenomenon described above. This can happen if there is a network address translation device in front of the qmail server, such as a load-balancer or a router which allows you to share one IP address among several machines; if there is a port forwarder forwarding connections from some other machine to the SMTP server on the qmail server; or in configurations where a "dumb" mailserver is configured to use your qmail server as a "smarthost", delivering all mail to it without inspection. To solve this, other IP addresses which will ultimately connect back to your machine can be added to the file "control/moreipme", one per line. qmail will treat all addresses in this file exactly as if they were local, and if it finds an MX record or other mail routing information which would cause it to connect to any of these addresses, it will call perm_ambigmx(), and print the above error message. You can cd into your qmail directory (normally /var/qmail) and run the program "ipmeprint" from the source directory to see what interfaces qmail is detecting or finds in moreipme. ########### ### HOW ### ########### To apply the patch, download and save it somewhere, then cd into your qmail source directory, and run: patch -p1