procmail
[Top] [All Lists]

Re: Problem with duplicate mail filter (msgid.cache)

2001-11-15 12:54:26
John Gianni shared this from Andrew Beckett:

|># Remove duplicate mails
|>#
|>:0 Wh: msgid.lock
|>| (/bin/sed -e 's/^Message-ID:  /Message-Id: /') | \
|>    /usr/local/bin/formail -D 8192 $PMDIR/msgid.cache
|>
|>Rather than just calling formail -D ... directly, I added the sed at the
|>beginning
|>to convert the message ID's from listserv (which have the uppercase ID
|>bit), to "Id" which is more consistent with sendmail and majordomo.

The sed call and the shell procmail needs to pipe one command to another
should be unnecessary.  Formail normally is well aware that header field
names are case-insensitive, and I wonder if something other than the case of
the D was behind Andrew's seeing duplicate IDs mistaken for new ones.  For
example, if one ID has a trailing space outside the angle brackets and the
other does not, formail -D considers them different, and combining -z
with -D won't change that.

If it really is case that's the problem, though, at least do this, because
the parentheses are unneeded, and you can reduce the work for both sed and
formail:

 # sed should quit after finding the line and feed only that line to formail
 :0 Whi: msgid.lock
 | /bin/sed -ne '/^Message-I.:/!d' -e 's/D: /d: /p' -eq | \
     /usr/local/bin/formail -D 8192 $PMDIR/msgid.cache





_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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