📘Send Outgoing Email from a Different Server IP (cPanel/WHM)

If you want to send outgoing emails from a different IP address than the default server IP, follow these steps in WHM and via SSH.


Step 1: Configure Exim Settings in WHM

  1. Log into WHM as root.
  2. Navigate to: Home » Service Configuration » Exim Configuration Manager – Domains and IPs
  3. Modify the following settings:
    • Send mail from the account’s IP address: Off
    • Reference /etc/mailhelo for custom outgoing SMTP HELO: On
    • Reference /etc/mailips for custom IP on outgoing SMTP connections: On
  4. Click Save and then Restart Exim when prompted.

Step 2: Create/Edit the Configuration Files

/etc/mailips

This file maps domains to the IP address to use for outgoing mail.

# cat /etc/mailips
*: 54.38.146.xxx

Replace 54.38.146.xxx with the IP address you want Exim to send mail from.

/etc/mailhelo

This file maps domains to the HELO/EHLO name to use when sending mail.

# cat /etc/mailhelo
*: example.domain.com

Replace example.domain.com with the appropriate HELO (FQDN matching the IP’s rDNS).


Step 3: Restart Exim

After editing the files, run the following command to restart Exim:

service exim restart

Done

Your server should now send outgoing email from the specified IP address using the custom HELO name.

Note: Make sure the new IP has valid PTR/rDNS, SPF, and DKIM records set up for proper mail delivery.

Scroll to Top