markd wrote: 
>> I just started using qmail 1.03 a week ago, and made some interesting
>> discovery. I had the following .qmail file:
>> 
>> | preline formail -I "Bcc: `some/script`" | qmail-inject
>> 
>> Obviously, this causes a loop since qmail-inject will try to deliver to
> 
> Hmm. When I try the same pipeline I get a bounce alerting me to a loop due
> to a potentially duplicate Delivered-To: header. Specifically:
> 
> This message is looping: it already has my Delivered-To line. (#5.4.6)
> 
> And this is precisely what I'd expect as qmail has very good loop detection.

Good point. I rechecked my faulty .qmail file, and it actually reads:

| formail -I "Bcc: `some/script`" | qmail-inject

I discovered the use of preline after I made the loop. So much for the
"very good loop detection" of qmail. One can argue that when you don't
use preline, you have misconfigured qmail, but isn't a mailloop always a
misconfiguration?

>> the Bcc: addresses as well as to the original To: line. The interesting
>> bit is that this filled up the /var/mail file system rather quickly.
>> What happend is that:
>> 
>> 1) qmail-inject queues a mail for the original To: address
>> 2) qmail-send delivers this mail using qmail-lspawn to this same .qmail
>> file
>> 3) goto 1
> 
> There's an important point you've missed. Step 2a where qmail-lspawn uses
> qmail-local to deliver the mail to .qmail. qmail-local will not deliver
> a mail that already has the same Delivered-To: header that it wants to
> generate.

This is the catch; without preline, there is no Delivered-To: header.
I'd figure qmail-local (or any of the steps before it) would also check
the hop count.

> Alternatively the formail invocation
> is somehow removing the Delivered-To: heades.

Right on the money. Why is it safe/smart for qmail to depend on this
header?

> Have you the full headers of one of those bounces?

I'm afraid they got lost with the rest of the 100Mb I had to chuck. If I
remeber correctly, there were a lot of MBOX lines and a lot of Received:
lines inserted by my local qmail. This is how the remote smtpds counted
the number of hops, I guess.

Sincerely,

Richard

Reply via email to