[EMAIL PROTECTED] wrote: >Joe Kletch wrote: > > >>So excited--I created my first rule. >> >> > >Congratulations! > > > >>It ran through lint with no >>errors and seems to be achieving the requested outcome: move messages >>from this sender to the recipients Spam folder, but do not reject (I >>have simscan rejecting scores over 18 points). The Threshold for >>moving to the Spam folder is 4.0 points. >> >>Could the list take a peak at this and make sure I didn't create a >>rule that will screw up everything from AOL or advise a better way to >>handle this. Thanks for your help. >> >>mail spamassassin $ cat move_to_spam.cf >>header SLOWHND67 From:addr =~ /[EMAIL PROTECTED]/i >>describe SLOWHND67 Marissa's mail buddy into Spam folder >>score SLOWHND67 3.0 >> >> > >You're guilty of a breach-of-etiquette here - publishing an email address >without permission. > >You anchor the string at the end with a $ - which is fine - but you don't >anchor it at the beginning with a ^, which could help. If anyone ever emails >Marissa from an address that ends in [EMAIL PROTECTED] - for example, [EMAIL >PROTECTED] - this rule will false-positive. > >To fix, use this regexp: /[EMAIL PROTECTED]/i > >
Personally, I prefer to not use anchors for this. I tend to use \b. Realistically you could have: From: Joe User <[EMAIL PROTECTED]> or From: [EMAIL PROTECTED] Or lots of other forms. To avoid FP's on [EMAIL PROTECTED] I'd use something like this regex: /[EMAIL PROTECTED]/i \b forces a "word boundary". Perl defines "word characters" to be alphanumeric and underscore [a-zA-Z0-9_], and a word boundary is a transition between word and nonword characters. (line boundaries count as non-word characters) The word boundary requirement allows other things to be on the line, but requires that there be some form of break such as a space, end of line, punctuation, etc.