aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJiri Hruska <jirka@fud.cz>2013-02-26 19:22:42 +0100
committerSteve Holme <steve_holme@hotmail.com>2013-02-26 20:35:41 +0000
commitf92f341a3f385237e553cff6079cdd7c7c3d9292 (patch)
treeeb01484d2f9d8152b0dd836a605e0240838ca156 /lib
parent91b2184e1b443ac941475ad26baabb19d1f8f493 (diff)
imap: Added filtering of CAPABILITY and FETCH untagged responses
Only responses that contain "CAPABILITY" and "FETCH", respectively, will be sent to their response handler.
Diffstat (limited to 'lib')
-rw-r--r--lib/imap.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/imap.c b/lib/imap.c
index 68f765aeb..1c4635f2d 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -391,8 +391,13 @@ static bool imap_endofresp(struct connectdata *conn, char *line, size_t len,
switch(imapc->state) {
/* States which are interested in untagged responses */
case IMAP_CAPABILITY:
+ if(!imap_matchresp(line, len, "CAPABILITY"))
+ return FALSE;
+ break;
+
case IMAP_FETCH:
- *resp = '*';
+ if(!imap_matchresp(line, len, "FETCH"))
+ return FALSE;
break;
/* Ignore other untagged responses */
@@ -400,6 +405,7 @@ static bool imap_endofresp(struct connectdata *conn, char *line, size_t len,
return FALSE;
}
+ *resp = '*';
return TRUE;
}