-
-
Notifications
You must be signed in to change notification settings - Fork 805
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
GetMessage endless loop #66
Comments
What are the last few lines of the log? My guess is that the server response is not complete. |
So I just downloaded the source. Here's the call-stack of where it's stuck. It's in the do-while of the Poll method.
|
Right, that just means that it expects more data from the server... the question is: why? :-) |
And these are the last lines of the log. They are part of the base64 encoded image. S: /ErV8M0HO9OzWX9PP07vTf3Te/FxNw1Kv4ceTetNAzJ600/4+6iNPWh+3t9SYUVYABF/oC/duqpG |
If those are the last few lines, then the server response is incomplete. There should be a response like: S: A0000016 OK ... Until that line is received, the server response is incomplete. |
Hmm, I guess you are right. I just copy/pasted the base64 string to a website that can decode base64 and only got halve the expected image as a result. So I guess the next question is; what is the cause of the incomplete response? Btw, thanks a lot for your quick responses! |
No prob, you mostly just got lucky that I was just checking for new bug reports minutes after you filed it :p There are a couple possibilities off the top of my head:
Does the log file end in the same place every time you run it? If so, that might indicate 1 (or 3). It could still be 2, but less likely. If it ends in different places, that could indicate any of the above. |
Yes it keeps loggin the exact same response on every try. I will go and experiment with the fetch-methods to see if they yield the same results. Update:
What would you recommend is the best way to figure out where the problem is? |
Ok, so I guess that means we can rule out flaky network (probably, anyway). Can you test another client downloading that particular message? Just trying to rule out a bug in MailKit. If other clients break in the same way on that message, then it suggests it's probably a bug in the server. What server is this, btw? |
This is another IMAP client library you could try: https://imapx.codeplex.com/ |
It's an exchange server. I'm not sure about the version, but I guess either 2007 or 2010. I'm having issues retrieving the folders using ImapX, will let you know when I get further. I'm about to call it a day ;) Edit: Oops pressed close issue. |
I may have an idea what is causing the problem. Are you using SSL by chance? It might be that the SslStream has already buffered the remainder of the data and so the Poll() would block forever waiting for data that has already been read from the socket by the SslStream. |
I committed a patch that may fix your issue if this is the case... |
Excellent, it's working now! i'm not 100% sure if exchange is configured to use SSL, but I'm pretty sure you've guessed right. Thanks a lot! Edit: Will you be releasing an update to nuget any time soon? Would rather use nuget than include the source in my project. |
Yea, I'll be releasing a new version soon (by Monday morning the latest - which is my usual release date), but possibly today. I'd like to try to clean up the new logic a bit first. Thanks for testing it out and getting back to me. |
Just released MailKit 0.21 on nuget |
You're the best! |
I try :-) |
Hello,
This is the first time I'm using MailKit and I'm trying to get the IMAP sample to work.
Unfortunatly something seems to be going wrong during the GetMessage call. It seems to be in an endless loop and never returns out of the method.
I added a ProtocolLogger to the ImapClient and according to the log it does actually download the entire message properly. The last thing logged is the retrieval of an image:
S: --002_2A8DFCCDD7437146AA5EE829D9FC63918384E934HVMSGWP25troika
S: Content-Type: image/png; name="image001.png"
S: Content-Description: image001.png
S: Content-Disposition: inline; filename="image001.png"; size=8154;
S: creation-date="Tue, 17 Jun 2014 12:53:40 GMT";
S: modification-date="Tue, 17 Jun 2014 12:53:40 GMT"
S: Content-ID: image001.png@01CF8A3B.ED0D5050
S: Content-Transfer-Encoding: base64
S:
S: iVBORw0KGgoAAAANSUhEUgAAAIEAAAArCAYAAABfJ+vYAAAABGdBTUEAALGOfPtRkwAAACBjSFJN
S: AACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKL2lDQ1BJQ0MgUHJvZmlsZQAA
S: SMedlndUVNcWh8+9d3qhzTACUobeu8AA0nuTXkVhmBlgKAMOMzSxIaICEUVEmiJIUMSA0VAkVkSx
S: EBRUsAckCCgxGEVULG9G1ouurLz38vL746xv7bP3ufvsvc9aFwCSpy+XlwZLAZDKE/CDPJzpEZFR
S: dOwAgAEeYIApAExWRrpfsHsIEMnLzYWeIXICXwQB8HpYvAJw09AzgE4H/5+kWel8geiYABGbszkZ
S: LBEXiDglS5Auts+KmBqXLGYYJWa+KEERy4k5YZENPvsssqOY2ak8tojFOaezU9li7hXxtkwhR8SI
etc. etc. etc.
What could be going wrong that causes the GetMessage to be in an endess loop? What other information can I share?
My guess is that MailEngine.Wait is pretty dangerous. Guess I will have to download the source to do some debugging.
Thanks!
The text was updated successfully, but these errors were encountered: