Mailing List Archive

multiple deliveries to external aliases
Hello all,

I'm running into a problem (postfix 2.0.10, dbmail cvs from April 1)
where dbmail will send a message to an external alias, but return an
error to postfix, so the message is deferred, and then re-delivered
again, and again, and again. Both dbmail-smtp and dbmail-lmtp exhibit
the same symptoms. Here's a snip of the log with dbmail-smtp:

Apr 1 16:24:08 sls-cd7p8 postfix/smtpd[3400]: connect from
adsl-218-111-159.mia.bellsouth.net[68.218.111.159]
Apr 1 16:24:08 sls-cd7p8 postfix/smtpd[3400]: E6BE4534097:
client=adsl-218-111-159.mia.bellsouth.net[68.218.111.159]
Apr 1 16:24:09 sls-cd7p8 postfix/smtpd[3400]: warning: restriction
reject_rbl_client requires domain name argument
Apr 1 16:24:10 sls-cd7p8 postfix/cleanup[3401]: E6BE4534097:
message-id=<DENQTRXXTCCVBKBSOAXNDPM@yahoo.com>
Apr 1 16:24:10 sls-cd7p8 postfix/qmgr[3114]: E6BE4534097:
from=<QWCSR@msn.com>, size=5904, nrcpt=1 (queue active)
Apr 1 16:24:10 sls-cd7p8 postfix/pickup[3278]: 3080F534098: uid=202
from=<dbmail>
Apr 1 16:24:10 sls-cd7p8 postfix/cleanup[3401]: 3080F534098:
message-id=<DENQTRXXTCCVBKBSOAXNDPM@yahoo.com>
Apr 1 16:24:10 sls-cd7p8 postfix/qmgr[3114]: 3080F534098:
from=<dbmail@medleysoft.com>, size=6062, nrcpt=1 (queue active)
Apr 1 16:24:10 sls-cd7p8 postfix/pipe[3402]: E6BE4534097:
to=<webmaster@dingus.net>, relay=dbmail, delay=2, status=deferred
(temporary failure)
Apr 1 16:24:10 sls-cd7p8 postfix/smtpd[3400]: disconnect from
adsl-218-111-159.mia.bellsouth.net[68.218.111.159]
Apr 1 16:24:14 sls-cd7p8 postfix/smtp[3407]: 3080F534098:
to=<hinder90@yahoo.com>, relay=mx2.mail.yahoo.com[67.28.114.34],
delay=4, status=sent (250 ok dirde
l)

and here's what it looks like with dbmail-lmtp:

Apr 2 05:00:54 sls-cd7p8 postfix/qmgr[6631]: 0380C53408F:
from=<danetterollans370676_7@www7.solidemailservers.com>, size=12864,
nrcpt=1 (queue active)
Apr 2 05:00:54 sls-cd7p8 dbmail/lmtpd[8113]: PerformChildTask():
incoming connection from [127.0.0.1 (localhost.localdomain)]
Apr 2 05:00:54 sls-cd7p8 dbmail/lmtpd[8113]: main(): size of
read_header() header is [1076]
Apr 2 05:00:54 sls-cd7p8 dbmail/lmtpd[8113]: ChildSighandler(): got
signal [17]
Apr 2 05:00:54 sls-cd7p8 postfix/pickup[8083]: 3E7BA534093: uid=0
from=<root>
Apr 2 05:00:54 sls-cd7p8 postfix/cleanup[8136]: 3E7BA534093:
message-id=<1080885277.6345@www7.solidemailservers.com>
Apr 2 05:00:54 sls-cd7p8 postfix/lmtp[8133]: 0380C53408F:
to=<freebrunette@dingus.net>, relay=localhost[127.0.0.1], delay=11351,
status=deferred (lost connec
tion with localhost[127.0.0.1] while sending end of data -- message may
be sent more than once)
Apr 2 05:00:54 sls-cd7p8 postfix/qmgr[6631]: 3E7BA534093:
from=<root@medleysoft.com>, size=12984, nrcpt=1 (queue active)
Apr 2 05:00:58 sls-cd7p8 postfix/smtp[8140]: 3E7BA534093:
to=<hinder90@yahoo.com>, relay=mx1.mail.yahoo.com[64.156.215.6],
delay=4, status=sent (250 ok dirde
l)

as of right now I don't have postfix using the database directly, it
just hands off everything for the appropriate domains to dbmail.

Any ideas?

Blake
Re: multiple deliveries to external aliases [ In reply to ]
Blake Mitchell wrote:

> Hello all,
>
> I'm running into a problem (postfix 2.0.10, dbmail cvs from April 1)
> where dbmail will send a message to an external alias, but return an
> error to postfix, so the message is deferred, and then re-delivered
> again, and again, and again. Both dbmail-smtp and dbmail-lmtp exhibit
> the same symptoms. Here's a snip of the log with dbmail-smtp:
<snip traces>
>
> as of right now I don't have postfix using the database directly, it
> just hands off everything for the appropriate domains to dbmail.
>
> Any ideas?

I'm able to reproduce the error here. It has something to do with a
failing pclose(). I'm sure why this pclose() fails, it doesn't seem to
get a NULL pointer..

Ilja
Re: multiple deliveries to external aliases [ In reply to ]
Ilja Booij wrote:
> Blake Mitchell wrote:
>
>> Hello all,
>>
>> I'm running into a problem (postfix 2.0.10, dbmail cvs from April 1)
>> where dbmail will send a message to an external alias, but return an
>> error to postfix, so the message is deferred, and then re-delivered
>> again, and again, and again. Both dbmail-smtp and dbmail-lmtp exhibit
>> the same symptoms. Here's a snip of the log with dbmail-smtp:
>
> <snip traces>
>
>>
>> as of right now I don't have postfix using the database directly, it
>> just hands off everything for the appropriate domains to dbmail.
>>
>> Any ideas?
>
>
> I'm able to reproduce the error here. It has something to do with a
> failing pclose(). I'm sure why this pclose() fails, it doesn't seem to
> get a NULL pointer..

I was wrong:

There are two problems:
dbmail-smtp: for some reason, the dbmail-smtp returns EX_TEMPFAIL when
there are only external forwards to deliver

dbmail-lmtpd: after closing the pipe, the daemon process (a child of the
original daemon) gets a SIGCHLD (of course), but it reacts to this by
killing itself! Of course, it should ignore this signal.

Ilja
Re: multiple deliveries to external aliases [ In reply to ]
Ilja Booij wrote:
> I was wrong:
>
> There are two problems:
> dbmail-smtp: for some reason, the dbmail-smtp returns EX_TEMPFAIL when
> there are only external forwards to deliver
>
> dbmail-lmtpd: after closing the pipe, the daemon process (a child of the
> original daemon) gets a SIGCHLD (of course), but it reacts to this by
> killing itself! Of course, it should ignore this signal.
This last problem I've dealt with. In serverchild.c, I've added a signal
handler ChildSignalHandler() as signal handler for SIGCHLD, and use that
function to ignore the SIGCHLD. Somehow, just setting signal(SIGCHLD,
SIG_IGN) did not work like I wanted it to. It interfered with the server
parent signal handler.

Ilja

>
> Ilja
>
>
> _______________________________________________
> Dbmail-dev mailing list
> Dbmail-dev@dbmail.org
> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
Re: multiple deliveries to external aliases [ In reply to ]
When you get a chance, could you check this fix in. Right now I've got a
cron job cleaning out the postfix deferred queue, which is suboptimal.

Ilja Booij wrote:
>
> Ilja Booij wrote:
>
>> I was wrong:
>>
>> There are two problems:
>> dbmail-smtp: for some reason, the dbmail-smtp returns EX_TEMPFAIL when
>> there are only external forwards to deliver
>>
>> dbmail-lmtpd: after closing the pipe, the daemon process (a child of
>> the original daemon) gets a SIGCHLD (of course), but it reacts to this
>> by killing itself! Of course, it should ignore this signal.
>
> This last problem I've dealt with. In serverchild.c, I've added a signal
> handler ChildSignalHandler() as signal handler for SIGCHLD, and use that
> function to ignore the SIGCHLD. Somehow, just setting signal(SIGCHLD,
> SIG_IGN) did not work like I wanted it to. It interfered with the server
> parent signal handler.
>
> Ilja
>
>>
>> Ilja
>>
>>
>> _______________________________________________
>> Dbmail-dev mailing list
>> Dbmail-dev@dbmail.org
>> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
>
> _______________________________________________
> Dbmail-dev mailing list
> Dbmail-dev@dbmail.org
> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
Re: multiple deliveries to external aliases [ In reply to ]
Blake,

I think it was already:

$ cvs diff -r 1.19 -r 1.20 serverchild.c
Index: serverchild.c
===================================================================
RCS file: /cvsroot-dbmail/dbmail/serverchild.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -r1.19 -r1.20
2c2
< $Id: serverchild.c,v 1.19 2004/03/19 16:27:38 ilja Exp $
---
> $Id: serverchild.c,v 1.20 2004/04/05 13:52:03 ilja Exp $
74c74,75
< /* perform reinit at SIGHUP otherwise exit */
---
> /* perform reinit at SIGHUP otherwise exit, but do nothing on
> * SIGCHLD*/
75a77,80
> case SIGCHLD:
> trace(TRACE_DEBUG, "ChildSighandler(): SIGCHLD received..."
> "ignoring");
> break;
138d142
<
212a217
> sigaction(SIGCHLD, &act, 0);




Blake Mitchell wrote:
> When you get a chance, could you check this fix in. Right now I've got a
> cron job cleaning out the postfix deferred queue, which is suboptimal.
>
> Ilja Booij wrote:
>
>>
>> Ilja Booij wrote:
>>
>>> I was wrong:
>>>
>>> There are two problems:
>>> dbmail-smtp: for some reason, the dbmail-smtp returns EX_TEMPFAIL
>>> when there are only external forwards to deliver
>>>
>>> dbmail-lmtpd: after closing the pipe, the daemon process (a child of
>>> the original daemon) gets a SIGCHLD (of course), but it reacts to
>>> this by killing itself! Of course, it should ignore this signal.
>>
>>
>> This last problem I've dealt with. In serverchild.c, I've added a
>> signal handler ChildSignalHandler() as signal handler for SIGCHLD, and
>> use that
>> function to ignore the SIGCHLD. Somehow, just setting signal(SIGCHLD,
>> SIG_IGN) did not work like I wanted it to. It interfered with the
>> server parent signal handler.
>>
>> Ilja
>>
>>>
>>> Ilja
>>>
>>>
>>> _______________________________________________
>>> Dbmail-dev mailing list
>>> Dbmail-dev@dbmail.org
>>> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
>>
>>
>> _______________________________________________
>> Dbmail-dev mailing list
>> Dbmail-dev@dbmail.org
>> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
>
> _______________________________________________
> Dbmail-dev mailing list
> Dbmail-dev@dbmail.org
> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
>

--
________________________________________________________________
Paul Stevens paul@nfg.nl
NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31
The Netherlands_______________________________________www.nfg.nl
Re: multiple deliveries to external aliases [ In reply to ]
so it was, my mistake

Paul J Stevens wrote:

>
> Blake,
>
> I think it was already:
> ...
Re: multiple deliveries to external aliases [ In reply to ]
Ilja Booij wrote:

> Ilja Booij wrote:
>
>> I was wrong:
>>
>> There are two problems:
>> dbmail-smtp: for some reason, the dbmail-smtp returns EX_TEMPFAIL
>> when there are only external forwards to
>
Fixed it!

In pipe.c, insert_messages(), each delivery gets a label (DSN_CLASS_OK,
DSN_CLASS_TEMP, DSN_CLASS_FAIL). Now, all deliveries that were not to be
stored locally, but were only to be forwarded, got a DSN_CLASS_TEMP
label. I've added an extra check to make sure a DSN_CLASS_OK label was
given if there is only forwarding.

This works for both dbmail-lmtpd and dbmail-smtp.

Sorry it took so long, I was ill the last 2 days.. :(

Ilja