1 (edited by harro.verton 2018-10-27 22:20:58)

Topic: Shared folders not visible in LIST

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.5-1
- Linux/BSD distribution name and version: CentOS 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? Yes
====

I've setup a shared folder for a mailbox using the acl plugin of roundcube.

ACL was set correctly:

doveadm acl get -u userA@example.org inbox
ID                                 Global Rights
user=userB@example.org                lookup read write-seen

ACL debugging shows all is fine:

doveadm acl debug -u userB@example.org Shared/userA@example.org
doveadm(userB@example.org): Info: Mailbox 'INBOX' is in namespace 'Shared/userA@example.org/'
doveadm(userB@example.org): Info: Mailbox path: /data/vmail/vmail1/example.org/u/s/e/userA-2018.06.19.10.32.43//Maildir
doveadm(userB@example.org): Info: All message flags are shared across users in mailbox
doveadm(userB@example.org): Info: User userB@example.org has rights: lookup read write-seen
doveadm(userB@example.org): Info: Mailbox found from dovecot-acl-list
doveadm(userB@example.org): Info: User userA@example.org found from ACL shared dict
doveadm(userB@example.org): Info: Mailbox Shared/userA@example.org is visible in LIST

However, Dovecot doesn't show it:

 telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
a login "userB@example.org" "verysecret"
a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE QUOTA ACL RIGHTS=texk] Logged in
b LIST "" *
* LIST (\HasNoChildren \Junk) "/" Junk
* LIST (\HasNoChildren \Drafts) "/" Drafts
* LIST (\HasNoChildren) "/" INBOX/Keep
* LIST (\HasNoChildren \Sent) "/" Sent
* LIST (\HasNoChildren \Trash) "/" Trash
* LIST (\HasChildren) "/" INBOX
b OK List completed (0.005 + 0.000 + 0.005 secs).

I'm at a loss...

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Shared folders not visible in LIST

Can you see it in Roundcube/SOGo? It may be easier to check than the IMAP protocol interface.

3

Re: Shared folders not visible in LIST

No.

Obviously if Dovecot doesn't show the folders on a LIST or LIST-EXTENDED command, there is no hope any IMAP tools will see it either.

4 (edited by harro.verton 2018-10-27 04:18:53)

Re: Shared folders not visible in LIST

I did some debugging in Dovecot (mail_debug = yes):

Oct 26 20:14:02 imap(userB@example.org): Debug: dict quota: user=userA@example.org, uri=proxy::quotadict, noenforcing=0
Oct 26 20:14:02 imap(userB@example.org): Debug: shared: Tried to access mails of nonexistent user userA@example.org
Oct 26 20:14:02 imap(userB@example.org): Debug: maildir++: root=/var/run/dovecot/user-not-found/userA@example.org, index=, indexpvt=, control=, inbox=/var/run/dovecot/user-not-found/userA@example.org, alt=
Oct 26 20:14:02 imap(userB@example.org): Debug: Namespace : /var/run/dovecot/user-not-found/userA@example.org doesn't exist yet, using default permissions
Oct 26 20:14:02 imap(userB@example.org): Debug: Namespace : Using permissions from /var/run/dovecot/user-not-found/userA@example.org: mode=0700 gid=default

So something is wrong in the setup, but what? This is a standard iRedMail installation, only difference is that de vmail tree has been moved from the local disk to an NFS share.

No idea why it says userA@example.org does not exist, it does, I can login using Roundcube, and I can set the ACL on it's inbox.

5 (edited by harro.verton 2018-10-27 04:22:19)

Re: Shared folders not visible in LIST

Writing this, it dawned on me that it could be the location in dovecot.conf no longer maps to the correct place due to the move of the vmail folder?

What does %%Lh resolve to in

location = maildir:%%Lh/Maildir/:INDEX=%%Lh/Maildir/Shared/%%u

6

Re: Shared folders not visible in LIST

Also, If I check the users Maildir, there is no "Shared" folder so "Maildir/Shares/%%u" can never work?

7

Re: Shared folders not visible in LIST

It gets better, userA@example.org, the user who's Inbox has to be shared, DOES have a Shared folder. In that folder there is a "userA@example.org" folder, which means it shared the Inbox to itself?

8

Re: Shared folders not visible in LIST

How about this:

- Turn on plugin "acl" in Roundcube
- Login to roundcube as user A, go to "Settings -> Folders" page to share a folder.
- Login to roundcube as user B to verify the shared folder.

9 (edited by harro.verton 2018-10-28 05:37:06)

Re: Shared folders not visible in LIST

This is what I wrote in my opening post, that is how I did it.

But as the IMAP commands LIST and LIST-EXTENDED doesn't show the shared folders, which is most likely because the folders aren't created in the physical mailbox by Dovecot, using every higher-level solution like roundcube or an email client is pointless, as they use those commands to retrieve the Mailbox folders.

The problem is that Dovecot doesn't create the Shared/<shared-user@domain> directory in the Mailbox directory of the user shared to.

10

Re: Shared folders not visible in LIST

- Which Dovecot version are you running?
- Would you like to compare your Dovecot config with the latest one (just the shared folder part)? https://bitbucket.org/zhb/iredmail/src/ … cot22.conf

11

Re: Shared folders not visible in LIST

[root@mail ~]# dovecot --version
2.2.32 (dfbe293d4)

I'll compare the configurations later today, thanks!

12 (edited by harro.verton 2018-10-28 20:22:04)

Re: Shared folders not visible in LIST

Checked.

The location in the shared namespace was different. I updated it, and restarted Dovecot, but that doesn't fix the problem:

[root@mail ~]# dovecot acl debug -u shared.to@example.org Shared/shared-from@example.com
doveadm(shared.to@example.org): Info: Mailbox 'INBOX' is in namespace 'Shared/shared-from@example.com/'
doveadm(shared.to@example.org): Info: Mailbox path: /data/vmail/vmail1/example.com/s/h/a/shared-from-2018.06.19.10.32.43//Maildir
doveadm(shared.to@example.org): Info: All message flags are shared across users in mailbox
doveadm(shared.to@example.org): Info: User shared.to@example.org has rights: lookup read write write-seen write-deleted expunge create delete
doveadm(shared.to@example.org): Info: Mailbox found from dovecot-acl-list
doveadm(shared.to@example.org): Info: User shared-from@example.com found from ACL shared dict
doveadm(shared.to@example.org): Info: Mailbox Shared/shared-from@example.com is visible in LIST

[root@mail ~]# telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
a login "shared.to@example.org" "password"
a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE QUOTA ACL RIGHTS=texk] Logged in
b LIST "" *
* LIST (\HasNoChildren \Drafts) "/" Drafts
* LIST (\HasNoChildren \Trash) "/" Trash
* LIST (\HasNoChildren \Sent) "/" Sent
* LIST (\HasNoChildren \Junk) "/" Junk
* LIST (\HasNoChildren) "/" INBOX
b OK List completed (0.011 + 0.000 + 0.010 secs).
c logout
* BYE Logging out
c OK Logout completed (0.001 + 0.000 secs).
Connection closed by foreign host.

The location is now defined as

 location = maildir:%%Lh/Maildir/:INDEX=%%Lh/Maildir/Shared/%%Ld/%%Ln

If I look on disk, it has created:

/data/vmail/vmail1/example.com/s/h/a/shared-from-2018.06.19.10.32.43/Maildir/Shared
/data/vmail/vmail1/example.com/s/h/a/shared-from-2018.06.19.10.32.43/Maildir/Shared/example.com
/data/vmail/vmail1/example.com/s/h/a/shared-from-2018.06.19.10.32.43/Maildir/Shared/example.com/shared-from

which strikes me as odd, I would have expected this to be created in the MailDir of the user the folder was shared to, not the user who shares the folder?

13

Re: Shared folders not visible in LIST

Also,

dovecot mailbox list -u shared.to@example.org

Gives:

Drafts
Trash
Sent
Junk
Shared
Shared/shared_from@example.com
Shared/shared_from@example.com/To-Do
INBOX

so that also sees the shared folders. So why does IMAP not see it?

14

Re: Shared folders not visible in LIST

In Thunderbird or Evolution the shared folders are also not visible, so they can't be subscribed to.

It clearly seems to be a Dovecot issue.

15

Re: Shared folders not visible in LIST

I did a quick test with the latest iRedMail-0.9.8 and Roundcube 1.3.8, it works fine.
screenshot: https://imgur.com/a/d1js4j5

What i did:

- Enable Roundcube plugin "acl"
- Login to Roundcube, click "Settings -> Folders"
- Select the folder you want to share, add a new sharing, input the email address you want to share to, select privileges, save.
- Logout Roundcube, then login to the user you shared to, the shared folder is automatically subscribed.

16

Re: Shared folders not visible in LIST

As I wrote before, I did exactly the same. And everything worked the same.

The only problem I have is that Dovecot doesn't show the folders on LIST or LIST-EXTENDED, so they are not visible in the client, any client (used Roundcube, Thunderbird and Outlook). And I have no clue why, I have already enabled all debugging, and there are no errors, not on creating the ACL and not on logging in and accessing the mailbox after that.

17

Re: Shared folders not visible in LIST

Please post the output of "doveconf -n" for troubleshooting.