Updated: 22 October 2026 · Applies to: Exim on a cPanel/WHM server
By default, Exim sends outgoing mail using the server's main IP address. You can change this, which is often used as a temporary workaround while a particular IP is blacklisted. This is a workaround, not a fix: you still need to find and stop whatever is generating the outgoing spam, or the new IP gets blacklisted too.
1. Turn on per-domain sending IPs in WHM
- Log in to WHM.
- Search for and open Exim Configuration Editor.
- Enable the option to send outgoing mail from the IP that matches the domain name in
/etc/mailips. - Save.
2. Map a domain to an IP in /etc/mailips
Log in to the server over SSH as root and edit the file:
vi /etc/mailips
Add a line in this form, replacing the domain and IP with your own:
example.com: 203.0.113.10
Then restart Exim:
service exim restart
3. Confirm the Exim configuration picked it up
Open the Exim configuration file:
vi /etc/exim.conf
Find the remote_smtp transport. It should already reference /etc/mailips, similar to:
remote_smtp:
driver = smtp
interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch{/etc/mailips}{$value}{}}}{}}
WHM's Exim Configuration Editor manages this file for you once the option in step 1 is enabled, so you should not normally need to hand-edit it. Save any change and restart Exim again (service exim restart) for it to take effect.