[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Is everyone else seeing duplicates? -- nope



mdevin@ozemail.com.au writes:

>> Don't know why you are getting them, but I have this in .procmailrc which
>> weeds duplicates pretty effectively.
>> 
>> # Nuke duplicate messages
>> :0 Wh:  msgid.lock
>> | $FORMAIL -D 8192 msgid.cache
>>
> Thanks for that.  I will have to take a look at the manuals further to
> understand exactly what it does.

>From the ProcmailMini-FAQ


Q: I copied the recipe from the procmailex manual page for checking for
duplicates, but now I get a lot of log entries saying this invocation of
formail is failing. What's up?

A: It's supposed to work that way. What the recipe does is, if formail
detects a duplicate, it will succeed, which makes Procmail think the
message is now delivered.

 Q: Uh, I'm not sure I understand that.

A: It's a bit of a play with side effects. For reference, here's that
recipe again:

:0Wh:msgid.lock
| formail -D 8192 msgid.cache

Let's paraphrase this recipe as a dialog. There are no conditions, so the
action line is done for every message that gets as far as this
recipe. The h flag says to only show the headers of the message to the
action line, and the W flag says to wait for the program in the action
line to finish (so we can look at Formail's exit code). Procmail says,
"hey formail, save this message for me." Formail eats the message
(actually just the headers, because of the h flag), extracts the
Message-Id, and checks if it's already in the cache file.  If not,
formail says "sorry, no can do." Procmail catches this error, says "aw
shucks, you couldn't save it? I have to continue processing this message
then" and wanders off to the next recipe.  However, if the Message-Id was
already in the cache, Formail doesn't generate an error, and Procmail
(somewhat stupidly, it might seem) assumes Formail took care of that
message (i.e. saved it somewhere, for example) and that is is thus now
delivered and no longer a problem of Procmail's.


hth

Glyn
-- 

               **************************************************
               *          Here we are then.......               *
               * http://members.tripod.co.uk/Christchurch2000uk *
               **************************************************



Reply to: