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

  1. Log in to WHM.
  2. Search for and open Exim Configuration Editor.
  3. Enable the option to send outgoing mail from the IP that matches the domain name in /etc/mailips.
  4. 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.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket