As is well known, sending mail problems from servers due to IP addresses being blacklisted are among the frequently experienced issues. In such cases, the first priority is
to solve the problem permanently and prevent IP addresses from being listed. However, if email is important to you and you need an immediate solution, you will need to change the mail outbound IP address on the server. Now let’s briefly look at how to do this.
Exim Configuration Setting
If you want every site on your server to send mail through the IP address it runs on, you can do this with the “Send mail from account’s dedicated IP address” setting in the Exim Configuration Manager. Setting this to “On” means every site on the server will send
mail through the IP address it runs on. If the sites on the server are distributed across different IP addresses in certain proportions, this is a convenient method. If you want all sites on the server to send mail only through the IP address you specify, you need to
set this option to “Off”.

/etc/mailips Setting
If you want mail to be sent out through the IP address you specify, you do this in the /etc/mailips directory on the server. This operation is performed as follows.
nano /etc/mailipsRun this command to open the file. If the setting we just mentioned above in Exim Configuration Manager is in the “On” position, when the file opens you can see the domain names on the server and the IP addresses from which they send mail, listed in order. If the
mentioned setting is “Off” and no setting has been made in this file before, you will see a blank black page. We can edit the contents of this file as follows.

As you can see in the example image, two different pieces of data have been entered in the file.
- On the first line, the mail sending IP address for domainname.com has been set to 192.168.2.90. In this case, only this site on the server will send mail using this IP address.
On the second line, a data entry of ”*” has been made with a different IP address written next to it. In this case, all other sites on the server will send mail using this IP address.
With these two settings, we use one IP address for mail outbound for one of our sites while using a different IP address for all other sites on the server. You can edit the contents of this file as you wish for your own server, making it look like the example
image. If you want to set this manually, don’t forget to set the setting in the Exim Configuration Manager to “Off”. After completing the operations, save and exit the file, then restart the exim service.
Finally, I think it’s worth reminding you. If you don’t want the changes you’ve made to be reset for any reason, I recommend locking the file. You can do this with the following command.
chattr +iA /etc/mailips
Leave a Comment
* Your comment will be published after approval.
Comments
0No comments yet. Be the first to comment!