Define rules question
When defining a rule to reject an email, does capitalization count? For instance, if I define a rule to look in the subject for "Mail," would that automatically reject "mail" and "email" too? What if a word in the suject contained "Mail" such as "Mailman," would that be rejected by the reject rule for "Mail?" I'm trying to set up some rules to reject (silently, of course) all these undeliverable mail notices I've been getting from being JoeJobbed.
Thanks Jolycu |
No, yes, yes.
By default, the matches are case-insensitive and match any substring (i.e. not "full words only" match). Both can be changed by using the Look In: Advanced option (by writing custom tests). A case-sensitive full-words match for "Mail" in the "Subject" header is: Code:
header :comparator "i;octet" :regex ["Subject"] ["[^[:alpha:]]Mail[^[:alpha:]]"] |
Thanks Daniel S. If I copy your rule into the Look In-Advanced section, would that work, or do I need to add anything to it? I'm not sure I understand about the alpha business. Thanks again for taking the time to help me out.
Jolycu |
Just copy it to the "For text matching" section after setting "Look In" to "Advanced". You don't need to add anything else in the textbox.
[^[:alpha:]] matches one non-alphabetic character (a space, for example). The 'e' in "email" is not a non-alphabetic character, so the rule won't match it; the space (and start-of-string) are a non-alphabetic characters, so the string "Mail " would be matched. In general, if the string "Mail" is part of a longer word (e.g., "Mailman") it would either be followed or preceded by an alphabetic character ('m'). By matching non-alpha before and after the string, I make sure it is not part of a longer word. edit: An easier way to match full words is to use the word boundary character, '\b': Code:
header :comparator "i;octet" :regex "Subject" "\\bMail\\b" |
Thanks Daniel S. I'll give it a shot.
|
All times are GMT +9. The time now is 07:10 PM. |
Copyright EmailDiscussions.com 1998-2022. All Rights Reserved. Privacy Policy