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.

Email filtering using to: header and begins with not working

Discussion in 'E-mail Discussions' started by tominthevan, Feb 25, 2008.

  1. tominthevan

    tominthevan Registered

    Joined:
    Feb 25, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I am trying to route my email using filters based on the recipient address. I want email with To addresses starting with (e.g.) the string "abc" to be routed to a specific destination.

    If I use the Cpanel filtering based on Header To and Begins With abc, the Cpanel test filtering works but filtering of actual email doesn't seem to be selected by the filter as it should. If I use Header To and Contains abc, both the Cpanel Test filtering and filtering actual email work.

    I also tried Begins with using the subject and that works as expected. It just doesn't do what I need.

    I've also tried regular expressions and again can get it to work with expressions that match anywhere in the address string, but ones that try to match the beginning of the string work for the Cpanel test filtering but not with actual email.

    Given that both regexp and Begins With are behaving similarly incorrectly, I suspect there is either a bug in the filtering or a hole in my understanding of how addresses are expressed for filtering.

    Any suggestions?
     
  2. lehels

    lehels Well-Known Member

    Joined:
    Jul 10, 2006
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    I confirm that Filters ar not working, precisely - the filter knows that should send the mail to a specific destionation but it just wont do that! [?]

    Example:
    I have
    Rules
    "From" "equals": "info@domain.name"
    Actions
    "Redirect to mail": "hello@anotherdomain.name"
    > Activate

    Filter Test
    From: info@domain.name
    Subject: test
    this is a test message

    Filter Trace Results:

    The Filter has matched the following condition(s):

    $header_from: is info@domain.name


    Return-path copied from sender
    Sender = user@server.hostname
    Recipient = user@server.hostname
    Testing Exim filter file "/home/user/etc/domain/test/filter"

    Deliver message to: hello@anotherdomain.name
    Filtering set up at least one significant delivery or other action.
    No other deliveries will occur.

    And the mail isn't forwarded, even if i set up a "Subject" filter as well.
     
  3. tominthevan

    tominthevan Registered

    Joined:
    Feb 25, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    filters not working as expected

    Lehels

    Actually, I have got my filters to work. The problem I had was that I was trying to route mail via a filter to another domain (as in your example). Once I changed my approach to route to different mailboxes in my current domain, the filters worked as expected. That approach served my needs, although your requirements may differ.

    I had also tried routing to another domain through a local email forwarder. I could get that to work, but not reliably. I don't know enough about mail servers to explain why.

    You now know what I know. Good luck.
     
Loading...

Share This Page