Re: Mailing loop fixed

Kenneth Herron (kherron@campus.mci.net)
Thu, 10 Jul 1997 18:17:00 -0700 (PDT)

Sorry to be off-topic, but the procmail users among you may be
interested in this. The following procmail recipes weed out duplicate
messages based on the message ID. I originally set this up to catch
letters sent to both pm-users and pm-radius, but it filtered out the
recent duplicates just fine.

If you run unix and are unfamiliar with procmail, it's at
<ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail/procmail.tar.gz>.

# Portmaster-{users,radius,announce} (sent to the same box).
:0
* ^((Resent-)?To|Cc):.*portmaster-(users|radius|announce)(-(digest|list))?@
{
# Weed out duplicates. Use formail to see if the ID is in the
# cache; if it is, formail exits with 0. If not, formail
# adds the ID to the cache and exits with nonzero. An exit
# value of 0 means the message is considered delivered, which in
# this case means it's a duplicate.

:0 Wh: /tmp/pm-radius.lock
| formail -q- -D 8100 Mail/pm-radius.ids

# Part two: If the previous rule failed (i.e. the message isn't
# a duplicate), write it to the mailbox.
:0: /tmp/pm-radius
Mail/pm-radius
}