Skip to main content
This guide walks you through configuring Exim on a DirectAdmin server to relay all outbound mail through MailChannels Outbound Filtering.

Prerequisites

  • Root or sudo access to your DirectAdmin server
  • Your MailChannels SMTP username and password

Exim 4.5.7 and later

1

Create the router configuration

Create /etc/exim.routers.pre.conf with the following content:
/etc/exim.routers.pre.conf
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.mailchannels.net::25
  no_more
2

Create the transport configuration

Create /etc/exim.transports.pre.conf with the following content:
/etc/exim.transports.pre.conf
auth_relay:
  driver = smtp
  headers_add = X-AuthUser: $authenticated_id
  hosts_require_auth = $host_address
  hosts_require_tls = $host_address
The X-AuthUser header identifies the authenticated sender. MailChannels uses it to track per-sender reputation. Messages without this header are treated as forwarded mail and subject to different policies.
3

Create the authenticator configuration

Create /etc/exim.authenticators.post.conf with the following content, replacing the placeholders with your actual MailChannels SMTP credentials:
/etc/exim.authenticators.post.conf
auth_login:
  driver = plaintext
  public_name = LOGIN
  hide client_send = : smtpusername : smtppassword
4

Restart Exim

service exim restart

Exim prior to 4.5.7

Exim versions prior to the current major release are considered obsolete by the Exim development team. Upgrading to a current release is strongly recommended.
With older DirectAdmin installations, Exim configuration is stored in a single file at /etc/exim.conf. Make the following changes to that file.
1

Add the authenticator

In the begin authenticators section, add the following block, replacing the placeholders with your actual MailChannels SMTP credentials:
/etc/exim.conf
auth_login:
  driver = plaintext
  public_name = LOGIN
  hide client_send = : smtpusername : smtppassword
2

Add the router

At the top of the begin routers section, add the following block:
/etc/exim.conf
send_via_mailchannels:
  driver = manualroute
  domains = ! +local_domains
  senders = !*@domain1.to.exclude.com : !*@domain2.to.exclude.com
  ignore_target_hosts = 127.0.0.0/8
  condition = "${perl{check_limits}}"
  transport = auth_relay
  route_list = * smtp.mailchannels.net
  no_more
If you do not need to exclude any senders or domains from the relay, leave the senders = line blank or remove it entirely.
Do not remove or comment out the lookuphost: router. It handles delivery for any domains excluded from the MailChannels relay and routes them directly from the DirectAdmin server.
3

Add the transport

In the begin transports section, add the following block:
/etc/exim.conf
auth_relay:
  driver = smtp
  port = 25
  headers_add = X-AuthUser: $authenticated_id
  hosts_require_auth = $host_address
  hosts_require_tls = $host_address
4

Restart Exim

service exim restart