On Wed, 25 Jul 2001, Eric S. Raymond wrote:
Justin Guyett <jfg(_at_)sonicity(_dot_)com>:
Summary: fetchmail doesn't handle "NO" responses to FETCH, and needs to.
Probably needs to handle "BAD" responses too.
Are you using an old version? Looking in imap.c, I see:
if (strncmp(cp, "OK", 2) == 0)
{
if (argbuf)
strcpy(argbuf, cp);
return(PS_SUCCESS);
}
else if (strncmp(cp, "BAD", 3) == 0)
return(PS_ERROR);
else if (strncmp(cp, "NO", 2) == 0)
{
if (stage == STAGE_GETAUTH)
return(PS_AUTHFAIL); /* RFC2060, 6.2.2 */
else
return(PS_ERROR);
}
else
return(PS_PROTOCOL);
which certainly looks as though "BAD" and "NO" are handled.
Those handle "BAD" and "NO" responses for [some] other command[s], not
FETCH (when fetching headers). relevant code is around 672-680 (5.8.14)
in imap_fetch_headers(). The quick patch that worked well enough for me
(since the message wasn't important) was to do a sscanf() looking for NO
instead of FETCH, and if so return 100 (unused error code), then wherever
that gets called from (I forget), i just continued the loop if I saw that
error.
justin
--