This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to make expression filter case INdependent

dear readers,

is there a way to match all various cases of a word (viagra for example) using one expression, or not? (then I would have to enter viagra, Viagra, vIagra, viAgra, etc, etc, etc.... (you get the idea)

Case independent matching seems MUCH more logical to me than case dependent... It's the actual word that triggers the rule, not the capitalisation it happens to be in... right..?


This thread was automatically locked due to age.
Parents
  • ok, thanks very much, that works.

    For people having the same problem, here's the solution:

    (?i)viagra

    this example matches any case of viagra (Viagra, viAgra, whatever)

    Still think that this should really be the standard behaviour...

    Thanks for helping out!
  • right...! [:)]

    interesting, thanks for taking the time to explain!

    yours,
    mourik jan
  • OOPS. there is still a problem with my 'solution' to filter mail case independant. BECAUSE:
    "(?i)cialis" also matches this string INSIDE other words. Meaning: blocking cialis (a viagra alternative, from what i gather..?) also blocks mails containing the word "specialising", as it contains "cialis".

    So... any idea how to add a space before and after the term..? this doesn't work:

    (?i) viagra 
    (i've simply put a space before and after)

    Suggestions?
  • found it: \b matches a word boundary, so

    (?i)\bcials\b

    does the trick

    also this works:
    (?i)\btest test\b

    macthes only "test test"

    Am i right..? [:)]portant..?)

    Thanks anyway.
  • Hmmm, it already IS case independant.

    Go to the expression filter and enter "vaigrA", then put the word VIAGRA or viagra in the subject line or the message body, and  it will match every time for me.

    It scans the subject line and the message body and is not case sensitive.
  • Hmm, I have to say - I have a an expression "viagra". It didn't catch neither "VIAGRA", "ABCVIAGRASSSS", "viagrA" nor "v1@gr@" - the last one was rather unexpected though. I catched only "viagra" on my 5 phrase test. Don't know if this is how it was planned but I guess it's never too much to be rather safe than sorry.
  • Filtering for spam only gives you temporary relief; they do 'verticals', all sorts of punctuation permutations, spacing, and let's not forget images... (-though relief nonetheless that your users will probably appreciate for a few weeks...)

    That's why I was more interested in its application for rudimentary (potential) malicious code content inspection...

    Thanks for the tip!
  • SecApp, the online help gives this kind of example for the HTTP Proxy custom content scanning:
    (?i)\ ]*\>
    So you're on the track. You can also block the scripts with HTTP Proxy built-in feature. Or is it lacking something?
  • Obviously did not see that in the help!

    There are always trick new spots to stuff script being found out.

    Also, I wonder how the script detection handles foreign encodings? Some RegExes support detection for alphabetics with [:alpha:]; what happens when you have a tag made with foreign (unicode) characters? Some American or German browsers will step it down to characters (and consequently tags) you may not want to allow. So does the script detection cover this? Dunno...

    Maybe the script detection covers it all, but it's nice to know when they post a new exploit on BugTraq, we can now do something...
  • hi you all,

    this discuss is very interesting. in the past (~6years) i was in many mailingslists with different emailadresses and today i get many spam mails. filter on my mta and asl helps me to drop the most, but the idiots of spammers found every day new solutions for spam. last mail was "\/I@gra" with slash and backslash. the problem is, i cannot enter all possible caracters which build a "bad" word.

    lets view how this discuss go to end.

    by
  • OK, we're morphing from a discussion of how to make RegExes work to how to effectively block Spam.

    feel the foolproof method (for the present...) is challenge-reponse:

    TMDA's Challenge/Response System

    I first saw this feature as an addon for qmail, but it appears these fellows have strived to make an agnostic implementation. [Note to anybody speed-reading this: it only challenges on the first Email in; all subsequent messages do not require the id step, and the list can be updated by an admin to disallow manual intervention. Later versions could get fancier still and use prompts to simple questions any human would know, or reading of images...]

    An Outlook addon product that does this is Qurb (it's got some problems, but they're on the right track...) [P.S. I would like to see it in SquirrelMail, along with an easily programmable API for making workflow message routing apps; I think we'll be seeing more slick stuff in the OpenSource community now that the Java Mail API is maturing...]

    Some AntiSpam idealists don't like this approach since it acknowledges your existence to a spambot; but subsequent mail doesn't get through, so what will you care? (other than some gateway and mail relay resources continuing to be consumed; I think you won't feel it...)

    Another reason some companies are not crazy about this is it's perceived as a little 'weird' ("Excuse me -I mailed a human; I don't want to have to answer to some damn mailbot!!"). But I think this perception is a cultural obstacle which can change when people realize the gravity of the situation; it's either that or we continue to wade through stuff that end-runned the filter.

    The only silver bullet solution would be a set of anti-spam laws with real teeth and enforced uniformly through international jurisdictions, coupled with a mail certificate infratructure being implemented overnight. That may happen gradually, but what do we do in the five (ten??) years it takes for everybody to get their acts together?

    Another idea that's been kicked around is a charge- back fee to the sender of Email if you acknowledge it as Spam. That would require ICANN-like agencies to hold chump change in escrow to insure that penalties get applied -the idea of some organizations holding lots of small deposits for sending Email has not been well received...

    Filtering might still be needed, since you might allow mail from another company, but what if the trusted peer slips up and says something legally inappropriate? The company propagating the mail could become entangled in a workplace lawsuit. Also, you might want to check for company trade secrets blatantly leaking out (forget about willful corporate espionage; lots of steganography tools can accomodate that!!); much better to have a filter expression to screen mails than some Der Kommissar, no?? Some say power corrupts; absolute power corrupts absolutely...
Reply
  • OK, we're morphing from a discussion of how to make RegExes work to how to effectively block Spam.

    feel the foolproof method (for the present...) is challenge-reponse:

    TMDA's Challenge/Response System

    I first saw this feature as an addon for qmail, but it appears these fellows have strived to make an agnostic implementation. [Note to anybody speed-reading this: it only challenges on the first Email in; all subsequent messages do not require the id step, and the list can be updated by an admin to disallow manual intervention. Later versions could get fancier still and use prompts to simple questions any human would know, or reading of images...]

    An Outlook addon product that does this is Qurb (it's got some problems, but they're on the right track...) [P.S. I would like to see it in SquirrelMail, along with an easily programmable API for making workflow message routing apps; I think we'll be seeing more slick stuff in the OpenSource community now that the Java Mail API is maturing...]

    Some AntiSpam idealists don't like this approach since it acknowledges your existence to a spambot; but subsequent mail doesn't get through, so what will you care? (other than some gateway and mail relay resources continuing to be consumed; I think you won't feel it...)

    Another reason some companies are not crazy about this is it's perceived as a little 'weird' ("Excuse me -I mailed a human; I don't want to have to answer to some damn mailbot!!"). But I think this perception is a cultural obstacle which can change when people realize the gravity of the situation; it's either that or we continue to wade through stuff that end-runned the filter.

    The only silver bullet solution would be a set of anti-spam laws with real teeth and enforced uniformly through international jurisdictions, coupled with a mail certificate infratructure being implemented overnight. That may happen gradually, but what do we do in the five (ten??) years it takes for everybody to get their acts together?

    Another idea that's been kicked around is a charge- back fee to the sender of Email if you acknowledge it as Spam. That would require ICANN-like agencies to hold chump change in escrow to insure that penalties get applied -the idea of some organizations holding lots of small deposits for sending Email has not been well received...

    Filtering might still be needed, since you might allow mail from another company, but what if the trusted peer slips up and says something legally inappropriate? The company propagating the mail could become entangled in a workplace lawsuit. Also, you might want to check for company trade secrets blatantly leaking out (forget about willful corporate espionage; lots of steganography tools can accomodate that!!); much better to have a filter expression to screen mails than some Der Kommissar, no?? Some say power corrupts; absolute power corrupts absolutely...
Children
No Data