Introduction
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.
Prerequisites
- You need to know the hostname of the SMTP server which is going to relay the mail for your mailserver, which is smtprelay.snel.com 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
Log in with SSH
Log in as root. Please see this article for instructions if you don’t know how to connect.
Configure the MTA
Copy/paste complete command:
cat <<'EOF' > /etc/exim.routers.pre.confsmart_route: driver = manualroute ignore_target_hosts = 127.0.0.0/8 condition = ${if or { \ {bool{FORCED_MX_DNS_CHECK}} \ {!match_domain{$domain}{+local_domains}} \ }} transport = ${if eq{$domain}{$original_domain} \ {remote_smtp} \ {remote_smtp_forward_transport} \ } self = pass route_list = * smtprelay.snel.com::587 no_moreEOFStep 3: Restart the mailserver
Restart the mailserver by issuing the following command:
service exim restartConclusion
Congratulations, you have successfully setup SMTP relay / smarthost with DirectAdmin.
Spot a mistake in this article? Email us at support@snel.com
This article was last checked on 10 June 2026. · 5,699 views

