Overview

By default, Exim sends mail from the server's primary IPv4 address. To decrease the chance that spam filters mark your mail as spam, verify that the reverse DNS (rDNS) entry of Exim's outgoing IP address matches the DNS response of your server's hostname.

The steps in this document require root-level privileges on the server.

Modify Exim's preferences for outgoing mail

cPanel & WHM offers two ways by which to modify Exim's default preferences for outgoing mail's IP address.

Enable automatic configuration of the server's IPv4 address for outgoing mail

To automatically configure Exim to send mail from each domain's dedicated IPv4 address, perform the following steps:

  1. Modify the rDNS for each IPv4 address to point to the desired domain.


  2. 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


Manually configure Exim's outgoing IP addresses

  • We do not recommend that you modify your Exim files.
  • To modify your Exim configuration files, you must possess root-level privileges.

To use a custom Exim configuration, you must enable the following options in the Basic Editor section of WHM's Exim Configuration Manager interface (Home >> Service Configuration >> Exim Configuration Manager):

  • If you disable the Reference /etc/mailhelo for outgoing SMTP HELO setting, the system will overwrite any changes that you make to the /etc/mailhelo file.
  • If you disable the Reference /etc/mailips for outgoing SMTP connections setting, the system will overwrite any changes that you make to the /etc/mailips file.

The /etc/mailhelo file

The /etc/mailhelo file contains Exim's configuration for the HELO command, which initiates dialog between a mail server and a client. This file governs which domain sends the HELO command.

Use your preferred text editor to create an /etc/mailhelo file that resembles the following example:

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

The /etc/mailips file controls the IP address from which each domain sends mail.

Use your preferred text editor to create an /etc/mailips file that resembles one of the following examples:


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 uses the asterisk (*) entry to direct outbound mail for domains without entries within this file. In this case, this is your server's main shared IPv4 address. You can set this value to another IP address if you ensure that the asterisk entry in the /etc/mailhelo file uses the appropriate domain name.
  • Only use valid, publicly-accessible IP addresses.
  • Do not separate multiple IP addresses with commas. Instead, use semi-colons.




example.com: 192.168.0.2
sub.example.com: 192.168.0.2
example.net: 201:db8::2:1
addon.example.net: 201:db8::2:1
*: 192.168.0.1


  • In the example above, the system uses a double colon (::) to indicate a collapsed section. However, IPv6 addresses cannot contain more than one double colon. For more information, read our Guide to IPv6 documentation.
  • Only use valid, publicly-accessible IP addresses.
  • Do not separate multiple IP addresses with commas. Instead, use semi-colons.


Additional documentation