[Evolution-hackers] inefficient POP3 handling



I think Evo's POP3 handling could be more efficient.

The server in these two examples is qmail pop3d. 


1. Popping an empty mailbox:
----------------------------

POP3_STREAM_LINE(4): '+OK '
Got + response
POP3_STREAM_LINE(46): '+OK <21677 1113679229 mustang oldcity dca net>'
POP3_STREAM_WRITE(6):
CAPA

POP3_STREAM_LINE(24): '-ERR authorization first'
POP3_STREAM_WRITE(27):
USER rlrevell joe-job com

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(18): '-ERR unimplemented'
POP3_STREAM_WRITE(8):
UIDL 1

POP3_STREAM_LINE(27): '-ERR not that many messages'
POP3_STREAM_WRITE(6):
LIST

POP3_STREAM_LINE(4): '+OK '
Got + response
POP3_STREAM_LINE(END)
POP3_STREAM_WRITE(6):
QUIT

POP3_STREAM_LINE(4): '+OK '
Got + response


2. Popping a non-empty mailbox:
-------------------------------

POP3_STREAM_LINE(4): '+OK '
Got + response
POP3_STREAM_LINE(46): '+OK <20440 1113679049 mustang oldcity dca net>'
POP3_STREAM_WRITE(6):
CAPA

POP3_STREAM_LINE(24): '-ERR authorization first'
POP3_STREAM_WRITE(27):
USER rlrevell joe-job com

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(18): '-ERR unimplemented'
POP3_STREAM_WRITE(8):
UIDL 1

POP3_STREAM_LINE(46): '+OK 1 1113679025.20292.mustang.oldcity.dca.net'
Got + response
POP3_STREAM_WRITE(6):
LIST

POP3_STREAM_LINE(4): '+OK '
Got + response"-ERR not that many messages

POP3_STREAM_LINE(6): '1 2075'
POP3_STREAM_LINE(END)
POP3_STREAM_WRITE(6):
UIDL

POP3_STREAM_LINE(4): '+OK '
Got + response
POP3_STREAM_LINE(42): '1 1113679025.20292.mustang.oldcity.dca.net'
POP3_STREAM_LINE(END)
POP3_STREAM_WRITE(8):
RETR 1

POP3_STREAM_LINE(4): '+OK '
Got + response
POP3_STREAM_READ(2048):
Return-Path: <alsa-cvslog-admin lists sourceforge net>
...etc

AFAICT we do 'UIDL 1' first to probe for UIDL support.  According to the
RFCs, '-ERR not that many messages' cannot be reliably distinguished
from '-ERR unimplemented'.

If this is the case then we can just do UIDL then LIST, so the UIDL 1 in
the second case is redundant.

OTOH, if we are allowed to interpret '-ERR not that many messages' and
'-ERR unimplemented' as such, then the LIST in the first case is
redundant as UIDL 1 told us there are no messages.

Regarding LIST, presumably the only reason we do it at all if we have
UIDL is to make sure we don't download a message that we don't have room
to save to disk.  AFAICT if UIDL works then we can just STAT the mailbox
and skip the LIST if the total size isn't a problem, then RETR the
message numbers from UIDL.

Lee




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]