1. Knowledge base
  2. E-mail
  3. Set up SMTP relay with cPanel

Set up SMTP relay with cPanel

Updated on 8 August 2023 2 min read Snel.com support team

Introduction

If you want or need to set up your mail server to send all outgoing mail to a specific server that will handle the delivery to the recipients you need to set up an SMTP relay or smarthost.

Prerequisites

  • You need to know the hostname of the SMTP server which is going to relay the mail for your mail server, 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 cPanel with Exim
  • You need to have the login details of WHM ready

Login on WHM

Go to https://x.x.x.x:2087 (replace x.x.x.x with the IP address of your server).

Add SPF include host

Within WHM navigate to: Main > Service Configuration > Exim Configuration Editor, in the Basic Editor search for “SPF include hosts for all domains on this system” and change the setting from “None” to `_spf.smtprelay.snel.com`. Click on “Save” at the bottom.

Configure the MTA

On the same page (Main > Service Configuration > Exim Configuration Editor), click on the Advanced Editor button and search on the page for “Section: POSTMAILCOUNT” and add the following:

Code
smart_route:  driver = manualroute  domains = ! +local_domains  ignore_target_hosts = 127.0.0.0/8  transport = dkim_remote_smtp  route_list = * smtprelay.snel.com::587  no_more

If “Section: POSTMAILCOUNT” is not available proceed to step 4, otherwise proceed to step 5.

IF “Section: POSTMAILCOUNT” is not available

On the same page search for “Section: ROUTERSTART” and add the following:

Code
smart_route:  driver = manualroute  domains = ! +local_domains  ignore_target_hosts = 127.0.0.0/8  transport = dkim_remote_smtp  route_list = * smtprelay.snel.com::587  no_more

Save changes

Click on the “Save” button on the bottom of the page to save changes and restart the mail server to apply the new configuration.

Conclusion

Congratulations, you have set up an SMTP relay for your mail server.

Was this article helpful?

Spot a mistake in this article? Email us at support@snel.com

This article was last checked on 8 August 2023. · 34,878 views

Your own VPS online within 2 minutes

Windows or Linux, root access and hosted in Rotterdam.

View VPS from € 6.99

Support

Can't figure it out? We are happy to help

You always talk to a real engineer. We typically respond within 15 to 30 minutes, and 24/7/365 for outages.

Call us

+31 88 3 088 099

Create a ticket

Through the client area we immediately see which service it is about.

Email us

Send your question via the contact form, also outside office hours.