On Wed, 5 Jun 2002 12:14:49 -0400
Monah Baki <mbaki(_at_)infoa(_dot_)com> wrote:
:0
* ^Subject:
.*(*fun|*bills|*weight|*credit|*casino|*paid|*FREE|*save|*congrats|\
*free|*CREDIT|*Free|*save|*PAMELA|*win|*rent|*online|*sex|*money|*i
ncome)/dev/null
I was wandering if this will work??? Is procmail case sensitive?
can't I eliminate (FREE & Free) and just keep lowercase "free". I
used the "*" so that whereever the word is in the subject line, send
it to /dev/nul/.
Here's the way I did it. I'm a procmail newbie so I'm not sure which
way is better or more efficient, perhaps someone would be willing to
enlighten me there, but anyway...
--begin .procmailrc sample--
# Assuming a directory in $HOME called ".mailfilters".
FILTERDIR=$HOME/.mailfilters
# Create a file in $FILTERDIR called "spamsubj" containing the search
# conditions you listed above, one per line.
:0
* ? formail -x "Subject:" | grep -i -f $FILTERDIR/spamsubj
/dev/null
--end .procmailrc sample--
One advantage to this method is that's it's easier to add or delete
from your list of search terms--simply edit $FILTERDIR/spamsubj rather
than mess with the .procmailrc file and risk screwing up your recipe.
(Note that grep's -i option makes grep case insensitive, so you don't
need "free" and "FREE" in your spamsubj file.)
You may want to, at the very least, modify the action line so that the
From: and Subject: lines are logged before the mail is sent to
/dev/null. It's dangerous business to delete mail, sight unseen, based
only on a term like "save" appearing in the subject line. My recipe
actually looks like this:
--begin .procmailrc sample--
:0
* ? formail -x "From: " | grep -f $FILTERDIR/spamfrom
{
:0c
* ^From:.*\/.*
| echo $MATCH >> $HOME/spamdata/killed_spam ;
:0c
* ^Subject:.*\/.*
| echo $MATCH >> $HOME/spamdata/killed_spam;
:0c
| echo "" >> $HOME/spamdata/killed_spam;
:0
/dev/null
}
--end .procmailrc sample--
(This recipe is dumping spam based on frequently-appearing addresses
in the From: line. I can usually count on about a dozen a day to my
personal address from folks like permissionpass.com, oin-1.com,
greetking, etc.)
I'm not familiar enough with procmail to tell you if this is the most
efficient means of doing this or not--maybe triggering programs like
grep and formail will cause performance his, I don't know. But it
works very well for me.
--
Ron Ostrander
ronroy(_at_)mindspring(_dot_)com
http://rkworld.home.mindspring.com
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail