procmail
[Top] [All Lists]

Re: formail error

1999-08-28 09:47:47
Dominic Mitchell has this recipe,

| # Nuke duplicate messages
| :0 Wh: msgid.lock
| | $FORMAIL -D 8192 msgid.cache

and gets this in his logfile:

| procmail: Program failure (1) of "/usr/bin/formail"

So he asked,

| Where is the mistake?

It's in your expectations, Dominic.  It looks odd, and this question comes up
often, but it's exactly what you want.  We want an exit code of success on
duplicates and failure on new mail; that viewpoint may be counterintuitive
for the user, but it suits procmailrc design better.

If the message is *not* a duplicate, then formail -D returns failure; the `W'
flag tells procmail to consider the exit code of the program instead of just
its willingness to accept input; procmail deems the delivery failed; and it
keeps reading recipes to deliver the message.

If the message is a duplicate, then formail -D returns success; procmail
considers the message delivered; and procmail exits, though in reality the
message didn't go anywhere and has in fact been dropped.

So if you have VERBOSE on, you'll see that error every time you get a message
whose ID isn't in the cache.  Generally most mail will be new pieces, so most
of the time formail -D will report failure.

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