procmail
[Top] [All Lists]

RE: Append header in undelivered messages

2007-10-18 09:49:31
Xesc Arbona wrote Thursday, October 18, 2007 5:12 PM:

I'm using procmail with Postfix to deliver mail to a third 
party mailserver. I've set the following recipe to avoid 
duplicate mail delivery when sending to distribution lists:

:0 Wh: $PMCACHE/$RECIPIENT.msgid.lock
* ! ^X-Deferred.*
| formail -D 4096 $PMCACHE/$RECIPIENT.idcache

That works fine most of the time, but not when the mailserver 
is down. Messages can't be delivered, so procmail exits with 
code 75 and messages are deferred. However, next time 
procmail tries to deliver, it finds the Message-ID in the 
cache and mark the message as delivered. 

Thus, I would like to append some kind of "X-Deferred" header 

I suggest you use X-Loop.  It's canonical, it's well-documented
(see the procmailex man pages), and the header ought to persist 
in this use.  If you see your X-Loop, you know it's been seen 
by your procmail setup and you can you can skip the cache check.

dman

Thanks! I'll use it. However, I found another problem when trying to add the 
header:

procmail: Program failure (75) of "/usr/bin/zarafa-dagent"
procmail: Assigning "LASTFOLDER=/usr/bin/zarafa-dagent xesca"
procmail: Assigning "EXITCODE=75"
procmail: Match on ! "^X-Loop: $RECIPIENT(_at_)(_dot_)*"
procmail: Executing " (formail -I Delivered-To -A "X-Loop: 
$RECIPIENT(_at_)topdesk(_dot_)com") | $SENDMAIL -oi -t"
procmail: Error while writing to " (formail -I Delivered-To -A "X-Loop: 
$RECIPIENT(_at_)topdesk(_dot_)com") | $SENDMAIL -oi -t"
procmail: Rescue of unfiltered data succeeded
procmail: Assigning "LASTFOLDER=/home/vmail/msg.Mkh"
procmail: Opening "/home/vmail/msg.Mkh"

If I try to pipe the message manually, it works:

cat /home/vmail/msg.Mkh | formail -I Delivered-To -A "X-Loop: 
xesca(_at_)topdesk(_dot_)com") | $SENDMAIL -oi -t

What could be the problem? How can I get an even more verbose output?

Thank you very much in advance.

Regards,

--
Xesc

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>