diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp index f2136e66ab..15e0ab1af8 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPHandler.cpp @@ -192,8 +192,6 @@ FetchMinMessageCommand::Command() bool FetchMinMessageCommand::Handle(const BString& response) { - if (response.FindFirst("FETCH") < 0) - return false; BString extracted = response; int32 message; if (!IMAPParser::RemoveUntagedFromLeft(extracted, "FETCH", message)) @@ -210,6 +208,9 @@ FetchMinMessageCommand::Handle(const BString& response) if (!ParseMinMessage(extracted, minMessage)) return false; + if ((minMessage.flags & kDeleted) != 0) + return true; + fMinMessageList->push_back(minMessage); fStorage.AddNewMessage(minMessage.uid, minMessage.flags, fData); return true; @@ -284,8 +285,6 @@ FetchMessageListCommand::Command() bool FetchMessageListCommand::Handle(const BString& response) { - if (response.FindFirst("FETCH") < 0) - return false; BString extracted = response; int32 message; if (!IMAPParser::RemoveUntagedFromLeft(extracted, "FETCH", message)) @@ -295,6 +294,9 @@ FetchMessageListCommand::Handle(const BString& response) if (!FetchMinMessageCommand::ParseMinMessage(extracted, minMessage)) return false; + if ((minMessage.flags & kDeleted) != 0) + return true; + fMinMessageList->push_back(minMessage); return true; } @@ -345,8 +347,6 @@ FetchMessageCommand::Command() bool FetchMessageCommand::Handle(const BString& response) { - if (response.FindFirst("FETCH") < 0) - return false; BString extracted = response; int32 message; if (!IMAPParser::RemoveUntagedFromLeft(extracted, "FETCH", message)) diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp index 1856b4384a..7cf236808d 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/IMAPMailbox.cpp @@ -157,6 +157,7 @@ IMAPMailbox::StartWatchingMailbox() if (status != B_OK) break; } + atomic_set(&fWatching, 0); return status; }