cypht-org / cypht

Cypht: Lightweight Open Source webmail aggregator [PHP, JS]. Supports IMAP/SMTP, JMAP and soon EWS
http://cypht.org
GNU Lesser General Public License v2.1
1k stars 161 forks source link

Problem in character encoding in Yahoo imap folders #48

Closed 8wmas closed 8 years ago

8wmas commented 8 years ago

I tested the software yesterday and I saw strange characters (I think that they were utf8 encodings) in the folder names of a yahoo imap account. The folder names were in Greek

jasonmunro commented 8 years ago

Thanks for the feedback. I will test this out and see what I can do.

jasonmunro commented 8 years ago

Confirmed this bug and fixed it with the following commit:

https://github.com/jasonmunro/hm3/commit/bb4f556344f73c913198c5d86931cfdc8773e080

The IMAP library has the ability to handle non-ascii folder name conversion per the RFC, we just did not have it enabled! Thanks again for the feedback.

jasonmunro commented 8 years ago

well, the folder with greek letters displays properly in the folder list, but trying to access it causes multiple errors:

Re-opening this until I clean the rest of these issues up.

jasonmunro commented 8 years ago

OK, I think this is resolved now. We had some hacky work-arounds for odd-ball folder names, but they obviously did not correctly handle a pure non-ascii value. I just pushed the following change-set that utilizes bin2hex and hex2bin to "encode" a folder name so it can be passed around safely in the UI:

https://github.com/jasonmunro/hm3/commit/060a4bd2cb6f0453f22544397f9403371f6ea9e5

This is a much more comprehensive fix than the hacky stuff I had in place before, so thanks again for the report! Any change you could re-test with the current master branch and let me know if it's working correctly?