Ask Bj�rn Hansen wrote:

and that doesn't support [EMAIL PROTECTED] -> [EMAIL PROTECTED] -> [EMAIL PROTECTED] mail forwarding.


Why not look for a Delivered-To header matching the rcpt to parameter?


I think the best^Wonly way is to look at the Received: header, for example, here's a loop I just induced:


Received: (qmail 7367 invoked by uid 107); 4 Apr 2005 16:03:39 -0400
Received: from unknown (12.38.22.1)
  by ranger1.rlpgbooks.com with QMQP; 4 Apr 2005 16:03:39 -0400
Received: from ranger1.rlpgbooks.com (HELO ranger1.rlpgbooks.com) (12.38.22.130)
    by a.mx.rlpgbooks.com (qpsmtpd/0.29) with SMTP; Mon, 04 Apr 2005 15:59:20 
-0400
Received: (qmail 7348 invoked by uid 107); 4 Apr 2005 16:03:38 -0400
Received: from unknown (12.38.22.1)
  by ranger1.rlpgbooks.com with QMQP; 4 Apr 2005 16:03:38 -0400
Received: from ranger1.rlpgbooks.com (HELO ranger1.rlpgbooks.com) (12.38.22.130)
    by a.mx.rlpgbooks.com (qpsmtpd/0.29) with SMTP; Mon, 04 Apr 2005 15:59:18 
-0400
Received: (qmail 7338 invoked by uid 107); 4 Apr 2005 16:03:36 -0400
Received: from unknown (12.38.22.1)
  by ranger1.rlpgbooks.com with QMQP; 4 Apr 2005 16:03:36 -0400
Received: from ranger1.rlpgbooks.com (HELO ranger1.rlpgbooks.com) (12.38.22.130)
    by a.mx.rlpgbooks.com (qpsmtpd/0.29) with SMTP; Mon, 04 Apr 2005 15:59:16 
-0400
Received: (qmail 7328 invoked by uid 107); 4 Apr 2005 16:03:34 -0400
Received: from unknown (12.38.22.1)
  by ranger1.rlpgbooks.com with QMQP; 4 Apr 2005 16:03:34 -0400
Received: from ranger1.rlpgbooks.com (HELO ranger1.rlpgbooks.com) (12.38.22.130)
    by a.mx.rlpgbooks.com (qpsmtpd/0.29) with SMTP; Mon, 04 Apr 2005 15:59:15 
-0400
Received: (qmail 7308 invoked from network); 4 Apr 2005 16:03:33 -0400
Received: from ranger1.internal (HELO main) (12.38.22.130)
    by ranger1.rlpgbooks.com (qpsmtpd/0.29) with ESMTP; Mon, 04 Apr 2005 
16:03:33 -0400

qmail internally just counts the number of Received: lines and bails when it exceeds a maximum (100). I would hope to be a little more intelligent, for example seeing if the last 'x' Received lines include the same hosts more than once (for some value of 'x'). In my case above, the servers just ping/pong, but I can see multiple servers being involved (a -> main, main -> b, b -> main, main -> a, etc).


John

Reply via email to