Configuring routing Exim on cPanel to use a Smarthost

Routing outbound all mails exim to a smarthost :

Go to the “Exim Configuration Editor” in WHM. Choose “Advanced Editor”. Add in the routers section (after begin routers, and after the democheck: router block):

smarthost_dkim:
driver = manualroute
domains = !+local_domains
require_files = "+/var/cpanel/domain_keys/private/${sender_address_domain}"
transport = remote_smtp_smart_dkim
route_list = $domain smtp.yoursmarthost.com::587

smarthost_regular:
driver = manualroute
domains = !+local_domains
transport = remote_smtp_smart_regular
route_list = $domain smtp.yoursmarthost.com::587

Then add in the transports section (after begin transports):

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}}

Save the configuration. All the outgoing mail will be relayed trough the filterserver and accept original and DKIM signed emails.

Be Sociable, Share!

Leave a Reply

Your email address will not be published. Required fields are marked *