Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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.

Exim filter for specific requirement

Discussion in 'E-mail Discussions' started by Source1, Jul 13, 2017.

Tags:
  1. Source1

    Source1 Member

    Joined:
    Jun 19, 2014
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Try editing the filter to look like this and let us know if it helps:

    Code:
    #FilterRule
    if
     $header_to: contains "everyone@domain.com"
     and $header_from: does not match "^(abc|alerts)@domain.com"
    then
     save "/dev/null" 660
    endif
    Thank you.
     
  3. Source1

    Source1 Member

    Joined:
    Jun 19, 2014
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    This filter doesn't work under Global Email Filters.


    -Regards
    AK
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hi,

    Here's what the filter looks like in the cPanel UI:

    filter-rule.png

    Let us know if this helps.

    Thanks!
     
    #4 cPanelMichael, Jul 17, 2017
    Last edited: Jul 18, 2017
  5. Source1

    Source1 Member

    Joined:
    Jun 19, 2014
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks for your reply,

    It's getting filtered as below if I give From in this fashion ^(alerts|abc)@domain.com but it works well with single ID i.e. alerts@domain.com.

    My requirement is to authorize more than 2 IDs to be able to send to everyone@domain.com

    Code:
    ~~~~~~~~~~~~~~~~~~~
    69-b255-3a88-d56bfdde68a5@msourceone.com T="test" for everyone@domain.com
    2017-07-17 09:58:15 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1dWxdn-0007Sg-JL
    2017-07-17 09:58:15 1dWxdn-0007Sg-JL => /dev/null <everyone@domain.com> R=central_filter T=**bypassed**
    2017-07-17 09:58:15 1dWxdn-0007Sg-JL Completed
    ~~~~~~~~~~~~~~~~~~~
    
    Regards,
    AK
     
    #5 Source1, Jul 18, 2017
    Last edited by a moderator: Jul 18, 2017
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Could you provide more details about this? It seems like you may need to develop a custom regular expression for use in your rule.

    Thank you.
     
  7. Source1

    Source1 Member

    Joined:
    Jun 19, 2014
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    Please let me know what details you need about this ?

    >>Could you provide more details about this? It seems like you may need to develop a custom regular expression for use in your rule.

    Regards,
    AK
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    For instance, what's a specific example that's not covered by the filter rule mentioned in my earlier post?

    Thank you.
     
  9. Source1

    Source1 Member

    Joined:
    Jun 19, 2014
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    I have clearly mentioned what is happening if I create filter using ^(alerts|abc)@domain.com.

    Please check my reply sent on "Source1, Tuesday at 11:32 AM Last edited by a moderator: Tuesday at 2:46 PM".

    Regards,
    AK
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The log output in that post suggests the actual email address in your filter includes hyphens (- symbol). This is going to require a custom filter rule using regular expressions. Here are a couple of documents you can reference if you'd like to try writing a custom rule on your own:

    Exim Filter Specification - String testing conditions
    8. Regular expressions

    You may also want to post to the Exim users mailing list for additional assistance developing the custom rule.

    Thank you.
     
Loading...

Share This Page