Child pages
  • How to Configure the Exim Outgoing IP Address

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
stylenone

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.

Note
titleNote:

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

Modify Exim's preferences for outgoing mail

cPanel & WHM offers two ways in which you can 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.

    Warning
    titleImportant:
  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 ).

    Warning
    titleWarning:

    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

Warning
titleWarnings:
  • We do not recommend that you modify your Exim files. To send outgoing mail with each account's dedicated IP address, enable the Send mail from account's dedicated IP address option in WHM's Exim Configuration Manager interface ( Home >> Service Configuration >> Exim Configuration Manager ).
  • To modify your Exim configuration files, you must have root user privileges.
  • If you enable the Send mail from account's dedicated IP address option, it will overwrite any changes that you make in the Exim configuration files.

To use a custom Exim configuration, enable the following options in the Basic Editor section of WHM's Exim Configuration Manager 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, 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:

Code Block
languagebash
linenumberstrue
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.

Warning
titleWarning:

If you enable the Send mail from account's dedicated IP address setting in the Basic Editor section of WHM's Exim Configuration Manager interface (Home >> Service Configuration >> Exim Configuration Manager), the system will overwrite any manual changes that you subsequently make to the /etc/mailhelo and /etc/mailips files.

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

Expand
titleClick to view IPv4 example
Code Block
languagebash
linenumberstrue
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
Note
titleNotes:
  • 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.
Expand
titleClick to view IPv4 and IPv6 example
Code Block
languagebash
linenumberstrue
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
Note
titleNotes:
  • 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

Localtab Group
Localtab
activetrue
titleSuggested documentation

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("email","exim") and label = "whm" and space = currentSpace()

Localtab
titleFor cPanel users

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("email","exim") and label = "cpanel" and space = "ALD"

Localtab
titleFor WHM users

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("email","exim") and label = "whm" and space in (currentSpace(),"ALD")

Localtab
titleFor developers

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("email","exim") and space = "SDK"