diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2005-12-18 10:34:10 +0000 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2005-12-18 10:34:10 +0000 |
commit | 6644861f4b616b3e42bc4143109e6b478ca52849 (patch) | |
tree | 9d68816c1a0c460d2f01aa5d838ffb8e3376ece1 /imap.c | |
parent | d0304cda6113de61094373faa6d44dd8a94b4de1 (diff) | |
download | fetchmail-6644861f4b616b3e42bc4143109e6b478ca52849.tar.gz fetchmail-6644861f4b616b3e42bc4143109e6b478ca52849.tar.bz2 fetchmail-6644861f4b616b3e42bc4143109e6b478ca52849.zip |
Use a simplified version of Sunil's patch to cope with servers
such as mail.internode.on.net bld-mail04 that return the UID in response
to RFC822.HEADER or RFC822.SIZE. Reported by Jason White.
svn path=/branches/BRANCH_6-3/; revision=4555
Diffstat (limited to 'imap.c')
-rw-r--r-- | imap.c | 29 |
1 files changed, 24 insertions, 5 deletions
@@ -875,12 +875,21 @@ static int imap_getpartialsizes(int sock, int first, int last, int *sizes) ; else if (strstr(buf, "OK") || strstr(buf, "NO")) break; - else if (sscanf(buf, "* %u FETCH (RFC822.SIZE %u)", &num, &size) == 2) + else if (sscanf(buf, "* %u FETCH (RFC822.SIZE %u)", &num, &size) == 2 + /* some servers (like mail.internode.on.net bld-mail04) return UID information here + * + * IMAP> A0005 FETCH 1 RFC822.SIZE + * IMAP< * 1 FETCH (UID 16 RFC822.SIZE 1447) + * IMAP< A0005 OK FETCH completed + * + */ + || sscanf(buf, "* %u FETCH (UID %*s RFC822.SIZE %u)", &num, &size) == 2) { if (num >= first && num <= last) - sizes[num - first] = size; + sizes[num - first] = size; else - report(stderr, "Warning: ignoring bogus data for message sizes returned by the server.\n"); + report(stderr, + GT_("Warning: ignoring bogus data for message sizes returned by the server.\n")); } } @@ -948,8 +957,18 @@ static int imap_fetch_headers(int sock, struct query *ctl,int number,int *lenp) if ((ok = gen_recv(sock, buf, sizeof(buf)))) return(ok); ptr = skip_token(buf); /* either "* " or "AXXXX " */ - if (sscanf(ptr, "%d FETCH (%*s {%d}", &num, lenp) == 2) - break; + if (sscanf(ptr, "%d FETCH (RFC822.HEADER {%d}", &num, lenp) == 2 + /* some servers (like mail.internode.on.net bld-mail04) return UID information here + * + * IMAP> A0006 FETCH 1 RFC822.HEADER + * IMAP< * 1 FETCH (UID 16 RFC822.HEADER {1360} + * ... + * IMAP< ) + * IMAP< A0006 OK FETCH completed + * + */ + || sscanf(ptr, "%d FETCH (UID %*s RFC822.HEADER {%d}", &num, lenp) == 2) + break; /* try to recover from chronically fucked-up M$ Exchange servers */ else if (!strncmp(ptr, "NO", 2)) { |