Back to Top

Help & Support

Get instant answers 24/7

Top > Outbound Filtering > Routing outbound email from dedicated mail server through SpamHero

Setup Exim to Relay Outbound Messages Through SpamHero

Before using the outbound system, you must enable outbound for either "quarantine users and account contacts" or "smart host relay," in the Outbound > Outbound Settings tab:

https://www.spamhero.com/cp2/outbound/settings

cPanel-Specific Setting Change:
Under Exim Configuration Manager -> Basic Editor -> Mail Tab: Change "Smarthost support" from "default" to:

Note: This only applies to cPanel. Also, routing through SpamHero works even without changing this value, but there may be some benefit to enabling it.

To setup your Exim mail server to relay outbound emails through SpamHero, here are some steps to implement:

  • Make a backup copy of your current exim.conf file
  • Edit the exim.conf file, and add the following settings
  • Under the ROUTER section, add this block of text (Note: this should be the first router listed in this section!):

spamhero_route:
  driver = manualroute
  domains = ! +local_domains
  transport = spamhero_relay
  route_list = *

  • Under the TRANSPORT section, add this block of text:

Note: For DKIM to work, you might need to add the four lines at the bottom. The path is specific to cPanel, but it could be made generic by having the user include the path to their domain_keys private keys folder.

Note: If using cPanel’s Exim Configuration Manager (Advanced Editor), this block of text goes in the section called TRANSPORTSTART.

spamhero_relay:
  driver = smtp
  port = 25
  hosts_require_auth = 

  hosts_require_tls = 

  # DKIM Settings
  dkim_domain = ${lc:$sender_address_domain}
  dkim_selector = default
  dkim_private_key = "/var/cpanel/domain_keys/private/${dkim_domain}"
  dkim_canon = relaxed

  • Under the AUTHENTICATION section, add this block of text, but use your valid username & password (you might want to configure the SmartHost password, under the Outbound > Smart Host Setup tab, and simply use your domain name for the username):

Note: If using cPanel’s Exim Configuration Manager (Advanced Editor), this block of text goes in the section called “AUTH”.

spamhero_login:
  driver = plaintext
  public_name = LOGIN
  hide client_send = : user@domain.com : password

  • Restart Exim
Last updated January 8, 2021