How To Change the Outgoing Mail Server(SMTP) IP Address in WHM?

This article will guide you to change Outgoing Mail Server IP in WHM.

By default, outgoing emails from any Mail server are sent from the server’s shared/primary IP address. The dafault mail server of WHM/cPanel is Exim.

If you don’t want to take any chance that the 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 in WHM.

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.

  1. Login to the WHM panel.
  2. Go to Exim Configuration Manager under the Service Configuration option.
    Exim Configuration manager in whm
  3. Search the Send mail from the account’s IP address feature in the Basic Editor section under the Exim Configuration Manager.
    sender mail from account IP in whm
  4. Enable that feature to send mails from cPanel account IP address.

Manually Configure Exim Outgoing IP address:

This allows you to make custom changes in the Exim configuration.
First, you are required to enable the following settings in the Basic Editor section under Exim Configuration Manager.

+ Reference /etc/mailhelo for outgoing SMTP HELO
custom smtp helo in capnel 1

+ Reference /etc/mailips for outgoing SMTP connections
custom smtp helo in capnel 2

Now, connect to your server through SSH and create a /etc/mailhelo file, and add your domains and hostnames as per the following example.
The mailhelo file holds the data of Exim configuration for the HELO command.

  5. *:

Now, create a /etc/mailips file and add the outgoing IP address of each domain as per the following example.You can assign a dedicated IP address to any of your domains. The mailips file holds the IP address from each domain that sends an email.
The * symbolizes the other domains.

custom smtp helo in capnel 3

Once you modify/create both the files as above, Save and Exit from the server.

If you enjoyed this tutorial, then you would love our support! All Kemuhost hosting plans include 24/7 support from our amazing support team. Check out our web hosting plans and have your website migrated for free today!

Add a Comment

Your email address will not be published. Required fields are marked *