The DirectAdmin instructions below are based on their smarthost documentation. Prior to using the instructions below, please make sure you backup each of the files that you are replacing content for described below. Modify the files below with the content and restart exim. REMEMBER TO REPLACE 'username' and 'password' with the credentials for the user you created for Sendmetric.
/etc/exim.authenticators.post.conf
auth_login: driver = plaintext public_name = LOGIN hide client_send = : username : password
/etc/exim.transports.pre.conf
auth_relay: driver = smtp port = 25 hosts_require_auth = $host_address hosts_require_tls = $host_address headers_add = "${if def:authenticated_id{X-AuthUser: ${authenticated_id}}}" interface = <; ${if exists{/etc/virtual/domainips}{${lookup{$sender_address_domain}lsearch*{/etc/virtual/domainips}}}} helo_data = ${if exists{/etc/virtual/helo_data}{${lookup{$sending_ip_address}iplsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}}{$primary_hostname}} hosts_try_chunking = hosts_try_fastopen = .include_if_exists /etc/exim.dkim.conf auth_relay_forward: driver = smtp port = 25 hosts_require_auth = $host_address hosts_require_tls = $host_address headers_add = "${if def:authenticated_id{X-AuthUser: ${authenticated_id}}}" interface = <; ${if exists{/etc/virtual/domainips}{${lookup{$sender_address_domain}lsearch*{/etc/virtual/domainips}}}} helo_data = ${if exists{/etc/virtual/helo_data}{${lookup{$sending_ip_address}iplsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}}{$primary_hostname}} hosts_try_chunking = hosts_try_fastopen = max_rcpt = 1 return_path = ${srs_encode {SRS_SECRET} {$return_path} {$original_domain}} .include_if_exists /etc/exim.dkim.conf
/etc/exim.routers.pre.conf
smart_route_forward: driver = manualroute domains = ! +local_domains ignore_target_hosts = 127.0.0.0/8 condition = ${if !eq{$original_domain}{$domain}} condition = ${if !eq{$original_domain}{}} condition = "${perl{check_limits}}" transport = auth_relay_forward route_list = * smtp.sendmetric.com no_more smart_route: driver = manualroute domains = ! +local_domains ignore_target_hosts = 127.0.0.0/8 condition = "${perl{check_limits}}" transport = auth_relay route_list = * smtp.sendmetric.com no_more
For changes to take effect, exim will need to be restarted using:
systemctl restart exim