Exim filter for specific requirement
We need to create a forwarder containing all email addresses of domain.com i.e everyone@domain.com[/EMAIL] and the condition to apply is only alerts@domain.com[/EMAIL] & abc@domain.com[/EMAIL] should be allowed to send mail to everyone@domain.com[/EMAIL].
Tried following filter but it's getting applied incorrectly.
if ($h_to: contains "everyone@domain.com[/EMAIL]" and $h_from: does not contain "alerts@domain.com[/EMAIL]" or $h_from: does not contain "abc@domain.com[/EMAIL]")
then
save "/dev/null" 660
endif
-
Hello, Try editing the filter to look like this and let us know if it helps: #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.0 -
This filter doesn't work under Global Email Filters. -Regards AK 0 -
Hi, Here's what the filter looks like in the cPanel UI: Let us know if this helps. Thanks! 0 -
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 ~~~~~~~~~~~~~~~~~~~ 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 R=central_filter T=**bypassed** 2017-07-17 09:58:15 1dWxdn-0007Sg-JL Completed ~~~~~~~~~~~~~~~~~~~
Regards, AK0 -
My requirement is to authorize more than 2 IDs to be able to send to everyone@domain.com[/EMAIL]
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.0 -
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 0 -
Hello, For instance, what's a specific example that's not covered by the filter rule mentioned in my earlier post? Thank you. 0 -
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 0 -
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. 0
Please sign in to leave a comment.
Comments
9 comments