Exim conf for forcing smarthost even for local delivery

unco

Active Member
Jun 17, 2010
35
6
58
Southern Pines, NC
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

Code:
@[email protected]

@[email protected]

@[email protected]
daemon_smtp_ports = 465 : 587 : 25
hostlist smart_hosts = lsearch;/etc/smarthosts

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]

@[email protected]
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}}"

@[email protected]

@[email protected]

@[email protected]
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}}
 

unco

Active Member
Jun 17, 2010
35
6
58
Southern Pines, NC
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