Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Oct 2003
    Posts
    5

    Default regex & mail filter

    All,

    I have been fiddling about with the filtering capabilities, trying to eliminate some spam that has become quite regular of late. Since I was having no luck filtering on the actual spam, I tried to just do some more simple filters to see whether I was doing something wrong with the regex definitions or whether it was another problem.

    I created a filter to locate the word "Mary" in any email and send those emails to a different email address. Obviously this is a stupid rule to use in reality, but it's simple for testing. The settings are:

    ==============
    FILTER: Body
    that
    MATCHES REGEX
    /Mary/
    DESTINATION: mary@mydomain.com

    ==============

    I then sent an email from a Lycos account containing the text "Mary had a little lamb" which should have - to the best of my understanding - been detected as containing the word "Mary" in the body and sent to mary@mydomain.com instead of my regular email address.

    This did not happen - it just came through to my regular address and was not filtered in any way.

    Anyone got any ideas?

    Thanks in advance,

    Trav.

    PS: If you're wondering why I chose "mary" as a test method, I went through the cpanel docs first, and read http://gnosis.cx/publish/programming...pressions.html as directed, but what works on that page does not work for me.

  2. #2
    Member
    Join Date
    Aug 2001
    Posts
    23

    Default

    I have done some fiddling with the Matches_Regex option in the filters. It seems from my tests that the beginning and ending slashes are added by the script automatically or are just not needed.

    /Mary/
    would not work for me but

    Mary
    does

    What I really would like to see is the ability do multiple header line filtering like

    If the email is TO: Joe@joesdomain.com
    AND
    the spam header line contains YES
    Discard

  3. #3
    Member
    Join Date
    Oct 2003
    Posts
    5

    Default

    charlie,

    Oops. I neglected to respond to this forum to note that I had also discovered the slashes to be redundant. I posted this query on another forum and when I discovered the problem, I responded to my own posting there but overlooked this one. My apologies. Since there had been no other responses to this thread, it slipped my mind.

    Thanks for your response though - if I had not worked it out by now, I would still be going mad and you'd be the saviour of the day. Ideally when someone else reads this thread, you will be their saviour of the day!

Similar Threads & Tags
Similar threads

  1. Regex to filter listpops function by domain
    By rlesterphx in forum cPanel Developers
    Replies: 2
    Last Post: 04-20-2011, 03:08 PM
  2. regex help for e-mail filter
    By rpiggott in forum E-mail Discussions
    Replies: 1
    Last Post: 05-22-2010, 02:56 PM
  3. Mail Filtering: Problem Escaping A Period (Regex)
    By TBear in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 02-22-2010, 01:19 PM
  4. Output Filter & .HTML INCLUDES SUPPORT
    By Evren Bilen in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-08-2003, 05:07 AM
  5. Output Filter & .HTML INCLUDES SUPPORT
    By Evren Bilen in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 03-06-2003, 10:27 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube