Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-12-2008, 01:09 PM   #1
Registered: Jun 2008
Posts: 49

Rep: Reputation: 16
iptables problems with smtp pop3


I can telnet and connect to dovecot on 110
but when I telnet and connect to smtp on 25 I get connection refused by host. The mail server, web server etc is all the same machine.

Can someone please tell me whats wrong with my iptables - assuming this is what is the problem. Though even when I
telnet localhost 25
I get the same problem, cannot connect to host: Connection refused. I've run out of ideas and going mad here!

Many thanks


# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
: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 --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 110 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
Old 10-12-2008, 03:41 PM   #2
Senior Member
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Is the firewall you posted running on the server? If so, I don't see any wrong with it. Is it possible a firewall on your client machine is causing this? Or the SMTP server doesn't like telnet?

If none of this leads you to the problem, there are some things you can do to troubleshoot.

One useful thing is to look at packet counts for rules using (as root):

iptables -nvL
The first column will show how many packets have matched that rule. You can take this one step further by adding a rule to log rejected packets immediately prior to the REJECT rule.

You can also run a packet sniffer such as tcpdump or wireshark to see what packets are actually getting sent. If you run a packet sniffer remotely over ssh, make sure you specifiy "not tcp port 22".


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
SMTP/POP3 problems with squid/iptables dragonleech Linux - Security 8 09-23-2010 05:57 AM
want to get SMTP and POP3 working through iptables. vedang Linux - Server 6 02-01-2008 09:16 AM
SMTP AND POP3 through iptables vedang Linux - Server 5 01-31-2008 12:47 AM
SMTP/POP3 iptables problem dragonleech Linux - Security 4 12-12-2005 12:33 PM
POP3/SMTP-IPTABLES Problems chris Linux - Networking 1 02-28-2003 05:55 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:53 PM.

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