Exim Username-Based Authentication (DirectAdmin)

  1. Ensure the outgoing authenticating user is added in the Spam Experts systems my following the instructions to Add an Outgoing User/Authentication Method
  2. Ensure the outgoing user has appropriate limits set to match your traffic volumes
  3. Open the Exim configuration file /etc/exim.conf
  4. Add the following to the Routers section after Begin Routers:
  5. spamexperts_smarthost_router:
    driver = manualroute
    domains = ! +local_domains
    ignore_target_hosts = 127.0.0.0/8
    condition = "${perl{check_limits}}"
    # Exclude null sender messages from relaying via the smarthost
    condition = ${if or {{!eq{$sender_address}{}} {!eq{$sender_host_address}{}}}}
    headers_add = ${if !eq{$original_domain}{$domain}{X-Forwarded-For: $original_local_part@$original_domain}}\n\
    X-AuthUser: $authenticated_id
    headers_add = X-AuthUser: $authenticated_id
    transport = spamexperts_smarthost_transport
    route_list = $domain SMARTHOST::587
    no_more

  6. Depending on the configuration, you may have to comment "lookuphost:" router
  7. Add the following to the Transports section after Begin Transports:
  8. spamexperts_smarthost_transport:
    driver = smtp
    # In-case your server continues to send outgoing over port 25 please add the below line
    port = 587
    hosts_require_tls = SMARTHOST
    hosts_require_auth = *

    Where SMARTHOST is smtp.antispamcloud.com or as otherwise detailed here.

  9. Add the following to the Begin Authenticators section:
  10. spamexperts_login:
    driver = plaintext
    public_name = LOGIN
    client_send = : username@example.com : yourUserPassword

  11. Restart Exim
  12. If you are signing with DKIM on your Direct Admin server you may need to add the following line under hosts_require_tls
  13. .include_if_exists /etc/exim.dkim.conf