procmail
[Top] [All Lists]

Re: Mail subject recipe

2001-03-13 17:59:43
On 13 Mar, Subba Rao wrote:
| Hi,
| 
| I am trying to put all the email relating to a project in one folder. I have
| written this filter to do so. Can some procmail experts please point out if 
| this recipe could be refined?
| 
| -----------------------------
| :0c
| * ^Subject:.*\<apache|Apache\>
| apache
| 
| :0Bc
| * (apache|Apache)
| apache
| -----------------------------
| 
| Thank you in advance.

The alternations (using "|") are unnecessary because procmail's
internal egrep is case insensitive by default (which can be changed with
a "D" flag on a recipe). Other than that these recipes are pretty broad,
but I suspect you know that. Also, if apache appears both in the
Subject: and in the body, you'll get 2 copies delivered to the apache
file (then presumably another to $DEFAULT since you're using the "c"
flag). You could change that by putting an "E" flag on your second
recipe, but the following might be better.  Assuming that you really do
want to send any message with apache anywhere in the Subject: or
anywhere in the message body to the apache file, you might try:

:0 c:
* 2147483647^0 ^Subject:.*\<apache\>
* B ?? 2147483647^0 apache
apache

With this the first condition will keep the body search from needlessly
taking place if it matches, and the second one will be an automatic
match with the first occurence of apache in the body. Might be a
marginal improvement. Note, I also added a trailing ":" for a lockfile
on the recipe.

-- 
                         /"\
Don Hammond              \ /     ASCII RIBBON CAMPAIGN
Raleigh, NC US            X        AGAINST HTML MAIL,
                         / \      AND NEWS TOO

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