Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 34646 - qmail-pop3d CAPA output bug [done for -r14]
Summary: qmail-pop3d CAPA output bug [done for -r14]
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-28 14:13 UTC by Lincoln A Baxter
Modified: 2004-01-20 01:17 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lincoln A Baxter 2003-11-28 14:13:47 UTC
I upgraded about new ebuilds that we introduced in the last 2-3 days.  These
included gcc-3.2.3-r3 and qmail-1.03-r13.  The previous stable version of qmail
was 1.03-r10.  All the new components appear to one but one: qmail-pop3d, which 
hangs every time I try to connect to it from evolution. (1.4.5).  But reconfigured 
my evolution to connect to my ISP's pop server, i believe have determined that I
have evolution configured correctly.   Yet

When I connect to port 110 with the qmail-pop3d running, I can log in, list,
retr, and quit just fine.  But evolution hangs every time. 

I have completely remove my evolution config, and reconfigured to talk to my
ISP's pop server, and evolution works fine. A just the same configuration to
talk to qmail-pop3d in this ebuild and Evolution hangs.  Very strange.

To make matters worse it does not seem possible to back down to a previous
version of qmail, becuase they no longer compile.  So this mean we are dead in
the water.

There was one other strange thing about this.  After emerge qmail-pop3d would
not even run until i manually created a /etc/tcp.pop3.cdb (previously I think it
was using tcp.smtp.cdb).  So there is also a bug in the post install
configuration script.


Reproducible: Always
Steps to Reproduce:
1. emerge qmail and configure and verify correct operation.
2. emerge evolution can configure to connect to POP3 server installed with qmail
3. Attempt to retrieve messages.  evolution will hang

Actual Results:  
evolution will hang

Expected Results:  
evolution should have retrieved messages sitting in my Maildir

There was nothing unusually about the emerge. It appeared to go just fine.
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-28 23:17:30 UTC
bug-trackers: please pass this to the evolution people.

the  /etc/tcp.pop3.cdb issue is fixed, and I don't have evolution to try that bug. However the pop3 server does work perfectly fine with mozilla, mutt, lotus notes and outlook. I'm strongly suspecting it's an evolution issue.

as a side note, i usually use the IMAP server in courier-imap, and it's POP3 server is quite a bit better than qmail's.
Comment 3 Lincoln A Baxter 2003-11-29 08:52:50 UTC
Thanks for show me how to debug evo.  I know now what change with qmail-pop3d and why evo does not work with it.

Here is the the exchange that EVO had with qmail-pop3d:

lab@lws [~] export CAMEL_VERBOSE_DEBUG=1
lab@lws [~] evolution 
POP3_STREAM_LINE(40): '+OK <20860.1070123814@lincolnbaxter.com>'
POP3_STREAM_WRITE(6):
CAPA

POP3_STREAM_LINE(27): '+OK Capability list follows'
Got + response
cmd_capa
POP3_STREAM_LINE(3): 'TOP'
POP3_STREAM_LINE(4): 'UIDL'
POP3_STREAM_LINE(4): 'LAST'
POP3_STREAM_LINE(4): 'USER'
POP3_STREAM_LINE(4): 'APOP'
POP3_STREAM_LINE(END)
POP3_STREAM_WRITE(10):
USER lab

POP3_STREAM_LINE(4): '+OK '
Got + response
POP3_STREAM_WRITE(15):
PASS xxxxxxxx
POP3_STREAM_LINE(4): '+OK '
Got + response
POP3_STREAM_WRITE(6):
CAPA


BEGIN LAB note **************************************************************

It hangs right here.  Note that EVO does a CAPA, then logs in.  THEN it does a CAPA again.  Apparently, qmail-pop3d does does not support CAPA AFTER login. I testing this with telnet: If you issue a CAPA after login, qmail-pop3d (1.03-r13) hangs.  Which explains why EVO is hanging.  Apparently most pop3d servers support CAPA after login, and qmail-pop3d USED to. 

END LAB note ****************************************************************

POP3_STREAM_FILL(ERROR): 'Interrupted system call'
POP3_STREAM_FILL(ERROR): 'Interrupted system call'
POP3_STREAM_FILL(ERROR): 'Interrupted system call'

(evolution:20848): GLib-GObject-WARNING **: gsignal.c:2010: instance `0x8344320' has no handler with id `2458'
lab@lws [~] evolution --force-shutdown

Comment 4 Lincoln A Baxter 2003-11-29 09:57:44 UTC
OK have have found the problem. It *IS* a problem with qmail-pop3d.
Change line 317 of qmail-pop3d.c 
FROM:
  puts( "+OK Capability list follows\r\n"
TO:
  substdio_puts(&ssout ,"+OK Capability list follows\r\n"

And all is fixed.  This bug should be assigned back to the inet-mail group.
And a new release of qmail-1.03 generated as quickly as possible.
Comment 5 Alastair Tse (RETIRED) gentoo-dev 2003-11-29 10:36:01 UTC
thanks for tracking this down, i'll reassign to robbat2 so he can handle the qmail side of things.
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-30 00:20:07 UTC
fix applied in -r14
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-30 03:33:43 UTC
if you are feeling experimental, -r14 is now out. It's hardmasked until I personally test it some more, but it should work.
Comment 8 Lincoln A Baxter 2003-11-30 22:08:27 UTC
The CAPA bug appears to be fixed (and some new bug introduced... see below)

I ebuilt -r14 on a test machine and sent myseulf of message:
Evolution was unable to fetch it.  It returned:

Error while 'Fetching Mail':
Cannot get message 1070256826.15866.dlt.lincolnbaxter.com,S=241: Input/output error

So I tested with telnet:

dlt etc # telnet dlt 110
Trying 192.168.0.27...
Connected to dlt.
Escape character is '^]'.
+OK <15918.1070257132@dlt.lincolnbaxter.com>
user lab
+OK 
pass XXXXXXXX
+OK 
capa
+OK Capability list follows
TOP
UIDL
LAST
USER
APOP
.
list
+OK 
1 323
.
retr 1
323Return-Path: <root@dlt.lincolnbaxter.com>
Delivered-To: lab@dlt.lincolnbaxter.com
Received: (qmail 15863 invoked by uid 0); 1 Dec 2003 00:33:46 -0500
Date: 1 Dec 2003 00:33:46 -0500
Message-ID: <20031201053346.15862.qmail@dlt.lincolnbaxter.com>
From: root@dlt.lincolnbaxter.com
To: lab@dlt.lincolnbaxter.com
Subject: test


.
dele 1
+OK 
list
+OK 
.
quit
+OK 
Connection closed by foreign host.
dlt etc # 

So the CAPA bug is fixed... but lets see what EVO's problem is now here is a debug transcript of what Evolution saw:  Up to the error:

POP3_STREAM_LINE(44): '+OK <16061.1070258063@dlt.lincolnbaxter.com>'
POP3_STREAM_WRITE(6):
CAPA

POP3_STREAM_LINE(27): '+OK Capability list follows'
Got + response
cmd_capa
POP3_STREAM_LINE(3): 'TOP'
POP3_STREAM_LINE(4): 'UIDL'
POP3_STREAM_LINE(4): 'LAST'
POP3_STREAM_LINE(4): 'USER'
POP3_STREAM_LINE(4): 'APOP'
POP3_STREAM_LINE(END)
POP3_STREAM_WRITE(10):
USER lab

POP3_STREAM_LINE(4): '+OK '
Got + response
POP3_STREAM_WRITE(15):
PASS xxxxxxxx
POP3_STREAM_LINE(4): '+OK '
Got + response
POP3_STREAM_WRITE(6):
CAPA

POP3_STREAM_LINE(27): '+OK Capability list follows'
Got + response
cmd_capa
POP3_STREAM_LINE(3): 'TOP'
POP3_STREAM_LINE(4): 'UIDL'
POP3_STREAM_LINE(4): 'LAST'
POP3_STREAM_LINE(4): 'USER'
POP3_STREAM_LINE(4): 'APOP'
POP3_STREAM_LINE(END)
POP3_STREAM_WRITE(6):
LIST

POP3_STREAM_LINE(4): '+OK '
Got + response
POP3_STREAM_LINE(5): '1 323'
POP3_STREAM_LINE(5): '2 323'
POP3_STREAM_LINE(END)
POP3_STREAM_WRITE(6):
UIDL

POP3_STREAM_LINE(4): '+OK '
Got + response
POP3_STREAM_LINE(46): '1 1070257296.15925.dlt.lincolnbaxter.com,S=241'
POP3_STREAM_LINE(46): '2 1070257939.15948.dlt.lincolnbaxter.com,S=241'
POP3_STREAM_LINE(END)
POP3_STREAM_WRITE(8):
RETR 1

POP3_STREAM_LINE(44): '323Return-Path: <root@dlt.lincolnbaxter.com>'

(evolution:16057): camel-pop3-provider-WARNING **: Bad server response: 323Retur
n-Path: <root@dlt.lincolnbaxter.com>

POP3_STREAM_WRITE(8):
RETR 2

POP3_STREAM_LINE(39): 'Delivered-To: lab@dlt.lincolnbaxter.com'

(evolution:16057): camel-pop3-provider-WARNING **: Bad server response: Delivere
d-To: lab@dlt.lincolnbaxter.com

POP3_STREAM_WRITE(6):
QUIT

POP3_STREAM_LINE(67): 'Received: (qmail 15922 invoked by uid 0); 1 Dec 2003 00:4
1:36 -0500'

(evolution:16057): camel-pop3-provider-WARNING **: Bad server response: Received
: (qmail 15922 invoked by uid 0); 1 Dec 2003 00:41:36 -0500


So I went to the maildir and catted the file:

lab@dlt [~/.maildir/cur] ls
1070257296.15925.dlt.lincolnbaxter.com,S=241:2,
1070257939.15948.dlt.lincolnbaxter.com,S=241:2,
lab@dlt [~/.maildir/cur] cat 1070257939.15948.dlt.lincolnbaxter.com,S=241:2,
Return-Path: <root@dlt.lincolnbaxter.com>
Delivered-To: lab@dlt.lincolnbaxter.com
Received: (qmail 15945 invoked by uid 0); 1 Dec 2003 00:52:19 -0500
Date: 1 Dec 2003 00:52:19 -0500
Message-ID: <20031201055219.15944.qmail@dlt.lincolnbaxter.com>
From: root@dlt.lincolnbaxter.com
To: lab@dlt.lincolnbaxter.com
Subject: test

lab@dlt [~/.maildir/cur]


It looks OK to me. But I could be not seeing non-printing chars, that
evo IS seeing.  I think it is time to DIFF all the changes between -r13
and -r14 to see want could have introduced this new error.

Bottom line.  This bug is fixed but -r14 should NOT be unmasked.
Should a new bug be created for the new problem?

Lincoln




Comment 9 Lincoln A Baxter 2003-11-30 22:12:11 UTC
One more note... looking this over.  My telnet test showed the garbage 232 that EVO was bitching about.  

So this appears to be a new bug in RETR for r14.

Lincoln
Comment 10 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-30 23:25:52 UTC
could you please attempt to add this patch as well:
diff -uBbwr qmail-1.03.orig/qmail-pop3d.c qmail-1.03/qmail-pop3d.c
--- qmail-1.03.orig/qmail-pop3d.c       2003-11-30 23:45:22.000000000 -0800
+++ qmail-1.03/qmail-pop3d.c    2003-11-30 23:43:13.000000000 -0800
@@ -312,9 +312,9 @@
   fd = open_read(m[i].fn);
   if (fd == -1) { err_nosuch(); return; }
   /* okay(); */
-  puts("+OK ");
+  substdio_puts(&ssout,"+OK ");
   put(strnum,fmt_ulong(strnum,m[i].size));
-  puts(" octets\r\n");
+  substdio_puts(&ssout," octets\r\n");
   flush();
   substdio_fdbuf(&ssmsg,read,fd,ssmsgbuf,sizeof(ssmsgbuf));
   blast(&ssmsg,limit);

do:
cd /usr/portage/net-mail/qmail
ebuild qmail-1.03-r14.ebuild clean unpack
in a seperate window, go to /var/tmp/portage/qmail-1.03-r14/work and apply the patch
now do:
ebuild qmail-1.03-r14.ebuild compile package
ebuild qmail-1.03-r14.ebuild qmerge

and it will install the new version with that extra patch.
Comment 11 Lincoln A Baxter 2003-12-01 04:36:43 UTC
That does the trick. I searched the rest of the code for the same mistake, and did not find it.

Lincoln
Comment 12 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-01-20 01:17:10 UTC
in place for r15