procmail
[Top] [All Lists]

Re: Duplicates sent from lists

2004-02-17 16:04:57

On 17 Feb 2004, at 11:37, Professional Software Engineering wrote:

At 09:47 2004-02-17 -0700, LuKreme wrote:

the recipes in it are completely transparent. I should cache the list-post/reply addresses of the lists somewhere and then grep on ^TO_ ?

I had considered suggesting that, but it seems like a lot of work. Plus, there's that nasty gotcha: you uns*bscribe from a list, and receive a message from someone who cc:'s you on that list. What happens? The cache (unless periodically flushed) identifies the listaddr, and the offlist copy gets trashed.

First step:

LISTCACHE=$HOME/.listposts
ISLISTED=`grep -i "^$LISTNAME" $LISTCACHE`

:0
* ^List-post:[  ](<mailto:)?\/[-(_at_)A-Z0-9_+(_dot_)]+
{
   LISTPOST=$MATCH

   :0
   * ! ISLISTED ?? ^[^ ]+[      ]+\/[^  ]+
   { ADDTOCACHE=`echo "$LISTNAME $LISTPOST" >> $LISTCACHE` }
}

This should look familiar to you as it is a slight modification to your WHITELIST recipe.

Now I think it's a simple matter (This is not, as yet, tested):

# White space in condition is space, spacetab, spacetab
:0E # Message does not contain a List-Post Header
* LISTNAME ?? ^^^^
* ISLISTED ?? ^[^ ]+[      ]+\/[^  ]+
{  LISTPOST= $MATCH }

:0a:
* ^TO_ ?? $LISTPOST
dupemail

so, if the message doesn't contain have a LISTNAME, but is addressed to a list that normally has a list-post header, then it is a dupe, right? Granted, it's not perfect as it doesn't handle the lists without a List-Post header, but so far, that is a very small subset of my current lists, so I have high hopes for the functionality of this recipe.

What do you think, sirs?

:0
* LISTNAME ?? ^^^^
* -1
* 1^1 ^TO@
{
  :0 fw
  | formail -I"Status: RO"

  :0:
  dupemail
}

Hmm, this looks like it'd catch everything addressed to two or more addresses, such as personal correspondance between small groups of people (or heck, even where the sender copies themselves). It'd work passably well if you're using a list-specific address (which would need to have been conditioned prior to this individual recipe, since there's no condition listed here for a given address).

This address is used ONY for subscribing to lists, so it should not (to my mind) receive any messages that contain more than on email address in the ^TO_ (either a list or a message directly to me). Still, I think the above is better, no?

--
Like the moment when the brakes lock/And you slide towards the big truck/You stretch the frozen moments with your fear


_______________________________________________
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>