Allow SMTP Relay in cPanel / WHM

Allow SMTP Relay in cPanel / WHM

To allow sending emails from another server (to use your server as a relay), you need to allow access to that IP address.

Step 1. Whitelist IP address on the firewall

csf -a IP-HERE

Step 2. Add IP address to Exim Configuration

Navigate to WHM > Exim Configuration Manager and under Basic Editor locate

  • Trusted SMTP IP addresses
  • Sender verification bypass IP addresses

Add your IP to both of them, save changes and restart Exim.

image 9 1024x536 - Allow SMTP Relay in cPanel / WHM

Step 3. Add IP to /etc/relayhosts

Exim uses a file /etc/relayhosts that have IP addresses of temporarily whitelisted senders. The file is dynamically generated so you shouldn’t modify it directly. Instead, create a new file /etc/alwaysrelay and add the IP address in it.

nano /etc/alwaysrelay

restart Exim and check if the added IP is included in /etc/relayhosts

cat /etc/relayhosts | grep IP-HERE
whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

1 comment
%d bloggers like this: