procmail
[Top] [All Lists]

Re: Recipe problem

2003-10-06 09:39:03
At 07:46 2003-10-06 -0500, Chuck Campbell wrote:
I have the following recipe in my .procmailrc.  Since linux-kernel is the
largest volume mail list I have, and rarely has any spam, this is the first
recipe in my .procmailrc file.

:0:
* (^TO|^TO_|^SENDER|^FROM_DAEMON|^From:.*)linux-kernel*
linux-kernel

Several people have already pointed out the folly of some of the components of that regexp.

Besides being utterly broken, the reason that ^TO isn't good for a mailing list is that sometimes, people BCC a list - they'll post messages to other lists and people as well, but BCC some of them. While the List actually receives the message, and may even tag the subject line, and of course inserts all of it's list-type headers, the To: and Cc: fields never get modified to show the list address. As a result, ^TO doesn't spot the list as a recipient of the message.

As you've already been advised, the mailing-list software specific headers which identify a listname component are appropriate for identifying messages coming to you through a specific list. If some nimrod cc's you when replying to the list (something I find to be rather annoying, seeing as if you're subbed to the list, you'll already get the copy sent through the list), only the message which gets delivered to you VIA the list will actually have the list headers on it - the directly delivered message will not (though it may match a ^TO, and probably will in most cases where you get cc'd).

Ruud mentioned a recipe I've re-posted here recently - you might want to check it out, as you could invoke it near the top of your rcfile, and then simply check listname:

:0:
* LISTNAME ?? ^^linux-kernel^^
$LISTNAME

Since this delivers to a folder based on a variable, you could put the listname in an or construct, if you have multiple "clean" lists, handling the lot from a single recipe:

:0:
* LISTNAME ?? ^^(linux-kernel|bugtraq|procmail)^^
$LISTNAME


You could massage the LISTNAME variable in the list-id recipe, either converting it to a different name or ensuring that all occurrences are in one case or another - a simple grep operation against a lookup file will do that quite nicely.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


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