The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Conditional mail filtering

Discussion in 'E-mail Discussions' started by larkim, Sep 27, 2007.

  1. larkim

    larkim Member

    Joined:
    Sep 27, 2007
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    I'm a user of cPanel, though not an admin. My shared hosting support haven't been able to help me with this.

    To allow me to trace the source of unsolicited mails, whenever I sign up with e-mail addresses for websites / services etc I use sitename.matthew@mydomain.etcetc

    So for this site, my email addy is cpanel.matthew@........

    I use a filter so that every mail where the header_to contains "matthew" is sent to a pop3 account on the server. All fine and dandy.

    However, one of the signups I used in the past for google groups is abused a lot, and I don't want these mails to sit in my squirrelmail webmail. Not all is detected as spam.

    I have added a specific filter for where header_to contains "google" to set to discard.

    Unfortunately, when I test this (and in practice what happens) is that the mail matches both of these filters, and is therefore discarded AND sent on to my pop3 account.

    The front end of cPanel doesn't seem to allow for conditional mail filters (e.g. if header_to contains matthew then if header_to contains google discard else forward_to pop3 endif endif - you know what I mean).

    How could I achieve this?

    Thanks!

    Matt
     
  2. larkim

    larkim Member

    Joined:
    Sep 27, 2007
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Just a post to add that having reviewed the info here I suspect that I'll be looking at editing the filter.yaml file in the .cpanel directory, and I'm comfortable with doing that. I'd mistakenly thought that the .filter folder in the root of my account was the one which I'd have to edit. Any pointers gratfully received.

    Matt
     
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You can shorten the logic of that statement to IF header_to CONTAINS matthew AND header_to CONTAINS google DISCARD. This statement is supported by the mail filtering interface.

    Simply when creating your rule, click the "+" button to the right of your first statement and a second line will pop up. Next to the button you just clicked, you'll see a drop-down list of 2 logical operators (AND OR).
     
  4. larkim

    larkim Member

    Joined:
    Sep 27, 2007
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Does that work under cPanel 10 (which is what seems to be in place)? I can't find buttons to add additional conditions.

    THanks for the quick response!

    Matt
     
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    cPanel 10 is a bit out of date, I would recommend upgrading to version 11 or asking your hosting provider to upgrade to version 11.
     
  6. larkim

    larkim Member

    Joined:
    Sep 27, 2007
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    OK, thanks I'll take that up with my hosting provider.

    In the meanwhile, is it possible to edit filter.yaml without using the front end of cPanel in order to achieve my objective? If so, are there any resources which can help me figure out what the coding should be? I'm not a coding novice (well, not completely - complex dos batch scripts and VBA are my backgrounds in terms of scripting) but I haven't done anything that resembles the code structure of the .yaml file.

    Thanks

    Matt
     
  7. larkim

    larkim Member

    Joined:
    Sep 27, 2007
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Update - actually using version 11

    But the options described above to implement conditional filters don't appear to be there.

    cPanel version shows as 11.11.0-RELEASE 16983, theme is cPanel X 2.6.0

    I'll post an image later, but I'll describe the email filtering page:-

    Entitled "Add filter"

    "Filter" then drop down box with options "From, Subject, To, Any header, Body, SpamAssassin header..."
    "that" then drop down box "contains, equals, regex..." etc
    followed by box for the item to be matched etc.

    Underneath there is "destination" with a text box to be completed. And below that just some advice about potential destinations. No option for anything conditional or any additional criteria.

    Then there is a button for "activate". That's it.

    Am I missing something?

    Thanks for any help!

    Matt

    Edit - this link http://www.hooverwebdesign.com/support/email-filtering.html shows exactly the pages as I see them.
     
    #7 larkim, Oct 3, 2007
    Last edited: Oct 3, 2007
  8. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    The instructions I provided are for the X3 theme. You should consider moving to X3 as X and X2 will no longer be available in version 12 and are currently deprecated.
     
Loading...

Share This Page