6.0.0-beta1
8/14/25

[#12059] Displaying quota is broken in basic-mode if the mailbox name has special characters
Summary Displaying quota is broken in basic-mode if the mailbox name has special characters
Queue IMP
Queue Version 6.0.3
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester aarno.sandvik (at) helsinki (dot) fi
Created 02/19/2013 (4559 days ago)
Due
Updated 03/05/2013 (4545 days ago)
Assigned 02/20/2013 (4558 days ago)
Resolved 03/05/2013 (4545 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
03/05/2013 05:46:40 AM Michael Slusarz Deleted Original Message
 
03/05/2013 04:49:37 AM Michael Slusarz Comment #7
Assigned to Michael Slusarz
State ⇒ Resolved
Reply to this comment
Nevermind.  This was a problem because the QUOTA RFC (2087) predates 
RFC 3501 and lists the input as an astring - later RFC revisions 
clarify that mailbox input is actually 'mailbox' in ABNF, which means 
an astring that has been converted to UTF7-IMAP.  So we were using the 
wrong IMAP data type in the command.

Fixed in Horde_Imap_Client 2.7.1.
03/05/2013 04:49:02 AM Git Commit Comment #6 Reply to this comment
Changes have been made in Git (master):

commit ef68a7b575ddb5af4374eaaa229ff00807000b2d
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Mon Mar 4 21:48:35 2013 -0700

     [mms] Fix SETQUOTA, GETQUOTA, and GETQUOTAROOT commands on 
mailboxes that contain non-7bit characters (Bug #12059).

  .../Imap_Client/lib/Horde/Imap/Client/Socket.php   |    6 +++---
  framework/Imap_Client/package.xml                  |    2 ++
  2 files changed, 5 insertions(+), 3 deletions(-)

http://git.horde.org/horde-git/-/commit/ef68a7b575ddb5af4374eaaa229ff00807000b2d
03/04/2013 08:29:48 PM arjen+horde (at) de-korte (dot) org Comment #5 Reply to this comment
I can confirm this happening too in the basic interface. I added a

     Horde::debug($params);

line just before line 384 in horde/imp/lib/Imap.php.

In basic mode, you'll see the following being logged in the folders 
'Inbox' and 'Touché' respectively:

2013-03-04T21:11:05+01:00 DEBUG: Variable information:
array(1) {
   [0]=>
   object(Horde_Imap_Client_Mailbox)#408 (2) {
     ["_utf7imap":protected]=>
     NULL
     ["_utf8":protected]=>
     string(5) "INBOX"
   }
}

Backtrace:
  1. Horde_Injector->getInstance() /srv/www/htdocs/horde/imp/mailbox.php:375
  2. Horde_Injector->createInstance() 
/usr/share/php5/PEAR/Horde/Injector.php:247
  3. Horde_Injector_Binder_AnnotatedSetters->create() 
/usr/share/php5/PEAR/Horde/Injector.php:213
  4. Horde_Injector_Binder_Implementation->create() 
/usr/share/php5/PEAR/Horde/Injector/Binder/AnnotatedSetters.php:69
  5. Horde_Injector_Binder_Implementation->_getInstance() 
/usr/share/php5/PEAR/Horde/Injector/Binder/Implementation.php:62
  6. ReflectionClass->newInstanceArgs() 
/usr/share/php5/PEAR/Horde/Injector/Binder/Implementation.php:82
  7. IMP_View_Subinfo->__construct()
  8. IMP_Ui_Quota->quota() /srv/www/htdocs/horde/imp/lib/View/Subinfo.php:36
  9. IMP_Quota_Imap->getQuota() /srv/www/htdocs/horde/imp/lib/Ui/Quota.php:32
10. IMP_Imap->getQuotaRoot() /srv/www/htdocs/horde/imp/lib/Quota/Imap.php:48
11. IMP_Imap->__call() /srv/www/htdocs/horde/imp/lib/Quota/Imap.php:48
12. Horde::debug() /srv/www/htdocs/horde/imp/lib/Imap.php:387

2013-03-04T21:11:19+01:00 DEBUG: Variable information:
array(1) {
   [0]=>
   object(Horde_Imap_Client_Mailbox)#400 (2) {
     ["_utf7imap":protected]=>
     NULL
     ["_utf8":protected]=>
     string(7) "Touché"
   }
}

Backtrace:
  1. Horde_Injector->getInstance() /srv/www/htdocs/horde/imp/mailbox.php:375
  2. Horde_Injector->createInstance() 
/usr/share/php5/PEAR/Horde/Injector.php:247
  3. Horde_Injector_Binder_AnnotatedSetters->create() 
/usr/share/php5/PEAR/Horde/Injector.php:213
  4. Horde_Injector_Binder_Implementation->create() 
/usr/share/php5/PEAR/Horde/Injector/Binder/AnnotatedSetters.php:69
  5. Horde_Injector_Binder_Implementation->_getInstance() 
/usr/share/php5/PEAR/Horde/Injector/Binder/Implementation.php:62
  6. ReflectionClass->newInstanceArgs() 
/usr/share/php5/PEAR/Horde/Injector/Binder/Implementation.php:82
  7. IMP_View_Subinfo->__construct()
  8. IMP_Ui_Quota->quota() /srv/www/htdocs/horde/imp/lib/View/Subinfo.php:36
  9. IMP_Quota_Imap->getQuota() /srv/www/htdocs/horde/imp/lib/Ui/Quota.php:32
10. IMP_Imap->getQuotaRoot() /srv/www/htdocs/horde/imp/lib/Quota/Imap.php:48
11. IMP_Imap->__call() /srv/www/htdocs/horde/imp/lib/Quota/Imap.php:48
12. Horde::debug() /srv/www/htdocs/horde/imp/lib/Imap.php:387

I suspect that the element _utf7imap being NULL, might be causing 
problems since my IMAP server (Dovecot) doesn't accept folders in 
UTF8. This doesn't cause a problem in dynamic mode, since the quota 
are calculated not per folder, but always based on the Inbox (it is 
only logged once when switching between folders without doing 
modifications):

2013-03-04T21:08:04+01:00 DEBUG: Variable information:
array(1) {
   [0]=>
   object(Horde_Imap_Client_Mailbox)#302 (2) {
     ["_utf7imap":protected]=>
     NULL
     ["_utf8":protected]=>
     string(5) "INBOX"
   }
}

Backtrace:
1. IMP_Ajax_Application->send() /srv/www/htdocs/horde/services/ajax.php:65
2. IMP_Ajax_Application->getTasks() 
/srv/www/htdocs/horde/imp/lib/Ajax/Application.php:120
3. IMP_Ajax_Queue->add() 
/srv/www/htdocs/horde/imp/lib/Ajax/Application.php:131
4. IMP_Ui_Quota->quota() /srv/www/htdocs/horde/imp/lib/Ajax/Queue.php:166
5. IMP_Quota_Imap->getQuota() /srv/www/htdocs/horde/imp/lib/Ui/Quota.php:32
6. IMP_Imap->getQuotaRoot() /srv/www/htdocs/horde/imp/lib/Quota/Imap.php:48
7. IMP_Imap->__call() /srv/www/htdocs/horde/imp/lib/Quota/Imap.php:48
8. Horde::debug() /srv/www/htdocs/horde/imp/lib/Imap.php:387
03/04/2013 08:52:42 AM aarno (dot) sandvik (at) helsinki (dot) fi Comment #4 Reply to this comment
Ping?  If no response, I'm going to close because this sounds like a 
local issue and there has been no way to reproduce this (as 
explained in this ticket, there should be absolutely no way your 
patch would work on a correctly configured system).
Yep, go ahead and close the ticket if you cannot reproduce it. I'm 
able to reproduce this on all my test and production servers but that 
probably just indicates that my setup is consistently wrong is some 
way. If I  find out the cause I'll post it here for further reference.
03/03/2013 03:25:28 AM Michael Slusarz Comment #3 Reply to this comment
Ping?  If no response, I'm going to close because this sounds like a 
local issue and there has been no way to reproduce this (as explained 
in this ticket, there should be absolutely no way your patch would 
work on a correctly configured system).
02/20/2013 01:53:12 AM Michael Slusarz Comment #2
State ⇒ Feedback
Reply to this comment
If a mailbox  has special characters ( like äö ) in it's name then 
displaying quota information is broken in basic-mode. It seems that 
the mailbox name isn't encoded to utf7imap and this causes the 
following errors in server logs when accessing the mailbox.
Your fix isn't right, because Horde_Imap_Client_Base#getQuotaRoot() 
requires the following for the mailbox parameter:

      * @param mixed $mailbox  A mailbox. Either a Horde_Imap_Client_Mailbox
      *                        object or a string (UTF-8).

You can't pass in a UTF7-IMAP string.

Tracing the code, not sure why this is broken for you.  The value 
passed into IMP_Quota is either a UTF-8 string ('INBOX') or an 
IMP_Mailbox object with the mailbox internally stored in UTF-8.  The 
call to getQuotaRoot() converts this data to a 
Horde_Imap_Client_Mailbox object, which is UTF-8, in IMP_Imap.
02/19/2013 12:59:49 PM aarno (dot) sandvik (at) helsinki (dot) fi Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Displaying quota is broken in basic-mode if the mailbox name has special characters
Queue ⇒ IMP
Milestone ⇒
Patch ⇒ Yes
New Attachment: uh_fix_display_quota.patch
State ⇒ Unconfirmed
Reply to this comment
If a mailbox  has special characters ( like äö ) in it's name then 
displaying quota information is broken in basic-mode. It seems that 
the mailbox name isn't encoded to utf7imap and this causes the 
following errors in server logs when accessing the mailbox.

HORDE: [imp] IMAP error reported by server. Mailbox does not exist 
[pid 2227 on line 390 of "horde/imp/lib/Imap.php"]
HORDE: [imp] Unable to retrieve quota [pid 2227 on line 50 of 
"horde/imp/lib/Quota/Imap.php"]


Saved Queries