[imp] Folder names with tilde character

Jan Schneider jan at horde.org
Thu Nov 19 18:01:49 UTC 2015


Zitat von Jens Wahnes <wahnes at uni-koeln.de>:

> One of our users created a folder with a tilde ("~") character  
> within the folder name.  This kind of folder name is not handled  
> correctly. When the folder is shown in the folder list, the tilde  
> character is silently dropped.  For instance, if a folder by the  
> name of "~tilde~" is created, it is shown in the mailbox list as if  
> it were called "tilde". As a result, all kinds of bad things happen,  
> e.g. when trying to open the folder, an error message is shown, as  
> there is no folder named just "tilde" present on the server.
>
> I have seen this happening on a server without UTF-8 support (RFC  
> 6855).  Since I don't have access to any IMAP server that does  
> support the "UTF8=ACCEPT" extension, I don't know if it happens on  
> those servers as well.  Maybe someone else can try to see what  
> happens there?

Confirmed on Cyrus (without UTF8=ACCEPT capability).

> After a very long search, I found out that this problem is caused by  
> the code in the Horde_Imap_Client_Tokenize class, or more precisely  
> the code within the "next" method on line 292 or so.  There is a  
> comment attached to the "case" statement in question which reads  
> "Ignore binary string identifier. PHP strings are binary-safe", but  
> even after reading quite a bit of the surrounding code, I fail to  
> understand what is meant by that comment.  The only other location I  
> found which seems to deal with this is on line 209 or so, in the  
> getLiteralLength method.
>
> Disabling the code that sorts out tilde characters around line 292  
> of Tokenize.php sure does help to resolve the problem of folder  
> names with a tilde character being displayed incorrectly in IMP.   
> AFAICT, this does no harm to folder names that do in fact contain  
> "binary" characters such as "Äpfel ≠ Birnen".  However, I'm not  
> really sure if this kind of change might still have side effects  
> that I cannot foresee.  Maybe someone more familiar with the  
> Horde_Imap_Client code can tell if it is safe to disable that  
> particular piece of code?

I have a local fix, but cannot test it on a UTF8 server. If anyone  
could jump in here?

-- 
Jan Schneider
The Horde Project
http://www.horde.org/



More information about the imp mailing list