procmail
[Top] [All Lists]

Re: if [SPAM] is in subject then redirect to $HOME/mail/Junk

2006-05-14 22:36:41
On Mon, 15 May 2006 14:54:51 +1000 (EST) Paul Matthews
<paul(_dot_)matthews(_at_)cathedral(_dot_)qld(_dot_)edu(_dot_)au> wrote:

 i'm trying to get a rule that says if [SPAM] is in the subject 
line then put it in $HOME/mail/Junk.

But I just can't get it working, here is my ~/.procmailrc file 
can you tell me what i'm doing wrong?

:0:
* ^Subject:.*[spam].*
$HOME/mail/Junk

"[" and "]" are special characters. Escape them. And drop the ".*" at the
end. The ".*" at the beginning says "one or more of any character followed
by [spam]" we really don't care what comes after.

* ^Subject:.*\[spam\]

Someone else will probably correct my correction. I believe only one of "["
or "]" actually requires escaping but I can never remember which.

You should also make it a habit to escape the "." in addresses. Since "."
can stand for "0 or more of the next character" in the regex language it
can sneak up and bit you in the ... backside ... if you don't escape it
where you know it shouldn't stand for that.

* ^From:(_dot_)*(_at_)cathedral\(_dot_)qld\(_dot_)edu\(_dot_)au


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>