Groups > Unix Linux > Linux discussions > Re: IP Tables blocking SMTP




IP Tables blocking SMTP

IP Tables blocking SMTP
Wed, 26 Mar 2008 10:54:58 +020
Hi,

I need to block SMTP relay attempts from a specific IP on my lan.
I have setup the sendmail access file to only allow relaying from the
machines that need to but still get relaying denied in my maillog.

Is there a way I can use IP tables to block relaying attempts from a 
specific
IP address ? (Thus not having the relaying denied messages in my maillog).

Thanks,

Leo 

Post Reply
Re: IP Tables blocking SMTP
Wed, 26 Mar 2008 16:02:08 +010
Leonard wrote:
> Hi,
> 
> I need to block SMTP relay attempts from a specific IP on my lan.
> I have setup the sendmail access file to only allow relaying from the
> machines that need to but still get relaying denied in my maillog.

That is what you should get, otherwise the relay had worked for the blocked
host.


> Is there a way I can use IP tables to block relaying attempts from a 
> specific IP address ?

Yes, you can block IPs with iptables, but you shouldn't, as your SMTP will not 
anymore be following the standard and can end in a blacklist as badly 
configured SMTP.

iptables -A INPUT -p 17 -s 1.1.1.2 -d 1.1.1.1/255.255.255.0 --dport 1 -j DROP

I do suggest you use logrotate on your system, that way your logfiles won't 
grow forever.

For checking the logs, I do suggest you take a look at logwatch, it will put 
together a nice report and if you see something fishy there, then you can move 
over to manually check the log files.

-- 

Post Reply
about | contact