<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.14.3">
</HEAD>
<BODY>
On Fri, 2007-08-31 at 10:18 +0800, Ed Greshko wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Timothy Murphy wrote:</FONT>
<FONT COLOR="#000000">> Andy Green wrote:</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">>> Somebody in the thread at some point said:</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>>>>         telnet <myserver> 993</FONT>
<FONT COLOR="#000000">>>>> I just get</FONT>
<FONT COLOR="#000000">>>>>         Trying <server IP address></FONT>
<FONT COLOR="#000000">>>>> and nothing further, until I type ctrl-C.</FONT>
<FONT COLOR="#000000">>>> Check /var/log/messages to see if anything is logged.  The behavior of</FONT>
<FONT COLOR="#000000">>>> telnet sounds like the behavior of openssl.  It's probably not the</FONT>
<FONT COLOR="#000000">>> No, he doesn't even get a tcp connection established.  If I telnet to my</FONT>
<FONT COLOR="#000000">>> IMAP server I see</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> telnet 192.168.0.xx 993</FONT>
<FONT COLOR="#000000">>> Trying 192.168.0.xx...</FONT>
<FONT COLOR="#000000">>> Connected to 192.168.0.xx.</FONT>
<FONT COLOR="#000000">>> Escape character is '^]'.</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> I would first confirm that something is still listening on your external</FONT>
<FONT COLOR="#000000">>> network interface on 993.</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> Thanks for all the responses.</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> nmap seems to show that port 993 is open:</FONT>
<FONT COLOR="#000000">> =====================================</FONT>
<FONT COLOR="#000000">> [tim@martha ~]$ nmap 86.43.71.228</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> Starting Nmap 4.20 ( <A HREF="http://insecure.org">http://insecure.org</A> ) at 2007-08-31 02:13 CEST</FONT>
<FONT COLOR="#000000">> Interesting ports on 86.43.71.228:</FONT>
<FONT COLOR="#000000">> Not shown: 1688 closed ports</FONT>
<FONT COLOR="#000000">> PORT     STATE    SERVICE</FONT>
<FONT COLOR="#000000">> 80/tcp   open     http</FONT>
<FONT COLOR="#000000">> 135/tcp  filtered msrpc</FONT>
<FONT COLOR="#000000">> 139/tcp  filtered netbios-ssn</FONT>
<FONT COLOR="#000000">> 445/tcp  filtered microsoft-ds</FONT>
<FONT COLOR="#000000">> 593/tcp  filtered http-rpc-epmap</FONT>
<FONT COLOR="#000000">> 993/tcp  filtered imaps</FONT>
<FONT COLOR="#000000">> 1720/tcp filtered H.323/Q.931</FONT>
<FONT COLOR="#000000">> 2001/tcp open     dc</FONT>
<FONT COLOR="#000000">> 5190/tcp open     aol</FONT>

<FONT COLOR="#000000">Except that if you read the man page for nmap you find....</FONT>

<FONT COLOR="#000000">Filtered means that a firewall, filter, or other network obstacle is</FONT>
<FONT COLOR="#000000">covering the port and preventing nmap from determining whether the port is open.</FONT>

<FONT COLOR="#000000">And</FONT>

<FONT COLOR="#000000">[egreshko@misty ~]$ telnet 86.43.71.228 993</FONT>
<FONT COLOR="#000000">Trying 86.43.71.228...</FONT>

<FONT COLOR="#000000">Times out....</FONT>

<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> Nmap finished: 1 IP address (1 host up) scanned in 20.467 seconds</FONT>
<FONT COLOR="#000000">> =====================================</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> But "netstat -anp --tcp" does not show anything listening on 993</FONT>
<FONT COLOR="#000000">> =====================================</FONT>
<FONT COLOR="#000000">> [tim@martha ~]$ sudo netstat -anp --tcp</FONT>
<FONT COLOR="#000000">> Active Internet connections (servers and established)</FONT>
<FONT COLOR="#000000">> Proto Recv-Q Send-Q Local Address               Foreign Address            </FONT>
<FONT COLOR="#000000">> State       PID/Program name</FONT>
<FONT COLOR="#000000">> tcp        0      0 127.0.0.1:8000              0.0.0.0:*                  </FONT>
<FONT COLOR="#000000">> LISTEN      1745/nasd</FONT>
<FONT COLOR="#000000">> tcp        0      0 127.0.0.1:2208              0.0.0.0:*                  </FONT>
<FONT COLOR="#000000">> LISTEN      1637/hpiod</FONT>
<FONT COLOR="#000000">> tcp        0      0 0.0.0.0:139                 0.0.0.0:*                  </FONT>
<FONT COLOR="#000000">> LISTEN      1878/smbd</FONT>
<FONT COLOR="#000000">> tcp        0      0 0.0.0.0:631                 0.0.0.0:*                  </FONT>
<FONT COLOR="#000000">> LISTEN      1654/cupsd</FONT>
<FONT COLOR="#000000">> tcp        0      0 127.0.0.1:25                0.0.0.0:*                  </FONT>
<FONT COLOR="#000000">> LISTEN      1714/sendmail: acce</FONT>
<FONT COLOR="#000000">> tcp        0      0 0.0.0.0:445                 0.0.0.0:*                  </FONT>
<FONT COLOR="#000000">> LISTEN      1878/smbd</FONT>
<FONT COLOR="#000000">> tcp        0      0 127.0.0.1:2207              0.0.0.0:*                  </FONT>
<FONT COLOR="#000000">> LISTEN      1642/python</FONT>
<FONT COLOR="#000000">> tcp        0      0 0.0.0.0:33215               0.0.0.0:*                  </FONT>
<FONT COLOR="#000000">> LISTEN      1443/rpc.statd</FONT>
<FONT COLOR="#000000">> tcp        0      0 192.168.1.149:34676         86.43.71.228:2001          </FONT>
<FONT COLOR="#000000">> ESTABLISHED 3298/ssh</FONT>
<FONT COLOR="#000000">> tcp        0      0 :::901                      :::*                       </FONT>
<FONT COLOR="#000000">> LISTEN      1680/xinetd</FONT>
<FONT COLOR="#000000">> tcp        0      0 :::111                      :::*                       </FONT>
<FONT COLOR="#000000">> LISTEN      1422/rpcbind</FONT>
<FONT COLOR="#000000">> tcp        0      0 :::22                       :::*                       </FONT>
<FONT COLOR="#000000">> LISTEN      1668/sshd</FONT>
<FONT COLOR="#000000">> tcp        0      0 :::631                      :::*                       </FONT>
<FONT COLOR="#000000">> LISTEN      1654/cupsd</FONT>
<FONT COLOR="#000000">> =====================================</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> I can telnet 993 on my server without problem:</FONT>
<FONT COLOR="#000000">> =====================================</FONT>
<FONT COLOR="#000000">> [tim@alfred ~]$ telnet localhost 993</FONT>
<FONT COLOR="#000000">> Trying 127.0.0.1...</FONT>
<FONT COLOR="#000000">> Connected to localhost.localdomain (127.0.0.1).</FONT>
<FONT COLOR="#000000">> Escape character is '^]'.</FONT>
<FONT COLOR="#000000">> ^]</FONT>
<FONT COLOR="#000000">> telnet> quit</FONT>
<FONT COLOR="#000000">> Connection closed.</FONT>
<FONT COLOR="#000000">> =====================================</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> And "iptables -L" seems to allow this connection:</FONT>
<FONT COLOR="#000000">> =====================================</FONT>
<FONT COLOR="#000000">> ...</FONT>
<FONT COLOR="#000000">> Chain net2fw (1 references)</FONT>
<FONT COLOR="#000000">> target     prot opt source               destination</FONT>
<FONT COLOR="#000000">> ACCEPT     0    --  anywhere             anywhere            state</FONT>
<FONT COLOR="#000000">> RELATED,ESTABLISHED</FONT>
<FONT COLOR="#000000">> ACCEPT     icmp --  anywhere             anywhere            icmp</FONT>
<FONT COLOR="#000000">> echo-request</FONT>
<FONT COLOR="#000000">> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:http</FONT>
<FONT COLOR="#000000">> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh</FONT>
<FONT COLOR="#000000">> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:https</FONT>
<FONT COLOR="#000000">> ACCEPT     tcp  --  anywhere             anywhere            tcp</FONT>
<FONT COLOR="#000000">> dpt:appserv-http</FONT>
<FONT COLOR="#000000">> ACCEPT     udp  --  anywhere             anywhere            udp</FONT>
<FONT COLOR="#000000">> dpt:appserv-http</FONT>
<FONT COLOR="#000000">> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:smtp</FONT>
<FONT COLOR="#000000">> ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:imaps</FONT>
<FONT COLOR="#000000">> Drop       0    --  anywhere             anywhere</FONT>
<FONT COLOR="#000000">> LOG        0    --  anywhere             anywhere            LOG level info</FONT>
<FONT COLOR="#000000">> prefix `Shorewall:net2fw:DROP:'</FONT>
<FONT COLOR="#000000">> DROP       0    --  anywhere             anywhere</FONT>
<FONT COLOR="#000000">> ...</FONT>
<FONT COLOR="#000000">> =====================================</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> So my best guess is that there is something wrong</FONT>
<FONT COLOR="#000000">> with my dovecot configuration.</FONT>
<FONT COLOR="#000000">> I "yum remove"d and "yum install"ed dovecot</FONT>
<FONT COLOR="#000000">> (and re-edited dovecot.conf),</FONT>
<FONT COLOR="#000000">> but that didn't seem to make any difference.</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">>> Why not tcpdump it over your ssh session to the server while you try to</FONT>
<FONT COLOR="#000000">>> connect and see what you can see.</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> Another more exotic workaround would be, on your local machine</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> ssh root@myserver -N -L993:localhost:993</FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> while this runs, 993 (the first number) on your local client box will</FONT>
<FONT COLOR="#000000">>> magically be an encrypted wormhole to port 993 on myserver.  Try running</FONT>
<FONT COLOR="#000000">>> that in one terminal session, and temporarily alter kmail to go look at</FONT>
<FONT COLOR="#000000">>> localhost for IMAP instead of myserver.</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> I'll try these tomorrow.</FONT>
<FONT COLOR="#000000">> Thanks very much for your help anyway.</FONT>
<FONT COLOR="#000000">> </FONT>


<FONT COLOR="#000000">-- </FONT>
<FONT COLOR="#000000">First Law of Bicycling:</FONT>
<FONT COLOR="#000000">  No matter which way you ride, it's uphill and against the wind.</FONT>

</PRE>
</BLOCKQUOTE>
I had a problem with my app/web server listening on "::::80" awhile back.  I'd try to connect (telnet, browser, etc.) and it'd just sit there.  I switched to listen on "0.0.0.0:80" and it all worked like a charm.  I'm terribly ignorant on IPv6 so I can't speak to what the root problem was, but the work-around did the trick.<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<BR>
<TABLE CELLSPACING="0" WIDTH="450">
<TR>
<TD>
<TABLE WIDTH="250">
<TR>
<TD>
<FONT SIZE="2">-- </FONT><B><FONT SIZE="2">Mark C. Allman, PMP</FONT></B>
</TD>
</TR>
<TR>
<TD>
<FONT SIZE="2">-- Allman Professional Consulting, Inc.</FONT>
</TD>
</TR>
<TR>
<TD>
<FONT SIZE="2">-- <A HREF="http://www.allmanpc.com">www.allmanpc.com</A>, 617-947-4263</FONT>
</TD>
</TR>
</TABLE>
</TD>
<TD>
<TABLE WIDTH="200">
<TR>
<TD ALIGN="left" VALIGN="top">
<IMG SRC="cid:1188527732.4609.43.camel@prez.allmanpc.com" ALIGN="bottom" BORDER="0">
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<B><FONT SIZE="2"><FONT COLOR="#800000">BusinessMsg</FONT></FONT></B><FONT SIZE="2"><FONT COLOR="#000000"> -- the secure, managed, J2EE</FONT></FONT><FONT SIZE="2">/</FONT><FONT SIZE="2"><FONT COLOR="#800000">AJAX</FONT></FONT><FONT SIZE="2"><FONT COLOR="#000000"> Enterprise IM</FONT></FONT><FONT SIZE="2">/IC</FONT><FONT SIZE="2"><FONT COLOR="#000000"> solution.</FONT></FONT>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>