This project is read-only.

behavior when accessing deleted mail

Nov 5, 2013 at 8:49 AM
I'm actually testing the behavior of cuncurrent accessing mails in one mailbox. When downloading messages in a loop, there is a NullReferenceException thrown in case of one message is deleted in the meanwhile. Would be nice if this case is handled explicitly. For example return false in message.Download(), or message gets something like a state property saying "deleted".
foreach (var message in _client.Folders.Inbox.Messages)
    bool downloadOk = message.Download(ImapX.Enums.MessageFetchMode.Full);
NullReferenceException. Object reference is not set to an instance of an object
ln 210 if(ContentStream.EndsWith(")"))

ImapX.dll!ImapX.MessageContent.ProcessCommandResult(string data) Line 210
ImapX.dll!ImapX.ImapBase.SendAndReceive(string command, ref System.Collections.Generic.IList<string> data, ImapX.Parsing.CommandProcessor processor, System.Text.Encoding encoding) Line 351 + 0x1f bytes
ImapX.dll!ImapX.MessageContent.Download() Line 237 + 0xe0 bytes
ImapX.dll!ImapX.Message.Download(ImapX.Enums.MessageFetchMode mode, bool reloadHeaders) Line 533 + 0x12 bytes

Nov 5, 2013 at 9:01 AM
Hi Thorsten,

there's an update coming which will improve thread-safety of the library, and I will also consider the issue you mentioned! Thank you!