Yes, it is possible to change the outgoing mail server (SMTP) IP address in WHM.
By default, outgoing emails from any Mail server will be sent from the server's shared/primary IP address.
Exim is a Mail Server and it comes with WHM/cPanel as a default Mail Server.
If you don't want to take any chance that recipient mail servers or spam filters mark your email as spam, you should have the rDNS record for your mail domain or server's hostname which points to the Exim's outgoing IP address.
There are two ways to change the outgoing mail server IP address.
- Automatic Configure Exim Outgoing IP address:
This will configure the Exim mail server to send emails from each domain's dedicated IP address.
First, change the rDNS records for each server's IP address to point to the relevant domain.
Login to the WHM panel.
Go to Exim Configuration Manager under the Service Configuration option.
Home -> Service Configuration -> Exim Configuration Manager
Search the 'Send mail from the account’s IP address feature in the Basic Editor section under the Exim Configuration Manager.
Enable that feature to enable automatic outgoing IP configuration.
- Manually Configure Exim Outgoing IP address:
This will allow you to custom changes in the Exim configuration.
First, you require to enable the following settings in the Basic Editor section under Exim Configuration Manager.
+ Reference /etc/mailhelo for outgoing SMTP HELO
+ Reference /etc/mailips for outgoing SMTP connections
Now, connect to your server through SSH.
Create a /etc/mailhelo file and add your domains and hostname as per the following example.
The mailhelo file holds the data of Exim's configuration for the HELO command.
1 example.com: example.com
2 sub.example.com: example.com
3 example.net: example.net
4 addon.example.net: example.net
5 *: hostname.example.com
Create a /etc/mailips file and add the outgoing IP address of each domain as per the following example.
You can assign the dedicated IP address to any of your domains. The mailips file holds the IP address from each domain that sends the email.
The * symbolizes the other domains.
Once you modify/create both files above, Save and Exit from the server.