From 5a52b46d72abea688eda72c403634ec95046db40 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Fri, 10 Dec 2010 13:47:13 +0100 Subject: Hack: support quoted string in imap_fetch_body() This is seen on Yahoo in * 123 FETCH (BODY[TEXT] ""), reported by Yasin Malli. --- NEWS | 3 +++ imap.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/NEWS b/NEWS index db7a5393..62481fb5 100644 --- a/NEWS +++ b/NEWS @@ -81,6 +81,9 @@ fetchmail-6.3.19 (not yet released): * Do STARTTLS/STLS negotiation in IMAP/POP3 if it is mandatory even if the server capabilities do not show support for upgradation to TLS. To use this, configure --sslproto tls1. (Sunil Shetye) +* IMAP: Understand empty strings as FETCH response, seen on Yahoo. Reported by + Yasin Malli to fetchmail-users@ 2010-12-10. + Note that fetchmail continues to expect literals as FETCH response for now. # DOCUMENTATION * The manual page now links to IANA for GSSAPI service names. diff --git a/imap.c b/imap.c index 11b206c0..1364027f 100644 --- a/imap.c +++ b/imap.c @@ -1264,6 +1264,13 @@ static int imap_fetch_body(int sock, struct query *ctl, int number, int *lenp) return PS_SUCCESS; } + /* Understand the empty string. Seen on Yahoo. */ + /* XXX FIXME: we should be able to handle strings here. */ + if (strstr(buf+10, "\"\")")) { + *lenp = 0; + return PS_SUCCESS; + } + /* * Try to extract a length from the FETCH response. RFC2060 requires * it to be present, but at least one IMAP server (Novell GroupWise) -- cgit v1.2.3