6.0.0-git
2019-03-19

[#1161] Error in utf7-imap parsing when building folder tree
Summary Error in utf7-imap parsing when building folder tree
Queue IMP
Queue Version 4.0.1
Type Bug
State Resolved
Priority 2. Medium
Owners Horde Developers (at) , jan (at) horde (dot) org
Requester jlaur-horde (at) vindvejr (dot) dk
Created 2005-01-14 (5177 days ago)
Due
Updated 2006-03-18 (4749 days ago)
Assigned 2005-08-15 (4964 days ago)
Resolved 2006-03-18 (4749 days ago)
Milestone
Patch No

History
2006-03-18 16:08:02 Chuck Hagenbuch State ⇒ Resolved
 
2006-03-18 11:23:49 jacob-horde (at) vindvejr (dot) dk Comment #15 Reply to this comment
You are right, it's fixed in the latest release (Horde 3.1, IMP 4.1). 
All issues are now resolved, so you can close this case.
2006-03-18 01:24:32 Michael Slusarz Comment #14 Reply to this comment

[Show Quoted Text - 9 lines]
I can't reproduce this in either IMP 4.1.0 or HEAD.  The folder name 
is correctly escaped in both.
2006-03-18 00:31:41 jacob-horde (at) vindvejr (dot) dk Comment #13 Reply to this comment
You don't have the iconv and mbstring extensions installed.
  Thanks a lot, that fixed the original problem. Sorry! Would it be 
possible for Horde to detect the absence of these extensions, to help 
stupid administrators? iconv should be possible to detect, at least in 
;= PHP 4.3.0. A warning would be nice, since it seems to be mandatory.
  The JavaScript problem I mentioned in my last comment still applies, 
should I post this as a new report?



Kind regards,

  Jacob Laursen


2006-03-17 13:23:10 Jan Schneider Comment #12
State ⇒ Not A Bug
Reply to this comment
You don't have the iconv and mbstring extensions installed.
2006-03-17 12:56:27 jacob-horde (at) vindvejr (dot) dk Comment #11 Reply to this comment
There's another problem: The compose window can't be opened from the 
folder of same name, because of the ':



javascript:open_compose_win('thismailbox=INBOX.Caf%26AOk--du-ve%27+Forever');



Seen in the browser as:

javascript:open_compose_win('thismailbox=INBOX.Caf%26AOk--du-ve'+Forever');



Looks like ' isn't escaped correctly for the JavaScript to work.



Anyway, back to the original problem. My PHP and imap/c-client:



archive md5sum

imap-2004g.tar.Z 9a80f58d8d6a0979c13714ae69050020

php-4.4.2.tar.bz2 28051cd9ef43490dd9727a4d442011b5



imap is built with "make slx" - no other options. PHP is configured like this:



./configure --with-mysql=/usr/local/mysql \

         --with-apxs=/usr/local/apache/bin/apxs \

         --with-zlib \

         --enable-exif \

         --with-gd \

         --with-jpeg-dir=/usr/src/jpeg \

         --with-gettext \

         --with-imap=/usr/src/imap \

         --with-imap-ssl \

         --with-xml \

         --with-dom



So I think it's a pretty basic/standard setup. Any suggestions what I 
should try to change? I can try to have a look at imap_utf7_encode() 
and see which system dependencies it has. But I still wonder why the 
problem doesn't show for the folder list in IMP. Is imap_utf7_encode() 
used in exactly the same way? I'll have another look, perhaps this 
weekend.



A friend of mine is using PHP 4.4.1 and imap2004g also, without any 
problems. I just can't spot the one important difference in our setups.



Kind regards,

  Jacob Laursen


2006-03-05 21:32:33 Michael Slusarz Comment #10 Reply to this comment
I can' t reproduce this.  This kind of sounds like your PHP/c-client 
combo is broken since we use imap_utf7_encode() to do the encoding.
2006-03-03 18:53:44 jacob-horde (at) vindvejr (dot) dk Comment #9 Reply to this comment
Yes, it is still happening. I just tested with the current version of 
horde (3.0.9) and imp (h3-4.0.4).



The folder was created with Thunderbird (for Windows) and has (as 
mentioned earlier) the following name in the filesystem:



.Caf&AOk--du-ve'



This displays correctly as "Café-du-ve'" in IMP's folder list, but is 
truncated after the first three characters ("Caf") in Horde's menu and 
in the box when choosing to rename the folder.



After renaming the folder in Horde to "Café-du-ve'" (the same name 
that I wanted it to have), it's displays correctly, but in Thunderbird 
it now appear as "Caf-du-ve'", i.e. the "é" character is stripped. In 
the filesystem this becomes:



.Caf&6Q--du-ve'



Since I initially reported the problem, I've upgraded from RedHat 7.2 
til Fedora Core 4 and from Courier IMAP 2.x to 4.x. So I've replaced 
all system components.



Can this be a charset problem, perhaps fixable in Horde's 
configuration? What wonders me the most is that some parts of Horde 
can display the folder name correctly, while other parts can't.



/Jacob
2005-09-05 23:56:08 Chuck Hagenbuch Comment #8
State ⇒ Stalled
Reply to this comment
Back to stalled.
2005-08-15 23:15:40 Jan Schneider Comment #7
State ⇒ Feedback
Reply to this comment
Is this still happening? If yes, you need to provide more details, or 
try to track this further down.
2005-02-07 11:23:36 Jan Schneider Comment #6
State ⇒ Stalled
Reply to this comment
I'm sorry, but I still can't reproduce this at all. Until someone is 
able to find out where, how, and why exactly this is happening, this 
ticket is being stalled.
2005-01-19 16:21:12 jlaur-horde (at) vindvejr (dot) dk Comment #5 Reply to this comment
I'm using IE 6.0.2800.1106. Encoding is set to Western European (ISO). 
I've tried to switch to Western European (Windows) and Unicode 
(UTF-8), but this doesn't change the appearance.



It happens both on the initial load and when I refresh the sidebar later on.



Which browser? Good point. I've just tried with Firefox 1.0 - no 
problems! So it must be some IE compatibility issue?
2005-01-19 15:21:47 Jan Schneider Comment #4
State ⇒ Feedback
Reply to this comment
Does this already happen when you load the sidebar for the first time 
resp. refresh you it manually, or only if the sidebar is refreshed 
automatically.



Also, what browser do you use and what charset are the pages displayed in?
2005-01-15 15:56:24 Jan Schneider Assigned to Jan Schneider
State ⇒ Assigned
Assigned to Horde DevelopersHorde Developers
 
2005-01-15 11:44:45 jlaur-horde (at) vindvejr (dot) dk Comment #3
New Attachment: imp-bug.png Download
Reply to this comment
I'm sorry, it isn't. I'm already running 3.0.2, but couldn't choose 
the correct version in this system - and forgot to mention it, sorry. 
I've attached the screenshot for good manner.
2005-01-14 21:35:30 Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
This should have been fixed with Horde 3.0.2.
2005-01-14 18:37:24 jlaur-horde (at) vindvejr (dot) dk Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ Error in utf7-imap parsing when building folder tree
Queue ⇒ IMP
Reply to this comment
When building the IMAP folder tree, Imp fails to parse the name 
correctly. The first problem is with a folder named: Caf&AOk--du-ve'



That is: Café-du-ve'



The problem is with the é - there seems to be a '\0' after the 'f', 
which I guess is causing the problem in imp/lib/Block/tree_folders.php:



$tree->addNode($parent . $mailbox['value'],

    $parent . $mailbox['parent'],

    $mailbox['label'], $indent + $mailbox['level'], false, $node_params);



I've tried to do a String::convertCharset($mailbox['label'], 
'UTF7-IMAP'). This helps a bit, because the folder tree is built 
correctly, but the offending folders have no name.



After the failure, the rest of the tree is missing. See screenshot: 
http://www.vindvejr.dk/~jlaur/temp/imp-bug.png



This means that I can't see the rest of the Horde menu items, i.e. 
"Administration", "Options", "Log out" and any other Horde modules 
alphabetically after "Mail".



I hope this description helps, otherwise feel free to ask for more 
information. The same problem occurs with a folder named "Nytår" 
("Nyt&AOU-r"), so I guess it's a general problem with non-ascii 
characters.



--

Jacob Laursen


Saved Queries