cPanel WHM

Configure Exim to send outgoing mail with each account’s dedicated IP address

To enable WHM to automatically configure Exim to send mail from each domain’s dedicated IP address, perform the following steps:
You must have root user privileges on the server to configure Exim in this way.

If you manage the rDNS for your IP addresses, modify the rDNS for the IP address of each domain so that it points to that domain. If you do not manage the rDNS for your IP addresses, contact the owner of the IP addresses and request that they modify the rDNS for each IP address to point to each domain.

An incorrect rDNS configuration may cause mail servers to reject your server’s mail.

Enable the Send mail from account’s dedicated IP address option in WHM’s Exim Configuration Manager interface (Home >> Service Configuration >> Exim Configuration Manager).

If you select this option, cPanel & WHM uses the /usr/local/cpanel/scripts/updateuserdomains script to automatically configure Exim, and overrides any manual changes in the following files:


/etc/mailhelo
/etc/mailips
/etc/mail_reverse_dns  

How to manually configure Exim’s outgoing IP addresses

To use a custom Exim configuration, enable the following options in WHM’s Exim Configuration Manager – Basic Editor interface (Home >> Service Configuration >> Exim Configuration Manager):

Reference /etc/mailhelo for outgoing SMTP HELO
Reference /etc/mailips for outgoing SMTP connections
The /etc/mailhelo file

The /etc/mailhelo file contains Exim’s configuration for the HELO command. Exim uses the HELO command to initiate dialog between a mail server and a client. This file governs which domain should send the HELO command.
To create the /etc/mailhelo file, use a text editor such as nano, vi, or vim.
The following is example content of a /etc/mailhelo file:


example.com: example.com
sub.example.com: example.com
example.net: example.net
addon.example.net: example.net
*: hostname.example.com 

The /etc/mailips file
This file controls the IP address from which each domain should send mail. Your file should be similar to the following example:


example.com: 192.168.0.2
sub.example.com: 192.168.0.2
example.net: 192.168.0.3
addon.example.net: 192.168.0.3
*: 192.168.0.1

In the example above, the system will use the asterisk (*) entry to direct outbound mail for domains without entries within this file. In this case, this is your server’s main shared IP address. You can set it to another IP address if you ensure that the asterisk entry in the /etc/mailhelo file has the appropriate domain name.

Be sure to use only valid IP addresses that are publicly accessible via the Internet.

The /etc/mail_reverse_dns file
This file controls the domains that are associated with the IP addresses from which mail should send. Your file should be similar to the following example:


192.168.0.2: example.com
192.168.0.2: sub.example.com
192.168.0.3: example.net
192.168.0.3: addon.example.net