I was quite surprised to learn that vdelivermail from vpopmail 5.4.13 and 5.4.17 (and probably most earlier releases) does not detect all mail loops.

The checks are all performed when parsing .qmail files and the like. In my particular situation, an Exchange server was picking up mail from my server (via POP), and deciding to re-distribute it to everyone in the "To" field (including the mailbox it picked mail from). I ended up seeing messages in this mailbox with the same Delivered-To line repeated dozens of times.

I've added a simple fix, which is to check the address right at the start of main(). I've tested it, and it works. I'd really like to rework the way Delivered-To headers are checked and added*, but don't have the time to get into it now. For now, here's the patch if anyone wants to try it out.

--- vdelivermail-orig.c 2006-06-29 12:36:43.000000000 -0700
+++ vdelivermail.c      2006-10-28 08:17:42.000000000 -0700
@@ -111,8 +111,14 @@
  */
int main(int argc, char **argv)
{
+    char loopcheck[255];
+
     /* get the arguments to the program and setup things */
     get_arguments(argc, argv);
+ snprintf (loopcheck, sizeof(loopcheck), "[EMAIL PROTECTED]", TheUser, TheDomain);
+    if ( is_looping( loopcheck ) == 1 ) {
+        vexiterr (EXIT_BOUNCE, "mail is looping");
+    }

#ifdef VALIAS
     /* process valiases if configured */

--
Tom Collins  -  [EMAIL PROTECTED]
Vpopmail - virtual domains for qmail: http://vpopmail.sf.net/
QmailAdmin - web interface for Vpopmail: http://qmailadmin.sf.net/

* I think vdelivermail should insert 1, maybe 2 Delivered-To headers on each email. The first should be the raw email address from qmail- local. The second should be the catchall address (or non-ext address) of the mailbox that ultimately receives the email. The ultimate delivery address would appear in the headers before the envelope address.

Reply via email to