Changing the Sending IP for Outbound Email in Exim
For WHM version 11.28
You can manually specify from which IP addresses specific domains on your server should send mail with Exim. To do so, you will need to create and edit 2 files from the command line and disable one option in WHM's Exim Configuration Editor
You will need to have root
privileges on the server to configure Exim in this way.
Configuring Exim from WHM
In order to specify which IP address should handle outbound mail, you will need to disable an option in WHM's Exim Configuration Editor
. You can find the Exim Configuration Editor
in the Service Configuration
section of WHM. To begin, navigate to the configuration editor and disable the following option:
- Automatically send outgoing mail from the account's IP address instead of the main IP address.
By default, Exim will send mail from the server's main shared IP address. Enabling this option forces your users to send mail from their main domain's IP address. If you choose to enable the option listed above, you will not
be able to manually specify the IP addresses from which the domains send mail. This option uses /scripts/updateuserdomains
to automatically populate /etc/mailhelo
Creating and Editing the Appropriate Files
In order to specify IP addresses, you will need to create and edit 2 files from the command line. The files are:
- /etc/mailhelo — Exim's
HELO command's configuration file.
- /etc/mailips — The file that specifies from which IP addresses mail should be sent.
EXIM uses the
command to initiate dialog between a mail server and a client. This file governs which domain should send the
command. To create this file, you will need to use a text editor such as nano
, or vim
. Once you have created and opened the file for edit, you will need to configure it in the following way:
In the example above, the asterisk (
) entry will be used to direct outbound mail for domains without entries within this file. The domain in this context should be your server's hostname.
Be sure to use only valid domain names that are publicly accessible via the Internet.
This file controls the IP address from which each domain should send mail. You will, as in the example above, need to create and open the /etc/mailips
file for editing using your preferred text editor. You will need to configure this file in the following way:
In the example above, the asterisk (*) entry will be used to direct outbound mail for domains without entries within this file. In this case, this should be your server's main shared IP address.
Be sure to use only valid IP addresses that are publicly accessible via the Internet.