I had been having a problem with one of my cPanel servers where Exim was sending outbound email from one of the IP’s dedicated to a hosting account, rather than from the primary IP address of the server. This problem was completely baffling to me as all of the research I had done on setting the outbound IP address within Exim on cPanel indicated that mine was configured to use the default IP address. I did not want to manually configure it to choose the primary, and wanted it to automatically choose the correct IP address.
Before believing you might have the same problem as I had, please be sure to check the cPanel references about configuring Exim to send out of a custom/specified IP address. Be sure that you don’t have an Exim configuration issue first.
What I discovered was that I had a problem in the configuration of the subnet mask of the additional IP addresses of the server. The problem began when I altered my subnet from a /25 to a /24. I had gone into the /etc/sysconfig/network-scripts/ifcfg-eth0 file and modified the PREFIX=25 to be PREFIX=24. This was all fine and dandy and everything came online upon a reboot.
However, the additional IP’s still had their subnet mask (or prefix) set to be /25. Somehow, this resulted in Exim using the next IP address in the list of IP’s for outbound email.
In the following example, I have replaced my IP’s with a private subnet (192.168) as an example to show what I changed.
Original Configuration of /etc/ips
Modified Configuration of /etc/ips
Once I modified all of the add on IP’s to be /24 instead of /25 (.0 instead of .128 and .255 instead of .127) with the above change and rebooted, Exim began sending email out the correct/default IP address of the server.
I hope this is useful information to someone.