LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
LinkBack Search this Thread
Old 04-06-2004, 08:15 AM   #1
Zychior
Member
 
Registered: Jan 2002
Location: Northern Virginia
Distribution: Mandrake 8.1
Posts: 41

Rep: Reputation: 15
Blocking Incoming e-mail from a domain using iptables


I tried a search but could not find exactly what I am looking for. There is a site that is constantly sending e-mail to my GroupWise e-mail server at a clients site. I am using a Mandake box using iptables to handle the firewall.

Let's say the domain sending the e-mail is bademaildomain.com
I do not know the addy for the smtp relay so I want to block the whole domain. (Unless there is a way to find this?) Either way I would like to know how to block an entire domain.
I also get confused with OUTPUT and INPUT. At this point I could care less if people wanted to browse their web page etc, so outgoing requests originating inside my firewall should have access to the domain. I am using stateful packet inspection, will this allow it back in? If not I don't mind blocking it in both directions.

Would this work?

iptables -A OUTPUT -i $INTERNET -s bademaildomain.com -j DROP

$INTERNET is my port going out to the Internet.

Thanks,

Zych
 
Old 04-06-2004, 10:08 AM   #2
Zychior
Member
 
Registered: Jan 2002
Location: Northern Virginia
Distribution: Mandrake 8.1
Posts: 41

Original Poster
Rep: Reputation: 15
I guess I need to do another update. Since I am using DNAT I would think it would need to be changed to this:

iptables -A FORWARD -i $INTERNET -s bademaildomain.com -j DROP

I take it that INPUT and OUTPUT are only used if the box running the firewall (my Mandrake Linux box in this case.) is the destination or origin of the packet, correct?

From what I understand if any type of mangling or NAT is used, then the rule needs to apply to the FORWARD rule base, correct?

Thanks,

Zych
 
Old 04-06-2004, 12:13 PM   #3
Fireice
LQ Newbie
 
Registered: Dec 2003
Location: UK
Distribution: Debian woody
Posts: 8

Rep: Reputation: 0
If you want to block spam from spammer@banemail.com then you need a mail filter - from filed can be easily spoofed so it's meaningless. If you want to block spam incoming form banemail.com, which happens to be open relay then iptables will do.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make Sendmail forward all incoming mail to localhost port 26 (Domino mail) speedgelb Linux - Software 2 04-04-2004 04:41 PM
How to separate Incoming Mail and Outgoing Mail on SENDMAIL LiloAma Linux - Networking 1 03-22-2004 02:24 AM
Blocking Mail from addresses with IPTables Optichip Linux - Networking 2 02-11-2004 06:53 PM
Postfix mail server not accepting incoming mail from the external interface rexmundi Linux - Networking 7 12-22-2003 03:41 PM
incoming mail exigent Linux - Networking 7 09-17-2002 04:45 PM


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

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration