LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 10-25-2006, 11:21 PM   #1
augurseer
Member
 
Registered: Feb 2006
Location: Canada
Distribution: OpenSuSe 10.2 (Home and Laptop) CentOS 5.0 (Server)
Posts: 171

Rep: Reputation: 30
Exclamation gmail and iptables POP problems


i am using centos 4.4 as a in home IMAP server. i use fetchmail to get email off my gmail account using gmails POP service. i began installing iptables and setting it up to protect my server and network. i have a standalone router, dlink that also acts as a cheapy firewall and NAT and all the thigns routers do today. Then i have my CentOS server, in which i am setting up iptables.


i am able to get my imap (in network) working aswell as HTTPD, SSHD and the like. i can access the net from the server and can ping and such. i jsut cant get fetchmail to donwload my emails.


i use port 995 with SSL to access the server, i opened IPTABLES up with

-A INPUT -p tcp -m tcp -m state -i eth0 --dport 995 --sport 1024:65535 --state NEW -j ACCEPT

-A INPUT -p tcp -m tcp -i eth0 --dport 1024:65535 --sport 995 -j ACCEPT


by my knowledge this allows port 995 from outside to access my server AND for my server to recive contact from system transmiting FROM port 995.

i can contact the pop.gmail.com server, see the new emails and it even tries to download them, then i get a

.fetchmail: SMTP connect to localhost failed
fetchmail: SMTP transaction error while fetching from pop.gmail.com
fetchmail: Query status=10 (SMTP)

error.


this to me appears to be a SMTP failure on my side, but this doesnt make much sense, i use postfix and dont have a single issue with postfix OR gmail OR fetchmail when the firewall is all open and free. but once any rules set are loaded the system wont allow SMTP communications.



here is my /etc/sysconfig/iptables entry:


# Generated by iptables-save v1.2.11 on Wed Oct 25 02:27:35 2006
*filter
:FORWARD ACCEPT [0:0]
:INPUT DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A FORWARD -o eth0 -j LOG --log-level 7 --log-prefix BANDWIDTH_OUT:
-A FORWARD -i eth0 -j LOG --log-level 7 --log-prefix BANDWIDTH_IN:
-A OUTPUT -o eth0 -j LOG --log-level 7 --log-prefix BANDWIDTH_OUT:
-A INPUT -i eth0 -j LOG --log-level 7 --log-prefix BANDWIDTH_IN:
-A INPUT -p tcp -m state -i eth0 --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p udp -m udp -i eth0 --dport 1024:65535 --sport 53 -j ACCEPT
-A INPUT -p tcp -m tcp -i eth0 --dport 1024:65535 --sport 80 -j ACCEPT
-A INPUT -p tcp -m tcp -i eth0 --dport 1024:65535 --sport 995 -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth0 --dport 80 --sport 1024:65535 --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth0 --dport 143 --sport 1024:65535 --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth0 --dport 995 --sport 1024:65535 --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth0 --dport 9175 --sport 1024:65535 --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state -i eth0 --dport 10000 --sport 1024:65535 --state NEW -j ACCEPT
COMMIT
# Completed on Wed Oct 25 02:27:35 2006
# Generated by iptables-save v1.2.11 on Wed Oct 25 02:27:35 2006
*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed on Wed Oct 25 02:27:35 2006
# Generated by iptables-save v1.2.11 on Wed Oct 25 02:27:35 2006
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
COMMIT
# Completed on Wed Oct 25 02:27:35 2006
 
Old 10-25-2006, 11:50 PM   #2
augurseer
Member
 
Registered: Feb 2006
Location: Canada
Distribution: OpenSuSe 10.2 (Home and Laptop) CentOS 5.0 (Server)
Posts: 171

Original Poster
Rep: Reputation: 30
i fixex my own problems.


i added to new rules


allow 127.0.0.1 to contact in from 127.0.0.1 on port 25 and vic versa.


so now only 127.0.0.1 FROM 127.0.0.1 can talk to 127.0.0.1 from 127.0.0.1 using 25, it appears that i was blocking fetchmail from passing the mail from itself to postfix, DAMNED my stupidness, but yea for fixes
 
  


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
How to get POP Gmail to work with Evolution? Rundi Linux - Software 12 12-17-2008 02:11 PM
iptables pop-up alerts johnnydangerous Fedora 3 02-05-2005 08:04 PM
can't access gmail pop servers -- help! opioid General 5 11-15-2004 02:53 PM
simple rules iptables ftp and pop/smtp steve_babbage Linux - Security 9 12-04-2003 06:14 PM
stopping pop-ups with iptables fuxored Linux - Security 13 06-27-2002 10:54 PM

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

All times are GMT -5. The time now is 06:48 PM.

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