On 13 Mar, Subba Rao wrote:
| 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?
| * ^Subject:.*\<apache|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:
* 2147483647^0 ^Subject:.*\<apache\>
* B ?? 2147483647^0 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