How to setup AWS SES mail relay on WHM/Cpanel Exim
cPanel is a very popular web hosting control panel. Since many websites are hosted on the same server in WHM. All email is sent by a single IP. If one of the domains hosted on the same server sends the spam which reflects the reputation of IP on all domains hosted on the same server. Some of the cloud providers like AWS initially block port 25 which is very hard to disable the email sending restriction. So the best solution is to implement a smart host third party SMTP to send the email from Cpanel mail.
Setup AWS SES mail relay on WHM
This comprehensive guide helps to set up your AWS SES server as the Outgoing SMTP Server in cPanel & WHM with Exim.
Before starting to change on Exim Configuration. We recommend backing your Exim configuration from the backup section.
Step 1: Login to your cPanel & WHM Admin Panel as Administrator. Go to Home > Service Configuration > Exim Configuration Manager.
Step 2: Click on Advanced Editor.
Step 3: Go to Section: AUTH and add below lines of code:
auth_login: driver = plaintext public_name = LOGIN client_send = : USERNAME : PASSWORD
Note: Use username and password from AWS SES dashboard as the screenshot is shown below:
Step 4: Go to Section: ROUTERSTART and add below lines of code:
smart_route: driver = manualroute domains = ! +local_domains ignore_target_hosts = 127.0.0.0/8 transport = auth_relay route_list = * email-smtp.ap-south-1.amazonaws.com No_more
Note: Above route_list is SMTP endpoint it differs based on the AWS SES account region.
Step 5: Go to Section: TRANSPORTSTART and add below lines of code:
auth_relay: driver = smtp port = 587 hosts_require_auth = $host_address hosts_require_tls = $host_address
In this way, you can set up AWS SES mail relay on WHM/cPanel briefly. Importantly, you don’t have to validate domains in your cPanel, SES does it for you. The implementation allows all of the emails routed through the AWS SES service. That’s all in this blog. If you face any issues while setting up don’t forget to share your feedback with CloudLaya.