aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-03-05 22:04:03 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-03-05 22:04:03 +0000
commit198012ee1376707718084e57e30771824edf2847 (patch)
tree59246f204284ac3704cc1d30476ea8756e3165e8
parent742544aad0f5111b76def448e1e72c3338e0b43b (diff)
imap: Added support for list command
-rw-r--r--lib/imap.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/imap.c b/lib/imap.c
index aae474c6b..bc96938de 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -1837,7 +1837,8 @@ static CURLcode imap_done(struct connectdata *conn, CURLcode status,
conn->bits.close = TRUE; /* marked for closure */
result = status; /* use the already set error code */
}
- else if(!data->set.connect_only && !imap->custom) {
+ else if(!data->set.connect_only && !imap->custom &&
+ (imap->uid || data->set.upload)) {
/* Handle responses after FETCH or APPEND transfer has finished */
if(!data->set.upload)
state(conn, IMAP_FETCH_FINAL);
@@ -1914,12 +1915,15 @@ static CURLcode imap_perform(struct connectdata *conn, bool *connected,
else if(imap->custom && (selected || !imap->mailbox))
/* Custom command using the same mailbox or no mailbox */
result = imap_custom(conn);
- else if(!imap->custom && selected)
+ else if(!imap->custom && selected && imap->uid)
/* FETCH from the same mailbox */
result = imap_fetch(conn);
- else
+ else if(imap->uid)
/* SELECT the mailbox */
result = imap_select(conn);
+ else
+ /* LIST */
+ result = imap_list(conn);
if(result)
return result;