When noselect fix is enabled, SquirrelMail 1.4.8 uses
LSUB with '*%' wildcards. According to RFC 3501 6.3.9
LSUB with % wildcard returns unsubscribed noselect
folders that have subscribed subfolders. Subfolders are
not returned. Use of LSUB with both wildcards is not
defined in RFC.
TEST_5
Request:
A003 LSUB "mail/" "*"
Response:
* LSUB () "/" mail/Sent
* LSUB () "/" mail/Trash
* LSUB () "/" mail/Drafts
* LSUB () "/" mail/naujas/naujas
LSUB completed
TEST_6
Request:
A004 LSUB "mail/" "%"
Response:
* LSUB () "/" mail/Sent
* LSUB () "/" mail/Trash
* LSUB () "/" mail/Drafts
* LSUB (\NoSelect) "/" mail/naujas
LSUB completed
TEST_7
Request:
A005 LSUB "mail/" "*%"
Response:
* LSUB () "/" mail/Sent
* LSUB () "/" mail/Trash
* LSUB () "/" mail/Drafts
* LSUB () "/" mail/naujas/naujas
LSUB completed
TEST_8
Request:
A006 LIST "mail/*" "*"
Response:
* LIST (\NoSelect) "/" mail/
* LIST (\NoInferiors \UnMarked) "/" mail/Sent
* LIST (\NoInferiors \UnMarked) "/" mail/Trash
* LIST (\NoInferiors \UnMarked) "/" mail/Drafts
* LIST (\NoSelect) "/" mail/naujas
* LIST (\NoInferiors \UnMarked) "/" mail/naujas/naujas
LIST completed
Logged In: YES
user_id=75334
Originator: NO
Related note, this also seems to affect dovecot. Normally, all folders in dovecot may contain both folders and messages, however it is possible to configure multiple namespaces, in which case, non-primary namespaces are contained within a \Noselect folder, causing them to display under incorrect parent items as the true parents are omitted from the array. These folders do appear on the folders page as unsubscribed, however attempting to subscribe to them will generate a TRYCREATE error.
Another issue is that both the left pane folder list and the subscription page folder lists use the same function, which will need to change, since the left pane needs to do an additional lookup of \Noselect folders that do not appear in the LSUB list.