Different smart host for sending emails
Hello All,
Hope everyone is doing good. With the help of below URL and your support, I managed to send emails of my different domains via different SMTP providers. So currently I have two SMTP relay where first domain send emails from Google smtp and second domain sends emails from Mailgun.
However Is this possible to send emails from a particular smtp relay to a particular recipients. So lets say,
1. My first domain using Google smtp relay.
2. There is a automatic email schedule via script.
3. It sends a single copy to A@domain.com[/EMAIL], B@domain.com[/EMAIL] and C@domain.com[/EMAIL]
4. Since I have already configured a second smtp relay called mailgun.
So If my first domain sends an email using Google smtp and when it sends the automatic emails, then it should take mailgun smtp relay to send email to C@domain.com[/EMAIL].
Please let me know if you need more details on this and please help me to implement this.
My current Exim config is below,
Sorry I did not paste the URL, Forward certain domain emails to Smart Host
@ROUTERSTART@:
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 : 64.94.110.0/24
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 : 64.94.110.0/24
headers_add = "${perl{mailtrapheaders}}"
transport = remote_smtp_smart_regular
route_list = !+local_domains "${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}}"
@TRANSPORTSTART@:
remote_smtp_smart_dkim:
driver = smtp
hosts_require_tls = *
interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch*{/etc/mailips}{$value}{}}}{}}
helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
dkim_domain = $sender_address_domain
dkim_selector = default
dkim_private_key = "/var/cpanel/domain_keys/private/${dkim_domain}"
dkim_canon = relaxed
remote_smtp_smart_regular:
driver = smtp
hosts_require_tls = *
interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch*{/etc/mailips}{$value}{}}}{}}
helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
Sorry I did not paste the URL, Forward certain domain emails to Smart Host
-
Hello, There's no native support for this functionality, but the following Exim-users thread explains how this would work: Exim: Select smarthost on basis of receipient address | exim | users Note you may want to consult with a qualified system administrator if you don't receive sufficient user-feedback on this customization. You can find a list of system admin services at: System Administration Services | cPanel Forums Thank you. 0
Please sign in to leave a comment.
Comments
1 comment