aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-03-08 21:18:36 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-03-08 21:18:36 +0000
commit1f41772bef4da112d2e3988e791cdd3920d3ae49 (patch)
treef47c4baaecdd6d0f0474e2dcb3ecf345ece4c666
parent21c1de430a83be7900096cd65f2ef680307eb0b5 (diff)
imap: Fixed handling of untagged responses for the STORE custom command
Added an exception, for the STORE command, to the untagged response processor in imap_endofresp() as servers will back respones containing the FETCH keyword instead.
-rw-r--r--lib/imap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/imap.c b/lib/imap.c
index 2ca87b8a0..ae5ec86c2 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -415,9 +415,12 @@ static bool imap_endofresp(struct connectdata *conn, char *line, size_t len,
case IMAP_CUSTOM:
/* When dealing with a custom command, we are interested in all
intermediate responses which match the parameter name. The
- exceptions are SELECT and EXAMINE commands, for which no
- filtering is (or can be easily) done. */
+ exceptions are STORE, which returns untagged responses as FETCH,
+ and SELECT and EXAMINE commands, for which no filtering is (or can
+ be easily) done. */
if(!imap_matchresp(line, len, imap->custom) &&
+ (strcmp(imap->custom, "STORE") ||
+ !imap_matchresp(line, len, "FETCH")) &&
strcmp(imap->custom, "SELECT") &&
strcmp(imap->custom, "EXAMINE"))
return FALSE;