Jan said:
what does the POP3 server need to do in order for Outlook to download the
headers and work with "leave copy of messages at server" checked?
The server doesn't need anything. It complies with the commands that
YOUR e-mail client sends to it. The default behavior for POP is to send
a RETR (retrieve) command and then follow with a DELE (delete) command.
The server is simply doing what it was told.
If you configure your e-mail client to "leave messages on server" then
your e-mail *client* does the RETR but omits the following DELE command.
I thought that TOP command should do for the headers, and simply Outlook not
issuing DELE should leave the messages on server. However, Outlook still
says the server does not support header downloading and does not work at all
if I leave the checkbox checked.
TOP only retrieves the headers. "TOP n" retrieves the headers and the
first n lines of the body. For normal mail polls, Outlook issues only
the RETR and DELE commands. If you configure Outlook to "download
headers only" then perhaps it does use the TOP command.
If the mail server receives a TOP command but rejects it then you cannot
use TOP commands with that mail server. Outlook establishes a mail
session with the mail server, does LIST and UID commands to see what
items are on the mail server (the mail client keeps track of what is new
or old based on the message IDs it has recorded for prior items). If
the client sends a TOP command and gets an error then it could be the
mail server won't support that command. It should but maybe it doesn't.
The format for the command is "TOP msgnum nlines". nlines is how many
lines of the body to include with the headers (0 means don't fetch any
body lines). msgnum refers to the relative index number of the item for
which you want to retrieve the headers (and body lines). This message
must not have been deleted (it is possible the server has deleted a
message without updating the message list to reindex their relative
IDs). If the status returned by the server is -ERR then a message with
that ID does not exist (it has been deleted). The ID is received from
the LIST command, so if the mail server is reporting an invalid list of
indexes then the client is going to request messages that don't exist
anymore.
Whether the mail server won't handle TOP commands or is returning a
bogus index list then used by the client in a TOP command is still a
problem up on the mail server. The client can only go by the info given
to it by the server. Also, some e-mail services may claim they provide
POP access but are not truly POP3 compliant. For example (I haven't
retest this for awhile), Gmail will treat identically the TOP and RETR
commands, and it will ignore the DELE command from the client because
the user decides that behavior with a server-side configuration setting.
Gmail doesn't use POP. It uses gPOP: Gmail's version of POP. It works
well enough for "normal" access by e-mail clients, but then e-mail
clients don't normally issue just the TOP command to retrieve messages
(either the headers only or headers with n lines of the body).
For a POP3-compliant e-mail client, it should send the RETR command
followed by the DELE command unless you enable its "leave message on
server" option which omits the DELE command. If it is configured to
retrieve headers only using the TOP command, it will use the same
message numbers returned by the LIST command. If the mail server is
returning message numbers for items already deleted, well, the client
won't know that until it attempts to issue the TOP command then gets
back an "-ERR no such message" error status. The client can't help
getting an error if the mail server lied to it.
If not trying to go outside the norm box with a Gmail account, you might
want to contact your e-mail provider and have them reset your mailbox.
It's possible something got out of sync. A reset probably means you
lose everything currently in your mailbox so ask about that before doing
a reset if you saved some messages in your mailbox (up on the server)
before having it reset.