fetchmail-friends
[Top] [All Lists]

Re: [fetchmail] Problem trying to fetch from a mbox containing a dummy IMAP message

2002-06-21 01:05:36
Pierre-Michel Ansel <pma(_at_)whitepj(_dot_)com>:
For the first time, i was faced with an email inbox that contains
this fake message with the X-IMAP header used by IMAP clients to
resynchronize their state from a previous session with the server
(if what i have read on some forums is accurate).

The problem that i have is that fetchmails retrieves this dummy
message and then, decides not to fetch it ('retained'):

see transact.c, function readheaders

/*
 * The University of Washington IMAP server (the reference
 * implementation of IMAP4 written by Mark Crispin) relies
 * on being able to keep base-UID information in a special
 * message at the head of the mailbox.  This message should
 * neither be deleted nor forwarded.
*/
if (num == 1 && !strncasecmp(line, "X-IMAP:", 7)) {
      free(line);
      free(msgblk.headers);
      msgblk.headers = NULL;
      return(PS_RETAINED);
}

Because of the -e 1 option given to fetchmail, it issues a QUIT
(this option cannot be changed as I need to protect myself from
line drops) and then reconnects and gets the same dummy message
again and again, never fetching the remaining messages.

My question is the following :
Is there a way, without changing/removing the -e 1 option,
to fetch emails using the POP3 protocol from a mail box in which
the first message is a "dummy X-IMAP message"?.

No.  Use IMAP for this. 
 
Another question would be : Is it normal that the POP protocol
shows this dummmy message or should it be hidden to the POP clients?

It's not clear to me what the right thing is, here.  A possible fix
would be to delete this message rather than retaining it if the user is
running POP3.  But that might clobber information the user actually 
wants for subsequent IMAP runs.

I'm inclined to just document this as a known problem.
-- 
                <a href="http://www.tuxedo.org/~esr/";>Eric S. Raymond</a>


<Prev in Thread] Current Thread [Next in Thread>