LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-12-2009, 02:30 PM   #1
jennyzon
LQ Newbie
 
Registered: Jan 2009
Posts: 1

Rep: Reputation: 0
Block all incoming mail traffic except certain addresses


hi folks,
can you please assist me in using the iptables firewall to block all incoming mail traffic (SMTP port 25) except that of a certain IP(s)? the situation is that we have a server that we only want to receive mail from a particular sender.

thanks,
jenny z.
 
Old 01-13-2009, 06:35 AM   #2
junpa
Member
 
Registered: Aug 2008
Location: Northern Hemisphere
Distribution: Slackware, OpenVMS, fbsd
Posts: 51

Rep: Reputation: 16
Code:
iptables -A INPUT -m tcp -p tcp --dport 25 -s 1.2.3.4 -j ACCEPT
iptables -A INPUT -m tcp -p tcp --dport 25 -s 1.2.3.5 -j ACCEPT
iptables -A INPUT -m tcp -p tcp --dport 25 -s 1.2.3.6 -j ACCEPT
iptables -A INPUT -m tcp -p tcp --dport 25 -j REJECT
change 1.2.3.x to the ip(s) that you want to allow.

keep in mind that this will append to your already existing
INPUT chain and can be negated by the rules above it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Incoming traffic prioritize dorian33 Linux - Networking 8 10-26-2008 05:44 AM
Sendmail: how to reject incoming spam spoofed from internal addresses krasl Linux - Server 2 03-17-2008 10:47 AM
monitoring the incoming traffic narendra.pant Linux - Networking 1 08-11-2006 04:21 PM
Allow Incoming Traffic clarence1720 Mandriva 15 12-06-2004 11:26 PM
deleted user accont in sendmail how do i block incoming mail slack66 Linux - Security 2 11-18-2003 01:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration