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.
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:
remote_smtp: 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.
How to change interface IP in SendMail
To change the mail server IP in Sendmail, the file to be edited is
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/sendmail.mc > /etc/mail/sendmail.cf
Restart Sendmail for the new update to take effect:
service sendmail restart
It is also possible to edit the configuration file sendmail.cf 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.
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.