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

Re: duplicates [was Re: UNSUBSCRIBE]



At 06:00 AM 2/18/02, Hans Ekbrand wrote:
On Mon, Feb 18, 2002 at 02:32:55AM -0800, Paul 'Baloo' Johnson wrote:
> On Mon, 18 Feb 2002, Hans Ekbrand wrote:
>
> > Me too. I might be silly, but I almost get upset when I recieve an
> > unrequested copy sent directly to me.
>
> Not something I quite understand.  Filters, people...
>
> --
> Baloo

OK, fine, how do I put up procmail to filter duplicates in this sitution?

Last year, my co-workers and I wrote an intro to unix class for our
department. One of the other guys did a section on procmail since
most of us used pine. (I no longer work there, but I still have the docs
that we made up). Here is his section on clearing out duplicates (of
which we got a lot).

Filter out cross-posts
If you are subscribed to several mailing lists and people cross-post to some of
them, you usually receive several duplicate mails (one from every list).
The following simple recipe eliminates duplicate mails. It tells formail to
keep an 8KB cache file in which it will store the Message-IDs of the most
recent mails you received. Since Message-IDs are guaranteed to be unique for
every new mail, they are ideally suited to weed out duplicate mails.
Simply put the following recipe at the top of your rcfile, and no duplicate
mail will get past it.
       :0 Wh: msgid.lock
       | formail -D 8192 $HOME/.msgid.cache

Beware if you have delivery problems in recipes below this one and procmail
tries to requeue the mail, then on the next queue run, this mail will be
considered a duplicate and will be thrown away. For those not quite so
confident in their own scripting capabilities, you can use the following
recipe instead. It puts duplicates in a separate folder instead of throwing
them away. It is up to you to periodically empty the folder of course.
       :0 Whc: msgid.lock
       | formail -D 8192 $HOME/.msgid.cache
       :0 a:
       duplicates



Reply to: