View previous topic :: View next topic |
Author |
Message |
micC
Joined: 03 Nov 2007 Posts: 12
|
Posted: Mon Nov 05, 2007 5:30 pm Post subject: Black rules |
|
|
Hello,
I wish to block the messages which have [SPAM] in the subject.
For example, I want block a mail with "[SPAM] CheapestRolexRep1ica! Exclusive Rep1icaWATCHES Online, buy fake designerWatches letter" in the subject.
[SPAM] is written by the anti-spam of my supplier of my address.
How to write the rule?
Thanks for your reply. |
|
Back to top |
|
|
vetaltm Author
Joined: 05 Feb 2006 Posts: 751
|
|
Back to top |
|
|
micC
Joined: 03 Nov 2007 Posts: 12
|
Posted: Mon Nov 05, 2007 7:28 pm Post subject: |
|
|
Thanks.
I had tried this: Header{Subject} =~ [SPAM]
but it did not work.
Could you explain why? |
|
Back to top |
|
|
vetaltm Author
Joined: 05 Feb 2006 Posts: 751
|
Posted: Mon Nov 05, 2007 7:42 pm Post subject: |
|
|
micC wrote: |
I had tried this: Header{Subject} =~ [spam]
Could you explain?
|
It doesn't work because the square brackets have a special meaning in regular expressions. The expression "[spam]" matches any (one) symbol from a set of symbols, listed between the brackets: "s" or "p" or "a" or "m". As you can see I've added a quote symbol '\' before each bracket to make the RegExp engine interpret them as usual, non-special symbols. |
|
Back to top |
|
|
|