A NOTE has been added to this issue. 
====================================================================== 
http://dbmail.org/mantis/view.php?id=978 
====================================================================== 
Reported By:                fabiangergely
Assigned To:                
====================================================================== 
Project:                    DBMail
Issue ID:                   978
Category:                   IMAP daemon
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
target:                      
====================================================================== 
Date Submitted:             26-Jul-12 17:18 CEST
Last Modified:              27-Sep-12 12:54 CEST
====================================================================== 
Summary:                    List command returns folder with \Noselect when it
has no such flag saved
Description: 
If I create a specific hierarchy of folders (below), and
mailboxes_by_regex() returns matching folders in a given order (depends on
database, and the exact data), then the "target folder" will be returned
with the \Noselect flag, even though it does not have this flag saved in
the database.
This is reproducible just if I use the '%' wildcard.

Example:

.. list "Test another/" "%"
* LIST (\noselect \haschildren) "/" "Test another/test"
.. OK LIST completed
====================================================================== 

---------------------------------------------------------------------- 
 (0003464) fabiangergely (reporter) - 26-Jul-12 17:45
 http://dbmail.org/mantis/view.php?id=978#c3464 
---------------------------------------------------------------------- 
The attached patch
(0001-IMAP-fix-unexpected-Noselect-in-list-command-respons.patch) is one
solution to the problem. It orders the folders returned by
dm_db.c/mailboxes_by_regex(), so that parent folders always appear before
their children. Then the bug cannot be reproduced.
An alternative solution would be to give folder names originating from
partial matches a lower "priority", so that they wouldn't mask out real
folders (with priority queue or two lists).

 

---------------------------------------------------------------------- 
 (0003465) fabiangergely (reporter) - 31-Jul-12 17:32
 http://dbmail.org/mantis/view.php?id=978#c3465 
---------------------------------------------------------------------- 
The attached patch
(0001-IMAP-fix-hierarchy-elements-masking-out-real-folders.patch) is
another (in my opinion better) fix for the problem.
It creates two trees in the _ic_list_enter, one for found the real
folders, and one for found hierarchy elements. Then adds all found
hierarchy elements to found real folders (assuming they are not there
already). This way real folders get a higher priority, so hierarchy names
cannot "mask" them out.
The patch also includes a test suite written in Ruby, that should
reproduce the problem with unchanged C code (ie: the test should fail
then). Of course with the changes in the patch the test passes. 

---------------------------------------------------------------------- 
 (0003493) fabiangergely (reporter) - 27-Sep-12 12:54
 http://dbmail.org/mantis/view.php?id=978#c3493 
---------------------------------------------------------------------- 
Regarding the reproduction description, this sentence was improper: 'So it
will be possible to reproduce it with the "Test another/2012" folder.'. Of
course I was thinking about the "Test another/test" folder, because
subfolders for this folder appear earlier in the SQL results than the
folder itself. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
26-Jul-12 17:18  fabiangergely  New Issue                                    
26-Jul-12 17:18  fabiangergely  File Added: 0001-Imapcommands.c-debugging.patch 
                  
26-Jul-12 17:40  fabiangergely  File Added:
0001-IMAP-fix-unexpected-Noselect-in-list-command-respons.patch                 
  
26-Jul-12 17:44  fabiangergely  Note Added: 0003464                          
26-Jul-12 17:45  fabiangergely  Note Edited: 0003464                         
31-Jul-12 17:27  fabiangergely  File Added:
0001-IMAP-fix-hierarchy-elements-masking-out-real-folders.patch                 
  
31-Jul-12 17:32  fabiangergely  Note Added: 0003465                          
27-Sep-12 12:54  fabiangergely  Note Added: 0003493                          
======================================================================

_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev

Reply via email to