LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
  Search this Thread
Old 05-08-2006, 07:28 AM   #1
rickylim
Member
 
Registered: Jan 2006
Location: Malaysia
Distribution: RedHat & FreeBSD
Posts: 68

Rep: Reputation: 15
iptables - could not receive mail


Dear all,

i am very new to iptables. so please advise.

i have a mail server running on Red Hat Enterprise Linux 4 ES (running on postfix, dovecot and squirrelmail)

the problem now is, when i activated my firewall. i can only send mail but could not receive mail on the client side.

i tried to turn off the iptables, and everything is ok (can send and receive).

I am using a default iptables, as below.

:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [822:81012]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp -m icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p ipv6-crypt -j ACCEPT
-A RH-Firewall-1-INPUT -p ipv6-auth -j ACCEPT
-A RH-Firewall-1-INPUT -d 224.0.0.251 -p udp -m udp --dport 5353 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 55100 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 55100 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 110 -j ACCEPT
COMMIT

Anything that i need to add to it?

Please advice.

Many thanks

rgds.
Lim

Last edited by rickylim; 05-08-2006 at 08:04 AM.
 
Old 05-08-2006, 08:09 AM   #2
imagineers7
Member
 
Registered: Mar 2006
Distribution: BackTrack, RHEL, FC, CentOS, IPCop, Ubuntu, 64Studio, Elive, Dream Linux, Trix Box
Posts: 310

Rep: Reputation: 30
Lightbulb Open port for dovecot:

Hi rickylim,
I don't see any entry for opening port for imap/dovecot
open the port: 143 from iptable rules
and you will get the things done;
at least hope so!
Let me know if you are through

Last edited by imagineers7; 05-08-2006 at 08:11 AM.
 
Old 05-08-2006, 08:41 AM   #3
rickylim
Member
 
Registered: Jan 2006
Location: Malaysia
Distribution: RedHat & FreeBSD
Posts: 68

Original Poster
Rep: Reputation: 15
Hi thanks for your reply, appreciate it.

i have added port 143 and 110, but still cant get it work. please help

Please advice

-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp -m icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p ipv6-crypt -j ACCEPT
-A RH-Firewall-1-INPUT -p ipv6-auth -j ACCEPT
-A RH-Firewall-1-INPUT -d 224.0.0.251 -p udp -m udp --dport 5353 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 55100 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 55100 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 143 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 110 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
 
Old 05-08-2006, 09:27 AM   #4
imagineers7
Member
 
Registered: Mar 2006
Distribution: BackTrack, RHEL, FC, CentOS, IPCop, Ubuntu, 64Studio, Elive, Dream Linux, Trix Box
Posts: 310

Rep: Reputation: 30
I am not sure but see if:-

Hello rickylim,


I have seen current setup but I am not sure whats wrong!

You said that when you turn off the firewall it starts working,
which clearly means that you don't have any other firewall than
iptables or is it?
May be you should try creating your own firewall by adding rules
one by one which suit your system.

Im sorry but I'll have to leave now
Bye for today...
 
Old 05-08-2006, 09:42 PM   #5
rickylim
Member
 
Registered: Jan 2006
Location: Malaysia
Distribution: RedHat & FreeBSD
Posts: 68

Original Poster
Rep: Reputation: 15
Thanks for your reply.

i revert back the original iptables setting and then i re add the rules again.

and now it's working. still dont know what's happening.

but anyway, thanks for your advice.

rgds.
Lim
 
Old 05-09-2006, 12:12 AM   #6
imagineers7
Member
 
Registered: Mar 2006
Distribution: BackTrack, RHEL, FC, CentOS, IPCop, Ubuntu, 64Studio, Elive, Dream Linux, Trix Box
Posts: 310

Rep: Reputation: 30
Please Reply

Hello lim,

Now if its working can you show us the changed iptables
settings so that any other user in future facing the same
problem will know what to change and where.

Please reply.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Squirrelmail - receive mail from outside? don_dimo Linux - Networking 2 03-08-2004 02:49 PM
Can't receive mail SylCR Linux - Newbie 12 02-06-2004 01:17 PM
Can't receive mail with sendmail rufassa Linux - Networking 7 11-05-2003 10:30 PM
cannot receive mail -- mail command andy18 Linux - General 1 09-09-2003 04:13 PM
Why can't I receive or send mail unless jobesd Linux - General 0 12-05-2001 11:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:27 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