Open aminski316 opened 2 years ago
It looks like you've done these tests in a single session, as an admin user, correct?
What happens if you CREATE these mailboxes as the admin user (and SETACL them properly), but then run the LIST commands as the users who own the mailboxes?
I ask, because inside LIST's implementation there is some dependency on whether or not we're in the admin namespace or a user's namespace. So whether the problem presents the same in both, or differently, will be important in tracking it down.
There are some limitations on IMAP behaviour specific to the admin namespace, though I don't remember exactly what they are offhand. You might just be running into something like this, and it will be fine in normal use by real users. This comment for example -- I'm not sure of its ramifications offhand, but it seems plausible that it may affect the haschildren/hasnochildren computations later:
We usually recommend that "defaultdomain" be set to something that will never be a real domain (and its default value is "internal" for this reason), and that all users are created fully qualified. I don't remember why though!
It looks like you've done these tests in a single session, as an admin user, correct?
That's true.
What happens if you CREATE these mailboxes as the admin user (and SETACL them properly), but then run the LIST commands as the users who own the mailboxes?
I ask, because inside LIST's implementation there is some dependency on whether or not we're in the admin namespace or a user's namespace. So whether the problem presents the same in both, or differently, will be important in tracking it down.
You're right, output is ok in user context.
. login user.one pw
. OK
. list "" "*"
* LIST (\HasNoChildren) "/" INBOX
* LIST (\HasNoChildren) "/" one
. OK Completed (0.000 secs 2 calls)
. login user.one@domain.com pw
. OK
. list "" "*"
* LIST (\HasNoChildren) "/" INBOX
* LIST (\HasNoChildren) "/" one
. OK Completed (0.000 secs 2 calls)
There are some limitations on IMAP behaviour specific to the admin namespace, though I don't remember exactly what they are offhand. You might just be running into something like this, and it will be fine in normal use by real users.
Well, looks fine in user context but not in admin context.
. login cyrus pw
. list "" "*"
* LIST (\HasNoChildren) "/" user/user.one@domain.com
* LIST (\HasNoChildren) "/" user/user.one/one@domain.com
* LIST (\HasNoChildren) "/" user/user.one/two@domain.com
* LIST (\HasNoChildren) "/" user/user.one/two/three@domain.com
* LIST (\HasNoChildren) "/" user/user.one/one
. OK Completed (0.000 secs 6 calls)
. login user.one@domain.com pw
. list "" "*"
* LIST (\HasNoChildren) "/" INBOX
* LIST (\HasNoChildren) "/" one
* LIST (\HasChildren) "/" two
* LIST (\HasNoChildren) "/" two/three
. OK Completed (0.001 secs 4 calls)
This comment for example -- I'm not sure of its ramifications offhand, but it seems plausible that it may affect the haschildren/hasnochildren computations later:
We usually recommend that "defaultdomain" be set to something that will never be a real domain (and its default value is "internal" for this reason), and that all users are created fully qualified. I don't remember why though!
I suppose not setting defaultdomain forces using of default value "internal". Can you confirm that?
I suppose not setting defaultdomain forces using of default value "internal". Can you confirm that?
Yep, exactly.
Generally, for any given imapd.conf option, if you don't set it yourself, it will use its default value. The default value for defaultdomain
is "internal". I appreciate this specific case is a little confusing, since there's two different uses of the word "default" happening.
I've done some tests using Cyrus IMAP 3.2.6-Debian-3.2.6-2~bpo10+1 with enabled virt- and crossdomain support, altnamespace, unixhierarchysep and improved_mboxlist_sort.
I've done the tests running two identical installations, the first one without defaultdomain configured, the second one with defaultdomain default.com configured.
Two things are weird. LIST command hides mailboxes in certain cases and folders with domain part have always no children.
I've added line numbers:
That looks pretty good, created three folders, three folders listed, one has a child (line 9).
Created one child folder, four folders created but three listed. One listed folder has a child but is listed with no children attribute (line 15).
Created a second parent folder for domain.com, five folders created, five folders listed, missing folder is back and has a child (line 25). The folder for user.one@domain.com is listed with no children attribute (line 22), which is wrong.
Both test servers behave equal.
I've changed the test, using full qualified folder names, one is the defaultdomain default.com.
This is the output from the second server, which has defaultdomain configured:
That looks ok.
One folder is missing.
Missing folder is back, children attribute is wrong for domain.com (line 22).
The output from the first server, without defaultdomain configured, looks ok except children attribute.
Third test using full qualified folder names and domains other than default.com:
Both test servers behave equal. All folders are listed, children attributes are wrong (lines 15,17).
I've done the tests using Cyrus IMAP 3.4.2, same results.