6.0.0-beta1
7/4/25

[#9102] Dovecot folders subscription
Summary Dovecot folders subscription
Queue IMP
Queue Version Git master
Type Bug
State Resolved
Priority 2. Medium
Owners slusarz (at) horde (dot) org
Requester leandro.damascena (at) gmail (dot) com
Created 06/18/2010 (5495 days ago)
Due
Updated 06/28/2010 (5485 days ago)
Assigned
Resolved 06/28/2010 (5485 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
06/28/2010 08:48:54 PM leandro (dot) damascena (at) gmail (dot) com Comment #3 Reply to this comment
Thank you Michael :)
06/28/2010 08:46:57 PM Michael Slusarz Assigned to Michael Slusarz
State ⇒ Resolved
 
06/28/2010 08:46:35 PM Git Commit Comment #2 Reply to this comment
06/18/2010 04:53:59 AM leandro (dot) damascena (at) gmail (dot) com Comment #1
Priority ⇒ 2. Medium
New Attachment: inbox_subs.diff Download
Patch ⇒ Yes
Milestone ⇒
Queue ⇒ IMP
Summary ⇒ Dovecot folders subscription
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
Dovecot by default doesn't use subscription for INBOX (at least in my 
mailserver) and this produces a error in IMAP Tree Folders... Looking 
at the source code I could find an error when the INBOX is 
unsubscribed...

protected function _getList($showunsub) in imp/lib/Imap/Tree.php... 
This function tests if result list doesn't contain INBOX and FORCE an 
array to increment INBOX, however, this function use array_merge and 
it produces an error when some folder has a numeric name (in my case 
my folder is: 2009 or 2010)...

Looking at PHP documentation I saw 
(http://php.net/manual/en/function.array-merge.php):
If all of the arrays contain only numeric keys, the resulting array is 
given incrementing keys starting from zero.
If you want to append array elements from the second array to the 
first array while not overwriting the elements from the first array 
and not re-indexing, use the + array union operator:
<?php
$array1 = array(0 => 'zero_a', 2 => 'two_a', 3 => 'three_a');
$array2 = array(1 => 'one_b', 3 => 'three_b', 4 => 'four_b');
$result = $array1 + $array2;
var_dump($result);
?>

Saved Queries