Here's what worked for me :
1.create the index file in /etc/courier/shared.tmp/index
2.call sharedindexinstall without any arguments this will generate /etc/courier/shared/index out of /etc/courier/shared.tmp/index you created earlier.
3.give the necessary rights and permissions on the desired folder (or inbox) to the desired user (or users)
4.If you are using roundcube as a webmail don't forget to add this to your configuration file (usually that's /var/www/whereroundcubeis/config/config.inc.php)
$config['imap_force_ns'] = true;
Now I will go into the details of steps 1 and 3
1.create the index file in /etc/courier/shared.tmp/index
Courier's documentation specifies that the last field should be the maildir path relative to the home field (second to last). So the right format should have been :
root@messagerie-secours[10.10.10.20] ~ # cat /etc/courier/shared/index
ali.mellah@xxx 5000 5000 /var/vmail/xxx/ ali.mellah
a.chaouche@xxx 5000 5000 /var/vmail/xxx/ a.chaouche
root@messagerie-secours[10.10.10.20] ~ #
The format is :
userid \t uid \t gid \t homedir \t maildir
userid : this should be the same id you find in the syslog or mail.log (/var/log/mail.log) in the IMAP login messages.
uid/gid : this should be the uid and gid of the system user. If you are in a virtual setup, all the IMAP users should have the same system username (vmail in my case) thus having the same uid and gid (vmail in my case has uid 5000 and gid 5000)
homeidr : this is the home directory of the user. In my case, they all share the same homedir, only the maildirs are different.
maildir : this should be a relative path to homedir, not a full path. If you do a full path courier will fail and log a line in /var/log/mail.err or /var/log/mail.warn
The fields are separated by tabs.
3. Set the necessary rights on individual folders
maildiracl -set /var/vmail/xxx/a.chaouche/ "INBOX.PRTG" user=ali.mellah@xxx lr
Giving ali.mellah@xxx the right to list and read the content of the INBOX.PRTG folder inside a.chaouche@xxx mailbox.
You can see the rights of all users of a folder or inbox with maildiracl -list, like this :
root@messagerie-secours[10.10.10.20] ~ # maildiracl -list /var/vmail/algerian-radio.dz/a.chaouche/ "INBOX.PRTG"
owner aceilrstwx
administrators aceilrstwx
[email protected] lr
[email protected] lr
root@messagerie-secours[10.10.10.20] ~ #
You can see the rights of a specific user on a folder with maildiracl -compute, like this :
root@messagerie-secours[10.10.10.20] /home/serveur # maildiracl -compute /var/vmail/algerian-radio.dz/a.chaouche/ "INBOX.Flux audio" [email protected]
lrs
root@messagerie-secours[10.10.10.20] /home/serveur #
From : https://ychaouche.informatick.net/couriersharefolder