Exim filter for specific requirement

Source1

Member
Jun 19, 2014
15
0
51
cPanel Access Level
Root Administrator

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,245
463
Hello,

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

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

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,245
463
Hi,

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

filter-rule.png

Let us know if this helps.

Thanks!
 
Last edited:

Source1

Member
Jun 19, 2014
15
0
51
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. [email protected].

My requirement is to authorize more than 2 IDs to be able to send to [email protected]

Code:
~~~~~~~~~~~~~~~~~~~
[email protected] T="test" for [email protected]
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 <[email protected]> R=central_filter T=**bypassed**
2017-07-17 09:58:15 1dWxdn-0007Sg-JL Completed
~~~~~~~~~~~~~~~~~~~
Regards,
AK
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,245
463
My requirement is to authorize more than 2 IDs to be able to send to [email protected]
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.
 

Source1

Member
Jun 19, 2014
15
0
51
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,245
463
Hello,

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

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,245
463
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.