I'm hoping someone here can help, or at least point me in the right direction. The company I work for has a Barracuda Email Security Appliance that uses Perl RegEx expression for custom content filtering. We regularly have people phishing as our CEO as the display name in an email but obviously not his actual email address. I'm trying to figure out a way using RegEx to block any email with his display name in it but not his email address in the header info. The line I'm looking at in the email header is the From: displayname <email@domain> line. I've tried something similar to this and it doesn't work, this is fictitious info obviously

From: John Smith <[^j][^o][^h][^n]\.[^s][^m][^i][^t][^h][^@][^g][^m][^a][^i][^l]\.[^c][^o][^m]

I know this likely isn't the best way to do this but I know next to nothing about RegEx and even less about Perl, but everything sent from any email address with his display name is still delivered. Yes I tried contacting Barracuda but they no longer offer RegEx support.


In reply to Regex Expression to filter email for Barracuda Email Appliance by higginss20

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.