Call Us! [visitorlocation]
Call Us! [visitorlocation]

Need Help?

Our experts will login to your server within 30 minutes to fix urgent issues.

We will keep your servers stable, secure and fast at all times for one fixed price.

How to fix Amazon EC2 IP blacklisting in Spamhaus PBL and other email RBLs

How to fix Amazon EC2 IP blacklisting in Spamhaus PBL and other email RBLs

Amazon claims to have a system to white-list all their IP addresses at Spamhaus regularly. But we still see Amazon EC2 users reporting mail issues due to IP blacklists by Spamhaus.

IP blacklisting occur when your mail server gets compromised due to any malware or open vulnerabilities. Attackers can hijack your mail server and send spam mails from it.

Once the IP address is blacklisted for spamming by Spamhaus and other anti-spam lists, getting it delisted is a time consuming process. Having no email service for days or weeks can badly affect your business.

In such cases, the immediate action required is to stop the spamming and change the mail server IP address to a new Elastic IP. Here we’ll discuss how to change mail interface IP in 3 popular mail servers.

Read: Blocking spoofed mails going out of your cPanel/WHM web hosting server

How to change interface IP in Exim

If you are using exim mail server, it is easy to change the interface IP. The exim.conf file has to be checked for the section:

driver = smtp

and under that, add the line:

interface = ip address

After updating the desired IP address, exim server has to be restarted:

service exim restart

To confirm the IP change, the exim log file and email headers should be examined.

Read: How we fixed a massive “open relay” spamming in Exim mail server

How to change interface IP in SendMail

To change the mail server IP in Sendmail, the file to be edited is /etc/mail/

The following entry in the file has to be edited with the desired IP address in the ‘Addr’ section:


After editing, the new configuration file is generated using the m4 macro processor:

m4 /etc/mail/ > /etc/mail/

Restart Sendmail for the new update to take effect:

service sendmail restart

It is also possible to edit the configuration file directly and make this change. But this is has to be done by experts, as it can end up breaking the mail server if not done right.

Read: AWS Port 25 block – Why does it happen and how to fix it?

For as low as


Get full spectrum infrastructure management services - including setup, monitoring & maintenance.

Never again face a critical business downtime. We keep your servers secured, optimized and updated at all times. Our engineers monitor your servers 24/7 and fix issues before it can affect your customers.


Bobcares provides Outsourced Hosting Support for online businesses. Our services include Outsourced Web Hosting Support, Outsourced Server Support, Outsourced Help Desk Support, Outsource Live Chat Support and Phone Support Services.

Submit a Comment

Your email address will not be published. Required fields are marked *