From d80a0bae042c18f5eb5a8d19a19446b9a68962bc Mon Sep 17 00:00:00 2001 From: alexhudson Date: Sat, 10 Jul 2010 15:14:10 +0000 Subject: [PATCH] pop3: don't list non-mail items as being mail. --- src/agents/pop/pop3.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/agents/pop/pop3.c b/src/agents/pop/pop3.c index 84231f4..a4073e1 100644 --- a/src/agents/pop/pop3.c +++ b/src/agents/pop/pop3.c @@ -493,7 +493,7 @@ LoadIDList(POP3Client *client) int ccode; int result; unsigned long allocCount; - unsigned int flags; + unsigned int flags, type; unsigned long size; uint64_t guid; MessageInformation *tmpList; @@ -540,13 +540,13 @@ LoadIDList(POP3Client *client) } } - result = sscanf(client->buffer, "%*u %llx %*u %u %*x %*u %lu %*s", &guid, &flags, &size); - if(result != 3) + result = sscanf(client->buffer, "%*u %llx %u %u %*x %*u %lu %*s", &guid, &type, &flags, &size); + if(result != 4) { /* sscanf failed - must have been passed a bad LIST string - bail out! */ ccode = -1; break; } - if (!(flags & STORE_MSG_FLAG_DELETED)) { + if (!(flags & STORE_MSG_FLAG_DELETED) && (type == 2)) { client->message[client->messageCount].guid = guid; client->message[client->messageCount].size = size; client->messageCount++;