PDA

View Full Version : spamassassin rule help



ccwebb
11-10-2003, 07:37 AM
I want to make a rule that matches if it finds multiple words, not in a row, in the subject.

Example e-mail subject:
no dogs, no cats, no pets

If the subject contains ALL the words (dogs cats pets) then it is a match.

This rule would match if ONE or more words was there:
# Trap mail with words in subject
header L_h_combo Subject =~ /(dogs|cats|pets)/i
describe L_h_combo screen words in subject
score L_h_combo 10.00

So I tried this but it did not work:
# Trap mail with words in subject
header L_h_combo Subject =~ /(dogs&cats&pets)/i
describe L_h_combo screen words in subject
score L_h_combo 10.00

Is this possible? Help please....

Charlie

jalal
11-10-2003, 08:27 AM
Subject =~ /(?:dogs|cats|pets).*(?:dogs|cats|pets).*(?:dogs|ca ts|pets)/i

Maybe? Untested...

ccwebb
11-10-2003, 08:58 AM
Jalal:

I tested it and it worked!

Thanks much - now I have to look up your code to see if I can figure out how it works - thanks again.

BTW - I don't hate pets - the real words were pills pump patch

Charlie