dick hoogendijk wrote:
Some time ago I asked about filtering unwanted words. The advice was /
is not to do it, but I still want to try.

The filter rule was something like:

if($Subject =~ m// ) {
        return action_bounce("bad subject");
}

Question: do I put the unwanted words into this rule like this:

if($Subject =~ m/sex|microsoft|Watch/ ) {
        return action_bounce("bad subject");
}

I'm not sure how to put in the regex. How many words can I put between
those two slashes of m// ?


As many as you can fit. But I would be very careful about it. Plus, I would make sure to use "\b" around the words, so that you're not getting sub-string matches. For example:

\bsex\b  will match "sex" but not match "Wesex".

So, maybe something like this:

if($Subject =~ m/\b(sex|microsoft|Watch)\b/ ) {
        return action_bounce("bad subject");
}

However, as others have pointed out, it's not generally a good idea. Spammers change their subjects often enough that you'll have trouble keeping up. Plus, you'll be very prone to false-positives.

_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to