Exim conf for forcing smarthost even for local delivery
Hello everyone,
With the help of a few forum threads, I've configured exim to send mail for a few domains out through a smarthost (for encrypted outbound mail for HIPAA). These folks want to send each other encrypted messages as well, so I'm looking for the proper config to force those messages out through the smarthost and not delivery them locally.
Here's my existing exim.conf.local, which works for sending outbound to domains not on the same server. The IP address mentioned here is a fake one I've replaced the actual IP with.
To recap, my question is, how do I force all email to go out through the smarthost, even when it's for local delivery?
Many thanks in advance!
Beth
@AUTH@
@BEGINACL@
@CONFIG@
daemon_smtp_ports = 465 : 587 : 25
hostlist smart_hosts = lsearch;/etc/smarthosts
@DIRECTOREND@
@DIRECTORMIDDLE@
@DIRECTORSTART@
@ENDACL@
@POSTMAILCOUNT@
@PREDOTFORWARD@
@PREFILTER@
@PRELOCALUSER@
@PRENOALIASDISCARD@
@PREROUTERS@
@PREVALIASNOSTAR@
@PREVALIASSTAR@
@PREVIRTUALUSER@
@RETRYEND@
@RETRYSTART@
@REWRITE@
@ROUTEREND@
@ROUTERMIDDLE@
@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 : 111.222.333.111
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}}"
# route_list = * "${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 : 111.222.333.111
headers_add = "${perl{mailtrapheaders}}"
transport = remote_smtp_smart_regular
route_list = !+local_domains "${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}}"
# route_list = * "${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}}"
@TRANSPORTEND@
@TRANSPORTMIDDLE@
@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}}
-
Oh, geez. I think I just saw the potential issue when I hit "post." This is probably the line I need to remove: ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 111.222.333.111 Sound right? Beth 0 -
Well, I'm replying to say that commenting out the ignore didn't give the anticipated results. I'm open for suggestions! Thanks, Beth 0 -
Hello, The following cPanel forums thread may help: Forward certain domain emails to Smart Host Additionally, you may find the following third-party URL helpful: Make Exim deliver local mail externally Let us know if this helps. Thank you. 0
Please sign in to leave a comment.
Comments
3 comments