-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imap GetMessage returns null message #1
Comments
My bad. GetMessages(0, count, false) returns one less message as well. If count is 3 I get 2 messages. I verified that all three messages are actually there via my gmail account. |
Ok, I figured it. If I instantiate a new imap client after discovery of a new email message (by looping on GetMessageCount), the new message shows up in GetMessages(...) |
I'm now experiencing the same behavior after the 1.5.3 update, though I'm not sure if it's caused by the same issue. x.Add(mail); response = _Reader.ReadLine(); // read last line terminated by ) response = _Reader.ReadLine(); // read next line Immediately after calling the second _Reader.ReadLine(); the function terminates, so I'm assuming there's an exception or something in ReadLine causing it. Essentially, the new mail message is never returned from the function. |
After stepping in, it looks like there are no responses left, so Responses.Take() is causing the thread to bomb perhaps and we are not seeing the exception? I noticed that it did not receive NewMessage events after that occurred, even though I sent a few more messages to that inbox, so that would back up my theory that the whole thread is dying. |
I am having the same issue. My downloading code worked fine before I upgraded the library to 1.5.3 but now that I did the getMessage returns null. |
Does anyone else facing the issue that getMessage() with an option to return full email instead of headerOnly, simply returns null. For me its reproducable with the following block of code: Thanks for any suggestions. |
That's what I was talking about. http://www.megaupload.com/?d=N947ESCI @petersondrew I couldn't spot the double call to getResponse in 1.5.3, has it been corrected ? |
@piher Yes, I referenced the pull request that @andyedinborough merged in above. |
@piher, @petersondrew Also the latest fixed branche of andy is not fixing the issue. You can try it easily with this line of code: This should only return all headers of the selected mailbox. I was selecting a different mailbox as INBOX Thanks. |
There seems to be a ReadResponse() still missing in TextClient.cs
Seems the line was deleted in some latest push, so it must have made something else break down.. but for now this seems to work for me |
@RaduPoenaru yeah if you look at this pull request #17 |
I guess it's all a matter of what usage pattern you have: I use a cycle of GetMessage(i,headersonly=true) followed imediately by GetMessage(i,headersonly=false).. and that combination seems to require the extra GetResponse() there or the response queue was getting out of sync (ie. growning a lot) and every second call the returned MailMessage was null. |
The double GetResponse() fixed my issue. The context was getting mail headers in a loop. |
It looks like the GetMessages method would return with the closing "{tag} OK" message still in the queue. I've added code to read from the queue until the OK message is found. I'm guessing that sometimes it was returned the first time, and sometimes it wasn't. Please check this fix in all your scenarios and let me know. |
I've recently downloaded AE.Net and just love it :) However, I'm facing a problem similar to the other ones in this thread. The code below will result a null 'm' variable. In fact: no matter what index a pass, it comes back with null. I tried to download a fix from andyedinborough (#26 & #1), but it won't compile in my project. Any suggestions?
|
Having the exact same issue with same scenario as nike2. |
If there are 3 messages in my gmail account imap GetMessageCount() returns 3 but if I iterate over the messages (starting from index zero) I get two non-null messages and one null message. If the account only has one message in it GetMessageCount() returns 1 and GetMessage(0) returns NULL. GetMessages(0, count - 1, false) appears to work properly. I'm using the latest release as of this posting.
The text was updated successfully, but these errors were encountered: