After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 668247 - Broken non-basic-latin folder name handling
Broken non-basic-latin folder name handling
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Mailer
3.4.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
evolution[imapx]
Depends on:
Blocks:
 
 
Reported: 2012-01-19 08:10 UTC by Milan Crha
Modified: 2013-09-14 16:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
eds patch; (339 bytes, patch)
2012-06-12 09:27 UTC, Milan Crha
committed Details | Review

Description Milan Crha 2012-01-19 08:10:54 UTC
Moving this from a downstream bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=782878

Description of problem:

evolution has stopped processing imap folders with non-basic-latin names

For example when I try to check my 'Sent' folder (Éléments envoyés in French)
evo freezes and displays a yellow bar stating :

Erreur durant Actualisation du dossier « Éléments envoyés ».
Dossier non trouvé : Ãléments envoyés

(can not refresh folder « xxx ». Folder not found yyy)

With another folder called “Dépenses” I have the same error:

Erreur durant Actualisation du dossier « Perso/Dépenses ».
Dossier non trouvé : Perso/Dépenses

This is typical UTF-x mangling

This setup has been working for years and the same folders export fine on the
local webmail

Version-Release number of selected component (if applicable):
evolution-3.3.4-1.fc17.x86_64 using imapx backend

imap server:
dovecot-2.1-0.3.rc1.fc17.x86_64
dovecot-pigeonhole-2.1-0.3.rc1.fc17.x86_64
Comment 1 Milan Crha 2012-04-19 09:39:46 UTC
I just tried to reproduce this with an IMAPx account on a non-dovecot server with your exact folder names which I created through WEB UI of the server and there doesn't happen any folder mangling, the folder is properly updated. Could you retest with 3.4.0 or 3.4.1, please? Also, in case it'll be still reproducible on your side, could you run evolution link this:
   $ CAMEL_DEBUG=imapx evolution &>log.txt
and then enter the folder, please? The log should contain the information which was passed between evolution and the server, thus showing us whether the imapx or server garbled the folder name.
Comment 2 Akhil Laddha 2012-06-08 10:44:29 UTC
Nicolas, can you please provide requested information as per comment#1 ?
Comment 3 Nicolas Mailhot 2012-06-10 11:24:02 UTC
Argh, sorry for the delay the request had fallen through the cracks

I've sent the requested info to both of you by private mail since I'd rather not have this level of personal info hanging on a public bugzilla.

evolution-3.5.2-2.fc18.x86_64
dovecot-2.1.7-2.fc18.x86_64
Comment 4 Milan Crha 2012-06-11 06:37:56 UTC
Thanks for the email. I'm pasting relevant parts of that log here:

The server capabilities:
   [imapx:O] camel_imapx_read: buffer is 'O00271 OK [CAPABILITY IMAP4rev1
   LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY
   THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN NAMESPACE
   UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES
   WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE] Logged in
   '

One of the folders as received from the server:
   * LIST (\Subscribed) "." "Perso.D&AOk-penses"

and as seen be imapx:
   [imapx:?] adding full name 'Perso.Dépenses' '.'
   [imapx:?]   already there

Then a STATUS request done by imapx:
   [imapx:P] Starting command (active=1,) P00342 STATUS Perso.D&AOk-penses
   (MESSAGES UNSEEN UIDVALIDITY UIDNEXT HIGHESTMODSEQ)
   [imapx:P] camel_imapx_write: 'P00342 STATUS Perso.D&AOk-penses (MESSAGES
   UNSEEN UIDVALIDITY UIDNEXT HIGHESTMODSEQ)
   '
   [imapx:P] camel_imapx_read: buffer is '* STATUS {15}
   Perso.Dépenses (MESSAGES 3419 UIDNEXT 4263 UIDVALIDITY 1232478056 UNSEEN 9
   HIGHESTMODSEQ 3880)
   P00342 OK Status completed.
   '

Notice the server returned folder name in the UTF8 encoding, instead of the escaped form, thus imapx code re-encoded it later to
   [imapx:?] find_full: comparing namespace '' to name 'Perso.Dépenses'
   [imapx:P] Got folder path 'Perso/Dépenses' for full 'Perso.Dépenses'
   [imapx:P] Received STATUS for unknown folder 'Perso.Dépenses'
which failed to work properly.

I see two possible fixes:
a) either the server should return folder names always encoded, even
   in the STATUS response
b) or the imapx code should check whether it can convert text or not,
   to not re-encode UTF8 strings
Comment 5 Milan Crha 2012-06-12 09:27:12 UTC
Created attachment 216182 [details] [review]
eds patch;

for evolution-data-server;

There was a bug in camel's utf7 decoder, when it was not decoding anything, then it pushed read char as unichar, which made from it, in case of utf8 char (part of utf8 letter), a broken string. Interestingly, this bug is there since the function exists, 2002-08-28 - commit 2095e8ca.
Comment 6 Milan Crha 2012-06-12 09:30:13 UTC
Created commit 486113c in eds master (3.5.3+)
Created commit 777c487 in eds gnome-3-4 (3.4.3+)