Block some of the recipeints
Hello,
I am using WHM cpanel for sending email and have done below configuration in the exim configuration for sending email from a different smtp providers in WHM.
Now, I got one requirement where I have to block couple of users for sending emails to outside of the organization but they can send within server to known domains.
Please suggest how can I achive this requirement as this would be a great help.
I have followed below thread for the same.
smarthost_dkim:
driver = manualroute
domains = !"+local_domains +smart_hosts"
condition = "${if eq{${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}{$value}}}{}{false}{true}}"
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 192.0.0.0/32
headers_add = "${perl{mailtrapheaders}}"
require_files = "+/var/cpanel/domain_keys/private/${sender_address_domain}"
transport = remote_smtp_smart_dkim
route_list = !+local_domains "${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}}"
smarthost_regular:
driver = manualroute
domains = !"+local_domains +smart_hosts"
condition = "${if eq{${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}{$value}}}{}{false}{true}}"
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 192.0.0.0/32
headers_add = "${perl{mailtrapheaders}}"
transport = remote_smtp_smart_regular
route_list = !+local_domains "${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}}"
smart_route:
driver = manualroute
domains = !+local_domains
senders = !*@server.domain.com
transport = IspSmarthost
# Exclude null sender messages from relaying via the smarthost
condition = ${if or {{!eq{$sender_address}{}} {!eq{$sender_host_address}{}}}}
route_list = * mail.mailprovider.com
-
Now, I got one requirement where I have to block couple of users for sending emails to outside of the organization but they can send within server to known domains.
Hello @Azim, Could you expand on this some more? For instance, can you provide a specific example of the scenario you are attempting to configure the smart host for? Thank you.0 -
Hello, Thanks for your reply and let me explain the requirement in detail, 1. There is two domains called azim.com and azim2.com, also the cpanel is there also. 2. I have created ids like user1, user2 and user3. 3. Azim.com emails delivered from one smtp provider like Google.com 4. Azim2.com emails delivered from other smtp provider like mailgun.com No all users can send emails outside from the organizations like Gmail, yahoo and etc. What I need is, user1@azim.com can send email to user2@azim2.com but he can not send email to any gmail.com email id. So basically he can send within servers but can not send outside which is unknown domain. Please confirm if you have any question. Thank you so much for your help. 0 -
What I need is, user1@azim.com can send email to user2@azim2.com but he can not send email to any gmail.com email id. So basically he can send within servers but can not send outside which is unknown domain.
Hello @Azim, You might find that creating a custom Exim system filter rule is suitable for this scenario. While we are unable to support the creation of custom filter rules, we document how to do so at: Additionally, the following threads offer examples you may find useful: Thank you.0
Please sign in to leave a comment.
Comments
3 comments