[Exim] Filter to weed out duplicate messages?

Top Page
Delete this message
Reply to this message
Author: Dan Lowe
Date:  
To: exim-users
Subject: [Exim] Filter to weed out duplicate messages?
I am looking for a way to get rid of duplicate messages, based on the
Message-ID header, in an Exim filter.

The concept is to parse each incoming message and grab it's Message-ID.
Then compare that to a list (a hash file or something, or a flat text
file). If the message-id appears in that file, you can the message to
/dev/null (you've already seen it). If it doesn't appear in that file,
you deliver the message, and add the message-id to the file (for the
next one that comes along to get canned).

This is to get rid of a problem I have where I get 6-7 copies of a lot
of the messages I receive because they come in to a bunch of lists, all of
which I happen to be on, etc.

I used to be able to do this with procmail like this:

:0 Wh: $HOME/mail/msgid.lock
| formail -D 8192 $HOME/mail/.msgid.cache


However I can't figure out a way to pipe a message to a program, and
test the result (all that procmail recipe did was pipe to 'formail'
and then based on the exit code it would either /dev/null the message
or it would deliver it).

Of course, doing it any other way is also fine (I don't mind how it's
done as long as the effect is achieved :-) And I would prefer to avoid
going back to procmail, as I'd rather keep everything in an Exim filter.

I've read the filter spec, FAQ, and consulted a couple of people I work
with who have been running Exim for quite a while, and no answer is
forthcoming. Anyone offer any advice?

TIA,
-dan

-- 
Daniel M. Lowe    | work: dan@???        | My words are my own.
Verio ISS    | home: dan@???        |
www.verio.com    |  pgp: finger dan@???    | http://nic.net/