Subject: c-client -> broken pop servers

From: ml <[email-masked]>
Date: Tue, 3 Feb 2004 16:58:59 +0900 (JST)

Hello!

I would appreciate hints/pointers in regards to hacking c-client/pop3.c to
make my c-client project work with a broken pop3 server.

Though I'm RFC ignorant, since c-client (from imap-2002e) doesn't work
with this particular pop server, I'm sure it's broken.

I suspect, the problem is that upon seeing the "+OK <blah blah blah>"
greetings from the pop3 server, c-client will issue a "CAPA" command.  In
response to that, the server would say:

+OK capability list follows
PIPELINING
TOP
UIDL
APOP
.

Since the list didn't include "USER", c-client would stop and say "Can't
login to this server."

So, if I were to change pop3.c, and make it such that:

diff -r1.1 pop3.c
408c408,411
<   if (pop3_send (stream,"CAPA",NIL)) LOCAL->cap.capa = T;
---
>   if (pop3_send (stream,"CAPA",NIL)) {
>     LOCAL->cap.capa = T;
>     LOCAL->cap.user = T;
>   }

to make sure LOCAL->cap.user is always true, what if any other things will
this break?

Many Thanks,

N.

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Tue, 3 Feb 2004 01:35:58 -0800 (PST)

> +OK capability list follows

This server is saying that it does not support plaintext password
USER/PASS authentication, but it does support APOP authentication.

The c-client library does not support APOP, as APOP has been deprecated in
favor of SASL based authentication.  The SASL equivalent to APOP would be
"AUTH CRAM-MD5".

Are you certain that the server will accept a USER/PASS authentication?
The CAPA response says that it will not.  Your patch will work to force
c-client to send USER/PASS even if the server says that it does not
support it.  This would be a bad thing if it turned out that the server
didn't really support USER/PASS.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

---

From: ml <[email-masked]>
Date: Tue, 3 Feb 2004 18:51:00 +0900 (JST)

>didn't really support USER/PASS.

Mark,

Thank you very much for the response.

Yes, I'm sure it supports USER/PASS because when I continued on and say
"USER someusername" it responded with "+OK password please"  and I logged
on fine.  So, it looks like it didn't advertise the "USER" capa because it
preferred users to use APOP?  Hmmm...

Anyway, if I were to force c-client to send USER/PASS, would it break
other "good" (e.g. SASL capable) servers?

For your information, I have decided on the following shorter patch.

Thanks again for your help.

Regards,
N.

----patch follows---

diff -r1.1 pop3.c
407a408
>   LOCAL->cap.user = T;        /* guess worst-case old server */
409,412c410
<   else {
<     LOCAL->cap.user = T;      /* guess worst-case old server */
<     return NIL;                       /* no CAPA on this server */
<   }
---
>   else return NIL;                    /* no CAPA on this server */