In this guide, I will set up an email relay on WHM/cPanel to smtp2go.com
I choose smtp2go to register for free mail relay service because their free plan supports:
- 5 domains
- 1,000 emails/day
Register on smtp2go
Register for a free account on smtp2go and after activating the account navigate to Settings > SMTP Users and create a new user that will be used for sending emails.
Save those login details for the next step.
Under Settings > Verified Senders add your domain or email address from which the emails will be sent:
If you selected a single email address, click on the verification link sent to it:
Configure Email Relay on WHM/cPanel
Go to WHM > Service Configuration > Exim Configuration Manager > Advanced Editor
Find Section: AUTH and add the following:
mail_login:
driver = plaintext
public_name = LOGIN
client_send = :UserRelay:PasswdRelay
UserRelay is the username and PasswdRelay is the password created in step 1 on smtp2go.
Find Section: POSTMAILCOUNT or Section: ROUTERSTART and edit only one of them!
remoteserver_route:
driver = manualroute
transport = mail_smtp
domains = !+local_domains
route_list = * mail.smtp2go.com::587 randomize byname
Find Section: TRANSPORTSTART and in it add:
mail_smtp:
driver = smtp
hosts_require_auth = *
tls_tempfail_tryclear = true
headers_add = X-AuthUser: ${if match {$authenticated_id}{.*@.*}\
{$authenticated_id} {${if match {$authenticated_id}{.+}\
{$authenticated_id@$primary_hostname}{$authenticated_id}}}}
After adding all the information, don’t forget to click on the Save button at the bottom and if the Exim server resets successfully, you have configured Email Relay and can check sending and receiving emails via the Relay system.
Test (and retest) emails
Create a new email account and test sending emails from it:
If everything is okay you will receive the email via smtpservice.net
Change Exim retry interval (optional)
I recommend changing the Exim delivery retry interval under Section: RETRYSTART
* data_4xx F,4h,1m
* rcpt_4xx F,4h,1m
* timeout F,4h,1m
* refused F,1h,5m
* lost_connection F,1h,1m
* * F,6h,5m
Edit /etc/default/exim or /etc/sysconfig/exim and set:
QUEUE= 60s
Change the maximum number of concurrent users in the queue in/etc/exim.conf
queue_run_max = 50
and restart Exim to apply changes.