Thanks Steffen. I went the quick'n'dirty way described at : http://wiki2.dovecot.org/SharedMailboxes/Symlinks and I must say it works fine as far as I have tested.
Here's what I did :
$ cd /var/vmail/algerian-radio.dz/a.chaouche/
$ ln -s /var/vmail/backup.algerian-radio.dz/a.chaouche/ .shared.a_chaouche@backup_algerian-radio_dz <---- change "." to "_"
If I didn't change the dots they would appear as subfolder separators to dovecot (Maildir++ specs ? )
If you do this then a.chaouche@algerian-radio.dz can do whatever he wants with a.chaouche@backup.algerian-radio.dz mailbox. We don't want this. We want him to only read the mail, not delete it. For this, he needs two permissions : reading of course and listing, because he needs to list the emails in order to choose which one he wants to read. If he doesn't have the listing permission then the MUA would get an error when it tries to list all the messages in the inbox.
We do this by adding a dovecot-acl file in the mailbox we want to share :
root@messagerie[10.10.10.20] /var/vmail/backup.algerian-radio.dz/a.chaouche # cat dovecot-acl user=a.chaouche@algerian-radio.dz lr root@messagerie[10.10.10.20] /var/vmail/backup.algerian-radio.dz/a.chaouche #
This says that user a.chaouche@algerian-radio.dz has the "l" right (listing) and the "r" right (reading).
You can make sure that it's setup as expected with the acl tool :
root@messagerie[10.10.10.20] ~ # doveadm acl get -u a.chaouche@algerian-radio.dz INBOX.shared.a_chaouche@backup_algerian-radio_dz ID Global Rights user=a.chaouche@algerian-radio.dz lookup read root@messagerie[10.10.10.20] ~ #
- No need for SQL tables
- No need for dictionary mappings
- No need for doveadm acl commands
Yassine.
From: Steffen Kaiser skdovecot@smail.inf.fh-brs.de To: chaouche yacine yacinechaouche@yahoo.com Cc: "dovecot@dovecot.org" dovecot@dovecot.org Sent: Wednesday, May 11, 2016 3:09 PM Subject: Re: How do I share folders ?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 11 May 2016, chaouche yacine wrote:
namespace inbox {
prefix = INBOX. separator = .
^^^^^^^^
type = private } namespace partage { hidden = no location = maildir:%%h:INDEX=~/%%u prefix = shared.%%u.
^^^^^^^^^
separator = . type = shared }
looks fine for me,
I don't know if it's possible to share folders with the doveadm acl command ? root@messagerie[10.10.10.20] ~ # doveadm acl debug -u a.chaouche@algerian-radio.dz shared/a.chaouche@backup.algerian-radio.dz doveadm(a.chaouche@algerian-radio.dz): Error: Can't open mailbox shared/a.chaouche@backup.algerian-radio.dz: Mailbox doesn't exist: shared/a.chaouche@backup.algerian-radio.dz
you are using the dot as separator, that is:
shared/a.chaouche@backup. should spell
shared.a.chaouche@backup.
However, because there are dots in the username, too, this probably won't work, because Dovecot probably picks up "a" as username.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBVzM9HHz1H7kL/d9rAQIGmwgAi7ga1a1Vv8HfvcAc6mIqxkBHdI5jL3MC YfMVwwuj7NJMjS8l/ouYxJCXdMn5k+sbRifwR/jyBcZtsvz3/ijkMx3RQyoq+LwZ r01Mxb4YR7ub5sNUIeIRtRcR/aNfDLNZb86PpDCHs2WKLU2atS5vVLmJWNiMaJNV MSG72OFKoLUJuRoSM26c2AH/f33WjuEinjjGMk481ezNBmZIuSWU2lJjmUXjfox9 BPzGRUkUKtlV9tkQjJUVjuwcfmvs+ChmTI3O2F37KWswP8zw0/EYXdyRpWCJso7F 8Ecrbu14cSHjisaerTQ4xko+ossPGoEE+Rh7XHuv8VDdNruur5AeVg== =DH0D -----END PGP SIGNATURE-----