-
-
Notifications
You must be signed in to change notification settings - Fork 2
Crash with davmail, due to non standard server's response formatting (space) #10
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
Comments
The actual lib used by mirador is strict by default, but quirks can be implemented to make rules less strict in order to better fit real world servers. @duesee do we already have a quirk for this particular case? |
Not yet! We could do three things:
I can maybe provide a quirk (workaround) in imap-codec today @soywod :-) Does someone of you can tackle the rest? |
By the way, what a great report @palb91! |
I'll try to find time soon to report the issue to both projects (didn't know about
Ah! I cloned mirador and grepped around the project, but found no relevant information about this particular problem: clues were just in another lib…
Thanks :) I invested quite a bit in detecting and understanding the bug, so I could take some extra time to write a proper bug report. |
Yes, I think DavMail should fix this. The RFC is indeed a bit strange as it clearly mentions extraneous spaces but somehow assumes that only clients can make this mistake... Section 9 is more generic:
That would be awesome :-) By the way... what helped me a few times already is to use the I didn"t manage to provide the quirk in |
Well… I made a mistake during my investigation, the output was 522, and I (manually) wrote 22 in the bug reports. And this change everything!
It's on purpose, mguessan does not follow the RFC when a box has more than 500 messages, cf. this comment in #122:
I'm not sure why not following the RFC is the solution he choose, but there is a workaround in davmail (set Given the comments, the reason behind the additional space and the workaround, I'm pretty sure he won't fix this.
I'll keep it in mind, thanks.
No rush, and now, with these new details, I don't know if this is still relevant to fix. Maybe a note somewhere about this could be enough. |
Oh wow, that was... unexpected :-) I asked @mguessan for a clarification. Maybe we can resolve this in a better way. |
Just a bit of context: select command is usually fast on IMAP servers so there is not mechanism in IMAP to keep the connection alive. As DavMail has to get message list to answer this sometimes ends up in a timeout on IMAP client side. In order to avoid this I had to find a way to keep the connection alive - send something - without breaking - most - IMAP client parsing. By disabling keep alive in DavMail you just make it compliant to IMAP RFC, just make sure the read timeout is high enough to avoid errors with large folders. |
Hi @mguessan, Thanks for reaching us, and for the clarification. You cleared up a small doubt that would have stayed in my mind for a long time.
I did not have the problem but I'll keep that in mind. |
Thanks for the answer @mguessan! I still don't understand the "one vs two spaces trick", though :-( How does I'm asking because lax clients (accepting e.g. multiple spaces) will interpret both response variants in exact the same way. So... I'm kind of missing how it triggers different behavior. |
For work, I have to use o365. So my setup is a mix of davmail (o365 bridge) and msmtp, with a regular sync. I tried to setup goimapnotify, which had a strange bug, and finally fall upon mirador.
However, I cannot use it right now, because of a strange behavior, and I think it is in the parsing of the server's responses (here davmail).
Expected behavior
Easy, it should not crash… interesting stuff below
Current behavior
Same behavior when built from git or from a release, so here is the output of the debug build:
stacktrace when running
$ mirador watch --trace
Debug steps
Because I do not know a lot about IMAP, I went the dumb way. I used netcat to gather requests from mirador, and replicated them in a netcat connected to davmail. Then I took the responses from davmail and replied them to mirador.
Results
The problem occurs when miradors requests
EXAMINE INBOX
, and the davmail responses is not formated as expected.By modifying davmail response, removing the second space, mirador goes further without crashing.
Suggestion
It seems that davmail does not follow the standards, however I'm not sure what is the standard. In a quick parsing of the IMAP RCF, I read that the server SHOULD be strict about syntax, while I don't see the same rule for clients.
Now, I'm not sure if mirador (and other clients) should be less strict, or if davmail should have better responses formatting…
The text was updated successfully, but these errors were encountered: