Exim Deny All Except
Hi All,
I want outgoing messages for our domain (our-domain.com) blocked except for other other domains. I tried the suggested exim filter from cPanelMichael but it's not working.
I want our-domain to blocked from all domains but still can send to our-domain.com, allowed1.com and allowed2.com
Here is my exim filter
Please help
if
$header_from: contains "@our-domain" and
$header_to: does not contain "@out-domain" or
$header_to: does not contain "@allowed1.com" or
$header_to: does not contain "@allowed2.com"
then
fail text "Unauthorized Mail"
endif
Please help
-
Hello, Could you also outline the specific steps you have taken thus far to implement that custom filter rule? Note the email filter options in cPanel are designed to filter incoming email. You can customize the Exim system filter if you want to apply a filter to outgoing email. Information about modifying the Exim system filter is documented at: 0 -
Hi cPanelMichael, I am using the system filter /etc/cpanel_exim_system_filter_custom. I want block all incoming and outgoing mails except for our domain, allowed1.com and allowed2.com. Because we're planning to have our mails for company mails only and prevent incoming mails except for allowed1.com and allowed2.com What should be the suitable filter for that setup? 0 -
Hello, The rules in your initial post look okay. In "WHM >> Exim Configuration Manager", under the "Filters" tab, are you using a custom filter for the "System Filter File" option? If so, you'd need to add your custom filter rules to that custom system filter file itself instead of adding them as separate filter files under the options directory. There's a thread on this topic at: 0 -
I am already using our custom filter 0 -
Hi, anybody can help? 0 -
In a normal account filter rule, the 'or' operator does not work using . I don't know about the custom rules for exim outgoing mail, but you could have a look at to see if it might be of any help. 0 -
Hi, This seems to work for me if ( $h_to: does not contain "our-domain.com" and $h_to: does not contain "allowed-domain1.com" and $h_to: does not contain "allowed-domain2.com" and $h_to: does not contain "allowed-domain3.com" and $h_to: does not contain "allowed-domain4.com" ) and ($h_from: contains "our-domain.com") then fail text "Unauthorized Mail" endif0 -
Hello, I'm glad to see you found a suitable filter rule. Thank you for sharing the outcome. 0 -
Hi if ( $h_to: does not contain "our-domain.com" and $h_to: does not contain "allowed-domain1.com" and $h_to: does not contain "allowed-domain2.com" and $h_to: does not contain "allowed-domain3.com" and $h_to: does not contain "allowed-domain4.com" ) and ($h_from: contains "our-domain.com") then fail text "Unauthorized Mail" endif This code works for single email id in to address. if you combined with "our-domain.com", "allowed-domain1.com", "gmail.com","yahoo.com" means mails goes to all the email id's. please share the solution. Thank you. 0
Please sign in to leave a comment.
Comments
9 comments