bertjohnson/OpaqueMail

email message returning null on 1st call.

Opened this issue · 1 comments

Hello again.

Ran into another odd issue. Had a user have another problem getting an email. Had them forward it to me and I too saw the issue with the forwarded email.

When using the Async methods it returns a null message (imapClient.GetMessagePartialHelper line 2384
response = await ReadDataAsync(commandTag, "FETCH"); returns "0 obj " not anything containing rn so it return null.

In the Form1.ImapMessageList_SelectedIndexChanged( ) if I put an if in If (message == null)) I can try again

if (message == null)
{
//try again
// Resume idling.
await myImapClient.IdleStartAsync();

                                // Stop idling to resume commands.
                                if (myImapClient.IsIdle)
                                    await myImapClient.IdleStopAsync();

and rerun the logic
and it works fine.

I however can not seem to do this if run the non-async methods.

Any thoughts on how it can be pulled not as null or make a similar non-async process work like the above. I can try sending you the email.

(I don't know how this one person keeps getting legit businesses sending these odd email formats)

Hi kalzon1, thanks for this report.

I'm trying to recreate this, but have not been successful yet. I suspect this is related to the IDLE command. Without understanding the cause, I'm not sure of the best approach.

The synchronous method merely wrap the asynchronous results and parse the .Result, so I'm not sure why behavior would be different.