Subject: POP3 uid support

From: Mark Lipscombe <[email-masked]>
Date: Mon, 15 Jan 2001 14:05:54 +0000

Hi,

I notice in the bugs.txt file that pop3 uid support is not done.

Is this because of some sort of implementation problem?  Or is it implemented 
by a patch or anything?  I desperately need this, and I'm about to start 
writing it myself, just wanted to check that I'm not reinventing the wheel, 
and there's no major difficulties.

Cheers,
Mark
-- 
------------------------------------------------------------------
 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: Sun, 14 Jan 2001 19:15:04 -0800 (PST)

On Mon, 15 Jan 2001 14:05:54 +0000, Mark Lipscombe wrote:
> Is this because of some sort of implementation problem?  Or is it
> implemented by a patch or anything?

Unlike IMAP, POP3 UIDs are not well-behaved integral values; they're arbitrary
strings with no ordering.  Many POP3 server implementations use MD5 checksums.
So, you would have to keep an additional char* per message, and the only way
to use them is to download the entire map with UIDL.

It's not hard to do this, but the question is, why waste your time writing new
software to use POP3?

---

From: Vadim <[email-masked]>
Date: Mon, 15 Jan 2001 16:51:26 +0100 (CET)

> > implemented by a patch or anything?

 Hello,

 I have had to do it in my program (I decided against making a patch to
cclient itself knowing what Mark thinks about POP3 :-). It is really
trivial, i.e. this is the function I have to retrieve the UIDL for the
given msgno (m_MailStream is a POP3 MAILSTREAM):

      extern "C" {
      #undef LOCAL // previously defined in other cclient headers
      #include <pop3.h>    // for pop3_send_num()
      }

      ...

      if ( pop3_send_num(m_MailStream, "UIDL", msgno) )
      {
         char *reply = ((POP3LOCAL *)m_MailStream->local)->reply;
         unsigned long msgnoFromUIDL;

         // RFC says 70 characters max, but avoid buffer overflows just
         // in case
         char *buf = new char[strlen(reply) + 1];
         if ( (sscanf(reply, "%lu %s", &msgnoFromUIDL, buf) != 2) ||
              (msgnoFromUIDL != msgno) )
         {
            // something is wrong
            wxLogDebug("Unexpected POP3 server UIDL response to UIDL %lu: %s",
                       msgno, reply);
         }
         else // parsed UIDL successfully
         {
            uidString = buf;
         }

         delete [] buf;
      }
      //else: POP3 server doesn't support UIDL probably

> It's not hard to do this, but the question is, why waste your time writing new

 Because many people use it and it's quite hard to do anything sensible
with POP3 without using UIDLs. Although we all know that IMAP is better it
doesn't help a user whose ISP only supports POP3 that much. Sometimes I
wonder if the words "real life" mean anything to you, Mark <grin>

 Regards,
VZ