To configure cPanel to utilize the Sendmetric smarthost you will need to login to WHM and go to the Exim Configuration Manager. Then select the Advanced Editor and make the changes below. 

Before doing this make sure to go the Backup tab and save a backup copy of your Exim configuration in case you have problems.


Section: AUTH


Go to this section in the advanced editor and enter the information below in the text area. Make sure to replace the username and password with the SMTP user that you added. For more information on adding a user see the Getting Started Guide.


#SENDMETRIC_AUTHENTICATORS_START

sendmetric_login:
  driver = plaintext
  public_name = LOGIN
  client_send = : username : password

#SENDMETRIC_AUTHENTICATORS_STOP


Section: POSTMAILCOUNT


In this section add the information below in the text area:


#SENDMETRIC_POSTMAILCOUNTSTART

remoteserver_route:
driver = manualroute
transport = sendmetric_smtp
domains = !+local_domains
route_list = * smtp.sendmetric.com::25 randomize byname

#SENDMETRIC_POSTMAILCOUNTSTOP



Section: TRANSPORTSTART


In this section you have two different options. The first entry shows a configuration without DKIM and the second one shows a configuration with DKIM. Choose one only and use it as your configuration. Please ensure there are no line breaks when copying and pasting the below into cPanel:



Option 1) Copy and paste from below:


#SENDMETRIC_TRANSPORTSTART

sendmetric_smtp:
driver = smtp
hosts_require_auth = *
tls_tempfail_tryclear = true
headers_add = X-AuthUser: ${if match {$authenticated_id}{.*@.*}\
{$authenticated_id} {${if match {$authenticated_id}{.+}\
{$authenticated_id@$primary_hostname}{$authenticated_id}}}}

#SENDMETRIC_TRANSPORTSTOP



Option 2) Copy and paste from below:

#SENDMETRIC_TRANSPORTSTART

sendmetric_smtp:
driver = smtp
hosts_require_auth = *
tls_tempfail_tryclear = true
headers_add = X-AuthUser: ${if match {$authenticated_id}{.*@.*}\
{$authenticated_id} {${if match {$authenticated_id}{.+}\
{$authenticated_id@$primary_hostname}{$authenticated_id}}}}
dkim_domain = ${perl{get_dkim_domain}}
dkim_selector = default
dkim_canon = relaxed
dkim_private_key = "/var/cpanel/domain_keys/private/${dkim_domain}"

#SENDMETRIC_TRANSPORTSTOP


Once you make the changes above, scroll to the bottom of the advanced editor and click 'Save'. Verify the Exim service restarts correctly and you are ready to use the Sendmetric service.


SPECIAL NOTE ON DKIM: We encourage using the DKIM option, however please keep in mind if your domains do not have a proper SPF record referencing our service and do not have a DKIM record in their DNS, messages that are DKIM signed will fail to providers such as Gmail.