IMAP mailbox names fully support Unicode but use a rather exotic ASCII-safe modified UTF7 encoding.
See https://tools.ietf.org/html/rfc3501#section-5.1.3
Having local directories (Maildir) named as
&BB4EQgQ,BEAEMAQyBDsENQQ9BD0ESwQ1-
&BB4EQgQ,BEAEMAQyBDsENQQ9BD0ESwQ1-.takoe
&BB4EQgQ,BEAEMAQyBDsENQQ9BD4-
...makes no sense and is almost unusable.
isync should support re-encoding mailbox names when storing them as directories on local filesystem.
If I have some time I could implement it myself, however I'm quite busy right now and I wouldn't really know where to start.
yes, it's in the TODO file. ;)
see also https://sourceforge.net/p/isync/mailman/message/34877422/.
Thanks for the great tool! I had to make a workaround by using channels to map remote UTF7 names to local UTF8.
It would be indeed great to make the concersion transparant, so I join the feature request. Just in case, the implementation of the conversion itself can be found e.g. in mutt source code
https://gitlab.com/muttmua/mutt/blob/master/imap/utf7.c
I had this issue with a directory that was a person's name. It contains a ł character.
Instead isync when it pulls down the folder shows it as
&AUI-This is really annoying because I have a heap of folders I created in Thunderbird where I copied the person's name from their To: header.
I took look at the code to see if I had some idea on how to accomplish that (Yeah, not having my diacritics correctly annoys me ^)
drv_imap.c looks like the place to start, but I'm not sure which functions should be modified to deal with encoded mailbox names.
I guess the one in driver.h which deal with mailboxes.
If anyone has pointers, I'll be glad to hear them.
(As far as I can tell the conversion itself does not seem complicated, provided it use iconv).
parse_list_rsp_p2() should be the only one that needs decoding.
for encoding, it might make sense to add a new conversion to imap_vprintf(), either a new flag to %s (e.g. %^s) or a new conversion specifier (e.g. %S) (i'd favor the former).
I'm starting to have something. What's the best channel to continue the discussion and send patches ?
traditionally the mailing list.
When is this planned for release?
Last edit: Roland Puntaier 2020-05-12
i had entirely forgotten about it, but there is a MR at https://sourceforge.net/p/isync/isync/merge-requests/3/ :}
instead of modifying imap_printf() it concentrates the logic in prepare_name(). it does so incorrectly (it forgets about the prefix; fixable by doing the encoding after the concatenation) and LIST is not covered at all (fixable by using prepare_name() with "*" for the name), but the approach is arguably less cryptic and even more efficient (the same box name isn't re-encoded for every STOREd message).
commit 52c063fd4 in master fixes this.
there is also efab63fb8 which enables utf-8 support.