Linode.com Forum Forum Index Linode.com Forum
Linode Community Forums
 


Blocking SMTP connection automatically

Click here to go to the original topic

 
       Linode.com Forum Forum Index -> Email/SMTP Related Forum
Author Message
komy



Joined: 13 Aug 2003
Posts: 27

Posted: Sun Feb 27, 2005 12:23 pm    Post subject: Blocking SMTP connection automatically  

Hi,

I am running exim on my lindoe and I am seeing a lot of spammer trying to send emails to non-existing address; and some are trying to send many emails at a time.

I am wondering, in general, is there any way that I can automatically block such bad IP's SMTP connections from iptables? Ie: automatically create an iptable rule on the mail port when XX amounts of bad connections on exim are found.

Thanks for help.

Kevin
Back to top  
SteveG



Joined: 30 Nov 2003
Posts: 220

Posted: Sun Feb 27, 2005 3:54 pm    Post subject:  

Yes, you can. Google for "iptables automatic rules" and variants, and you'll turn up scripts that you can use or adapt.

As a side note, are you already using a DNS Blacklist? If not, start: it will help a lot with this kind of stuff, possibly to the point where you don't feel the need for your own. Spamhaus (www.spamhaus.org) runs a good one, but there are dozens.
Back to top  
pclissold



Joined: 24 Oct 2003
Posts: 471
Location: Netherlands

Posted: Sun Feb 27, 2005 4:52 pm    Post subject:  

spamhaus.org and spamcop.net together take care of 90% of this crap.

I stop a lot of the rest by rejecting connections from IP addresses for which I cannot successful lookup the host name. You have to whitelist this if you have legitimate senders who cannot / will not set up their mail systems correctly.

Auto written firewall rules can leave you vulnerable to a DoS attack using forged IP headers unless the 'rules for writing the rules' are chosen very carefully.
Back to top  
komy



Joined: 13 Aug 2003
Posts: 27

Posted: Sun Feb 27, 2005 10:17 pm    Post subject:  

Thanks for all the suggestions... and yes, I am already using multiple DNS blacklists on my linode. Even with the blacklist, I still see a lot of connection trying to send email to non-existing account. I've already have setting to bounce all those emails, but just want to see if there is any easy way to drop those connection on the iptables layer as well.

Thanks,
Kevin
Back to top  
 
       Linode.com Forum Forum Index -> Email/SMTP Related Forum
Page 1 of 1