Git Product home page Git Product logo

Comments (18)

jstedfast avatar jstedfast commented on May 17, 2024

What are the last few lines of the log? My guess is that the server response is not complete.

from mailkit.

SaphuA avatar SaphuA commented on May 17, 2024

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.

[External Code] 

MailKit.dll!MailKit.Net.Imap.ImapStream.Poll(System.Net.Sockets.SelectMode mode, System.Threading.CancellationToken cancellationToken) Line 259 + 0x1e bytes C#
MailKit.dll!MailKit.Net.Imap.ImapStream.ReadAhead(byte* inbuf, int atleast, System.Threading.CancellationToken cancellationToken) Line 308 + 0xf bytes C#
MailKit.dll!MailKit.Net.Imap.ImapStream.Read(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) Line 390 + 0x27 bytes C#
MailKit.dll!MailKit.Net.Imap.ImapFolder.FetchMessageBody(MailKit.Net.Imap.ImapEngine engine, MailKit.Net.Imap.ImapCommand ic, int index, MailKit.Net.Imap.ImapToken tok) Line 2717 + 0x65 bytes C#
MailKit.dll!MailKit.Net.Imap.ImapEngine.ProcessUntaggedResponse(System.Threading.CancellationToken cancellationToken) Line 1266 + 0x1c bytes C#
MailKit.dll!MailKit.Net.Imap.ImapCommand.Step() Line 497 + 0x2f bytes C#
MailKit.dll!MailKit.Net.Imap.ImapEngine.Iterate() Line 1340 + 0xf bytes C#
MailKit.dll!MailKit.Net.Imap.ImapEngine.Wait(MailKit.Net.Imap.ImapCommand ic) Line 1368 + 0xa bytes C#
MailKit.dll!MailKit.Net.Imap.ImapFolder.GetMessage(int index, System.Threading.CancellationToken cancellationToken) Line 2878 + 0x1e bytes C#
ClientWish.exe!ClientWish.Robot.Execute() Line 39 + 0x3c bytes C#
ClientWish.exe!ClientWish.Program.Main(string[] args) Line 25 + 0xa bytes C#
[External Code]

from mailkit.

jstedfast avatar jstedfast commented on May 17, 2024

Right, that just means that it expects more data from the server... the question is: why? :-)

from mailkit.

SaphuA avatar SaphuA commented on May 17, 2024

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
S: 21vxAXnDksQavLhyXzurMbROrasXbhvREbsDopi4Ag0D2X+D2IWZ2P3rxngRPsz+ksJbKWpdT1/g
S: j6b1oQHpfVn4eu1HGX38ewDJpOy7aPvhToYv9GVrADLJ5HHWfgO2BDpVf7adBAdXaNK2YbxGvWlF
S: 2VxVd150cQpthBN5MM1+fD+vTIR1W3IlZZZ2EQAk7/uaaDqEi2NtzRJ/IviCe4+m92RQ9JH7+D2A
S: rQTcBNwHXMnT217SyIKtS/jxtWwNltGUhAMRa+DuUcD3tdVLpa/qM4ciFkvWjf+R/KXLsm3autXC
S: XonoR9iIIcLSp0RGbvnb5E341hVTRtemtWHbvJ41k2oiP7kiwnUioLqz7/nKMm13tEQIV7llv+La

from mailkit.

jstedfast avatar jstedfast commented on May 17, 2024

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.

from mailkit.

SaphuA avatar SaphuA commented on May 17, 2024

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!

from mailkit.

jstedfast avatar jstedfast commented on May 17, 2024

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:

  1. the server is broken and thinks it sent the complete response
  2. your network connection dropped
  3. there's a bug in MailKit somewhere (but I can't even imagine where it could be since ImapStream logs to the log file immediately after reading data from the socket)

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.

from mailkit.

SaphuA avatar SaphuA commented on May 17, 2024

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:

  • So far I don't have any problems with the fetch-methods.
  • The GetMessage method works on other e-mails.

What would you recommend is the best way to figure out where the problem is?

from mailkit.

jstedfast avatar jstedfast commented on May 17, 2024

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?

from mailkit.

jstedfast avatar jstedfast commented on May 17, 2024

This is another IMAP client library you could try: https://imapx.codeplex.com/

from mailkit.

SaphuA avatar SaphuA commented on May 17, 2024

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.

from mailkit.

jstedfast avatar jstedfast commented on May 17, 2024

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.

from mailkit.

jstedfast avatar jstedfast commented on May 17, 2024

I committed a patch that may fix your issue if this is the case...

from mailkit.

SaphuA avatar SaphuA commented on May 17, 2024

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.

from mailkit.

jstedfast avatar jstedfast commented on May 17, 2024

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.

from mailkit.

jstedfast avatar jstedfast commented on May 17, 2024

Just released MailKit 0.21 on nuget

from mailkit.

SaphuA avatar SaphuA commented on May 17, 2024

You're the best!

from mailkit.

jstedfast avatar jstedfast commented on May 17, 2024

I try :-)

from mailkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.