Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    2

    Default cpanel's mail filter regexp lacking?

    Folks,
    I've tried to create mail filters using cpanel's Mail->Filter commands and it seems that cpanel's implementation of regexp is either lacking or my understanding of regexp is lacking.

    It doesn't seem to handle regexp with word boundaries:

    \bbadword|badword2|badword3\b

    The above will only match badword2 in the subject line--the two on both ends are ignored.

    Similarly I have the following regexp set up for the subject filter to eliminate anything marked as [*SPAM*10.0*] or above by SpamAssassin, but the test doesn’t seem to work despite working on some other regexp testing facilities:

    \[\*SPAM\*[1-9][0-9].[0-9]\*\]*

    This should match (and delete) an email with the subject [*SPAM*10.0*], but not [*SPAM*9.9*] (or anything lower). However, when I try the Filter Test, it says that even a 1.0 will fail and be deleted.

    When I try the regexp at http://www.regular-expressions.info/...ptexample.html, it matches properly.

    Anyone else run into these problems?

    Curtis

  2. #2
    cPanelBilly
    Guest

    Default

    It's perl regex


    Code:
    \[\*SPAM\*[1-9][0-9].[0-9]\*\]*
    should be
    Code:
    \[\*SPAM\*[1-9][0-9]\.[0-9]\*\]\*
    Check this:
    http://www.ilovejackdaniels.com/chea...s-cheat-sheet/

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    2

    Default

    Thanx, cpanelbilly. How should the word boundary tags be represented? I don't see a difference in Perl handling.

    I've tried

    Code:
    (\bbadword|badword2\b)
    but it doesn't seem to make a difference....

    Thanx,
    Curtis

Similar Threads & Tags
Similar threads

  1. mail filter problem on cpanel
    By devilsoulblack in forum E-mail Discussions
    Replies: 1
    Last Post: 04-30-2008, 04:46 AM
  2. possible to use cpanel just to filter mail for another email server?
    By kieranmullen in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 02-15-2008, 08:16 PM
  3. Help : regexp email filter
    By nazoreen in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-14-2007, 02:38 PM
  4. .filter in cpanel-skel, filter not working
    By Miss Jacky in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 09-14-2006, 05:35 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube