It is a very important topic and sys admins needs this to know how one can update or change mail server ip, usually the need to change mail server ip raise when current mail server IP get black listed and all the email start being bounced back to send with this kind of bounce.
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:
example@live.com
SMTP error from remote mail server after MAIL FROM:
<example@domai.com> SIZE=2468: host mx3.hotmail.com [207.46.8.199]: 550 OU-002 (BAY004-MC6F14) Unfortunately, messages </example@domai.com>
weren’t sent. Please contact your Internet service provider since part of their network is on our block list.
If there are more IPs are available in your system, you can assign any other ip which could be responsible for sending emails despite your current, default or main server IP, even it is best practice to run mail server through a different IP other than your main server IP, especially if you are a hosting company.
Now let us change mail server IP for our Linux and WHM based server.
Steps can be executed via command line in ssh
- Login to your server or VPS as root user.
- Run this command vi /etc/mailips.
- Click the button of keyboard i to insert your new ip Let’s suppose you have a free ip in your server as 111.222.333.444.
- Insert the new ip as *:111.222.333.444
- Then enter ZZto save the changes.
This would be the final step in ssh.
Now we will have tell exim to use our new configuration, which can be done via WHM/cPanel
Steps in cPanel to change exim IP
- Login to WHM as root
- Follow these steps Home »Service Configuration »Exim Configuration Manager then Domains and IPs then switch this option as enabled “Reference /etc/mailips for outgoing SMTP connections” and click on Save.
All you have done now, now your emails would start being sent through new ip and if your prior ip was black listed, no worries, and your all emails start being sent now through new updated IP.
Note :
Don’t forget to update rDns or PTR of new assigned IP to avoid your sent emails as junk.