Set up SMTP relay with DirectAdmin

Estimated reading time: 1 min


If you want or need to setup your mailserver to send all outgoing mail to a specific server which will handle the delivery to the recipients you need to setup a SMTP relay or smarthost.


  • You need to know the hostname of the SMTP server which is going to relay the mail for your mailserver, which is in our case
  • This article assumes that no authentication is necessary on the SMTP relay server
  • This article is written for DirectAdmin with Exim
  • You need to be running exim.conf 4.5.7 or newer, please see this article if you need to update
  • You need to have the SSH login details of your server ready

Step 1: Log in with SSH

Log in as root. Please see this article for instructions if you don’t know how to connect.

Step 2: Configure the MTA

Copy/paste complete command:

cat <<'EOF' > /etc/exim.routers.pre.conf
  driver = manualroute
  domains = ! +local_domains
  ignore_target_hosts =
  condition = "${perl{check_limits}}"
  transport = remote_smtp
  route_list = !+local_domains

Step 3: Restart the mailserver

Restart the mailserver by issuing the following command:

service exim restart


Congratulations, you have successfully setup SMTP relay / smarthost with DirectAdmin.

Was this article helpful?
Dislike 1
Views: 5167

Reader Interactions


Leave a Reply

Your email address will not be published. Required fields are marked *