Select Page

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:

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.

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/sendmail.mc.

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

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1,Name=MTA')

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.

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


For as low as

$74.99/server/mo

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.

SEE SUPPORT PLANS


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 *

Bobcares
Bobcares is a server management company that helps businesses deliver uninterrupted and secure online services. Our engineers manage close to 51,500 servers that include virtualized servers, cloud infrastructure, physical server clusters, and more.
MORE ABOUT BOBCARES