courier-imap w mysql:在debian上的两个虚拟用户之间共享一个文件夹

我的Debian Etch专用服务器上有一台工作的courier-imap服务器; 用户是虚拟的,通过mysqlauthentication。 多年来一直在努力。

我想分享2个用户之间的imap文件夹。

我以为我只需要做这样的事情:

 cdpath/ to / mailusers / dir
 ln -s path / to / user1 / maildir / .folder_to_be_synched path / to / user2 / maildir /

在我input命令后,我发现user2在其imap客户端看到一个新文件夹,但文件夹显示为空。

这不是一个权限问题,因为所有虚拟用户在文件系统上具有相同的权限。

任何想法我可以做什么?

谢谢

您可能需要使用maildiracl命令设置IMAP ACL。 由于您正在使用虚拟设置,因此Courier实施访问控制。 这些ACL存储在courierimapacl文件中,语法在maildiracl手册页中描述。 例如,您可以使用此语法为其他用户提供对文件夹的读取权限:

maildiracl -set / somedirectorypath / user / Maildir / INBOX user = otheruser lr

以下是对我有用的东西:

1.在/etc/courier/shared.tmp/index中创build索引文件

2.没有任何参数的情况下调用sharedindexinstall,会产生你以前创build的/etc/courier/shared.tmp/index中的/ etc / courier / shared / index。

3.将所需的文件夹(或收件箱)的必要权限授予所需的用户(或多个用户)

4.如果你使用roundcube作为networking邮件,不要忘记把它添加到你的configuration文件(通常是/var/www/whereroundcubeis/config/config.inc.php)

$config['imap_force_ns'] = true; 

现在我将详细介绍步骤1和3

1.在/etc/courier/shared.tmp/index中创build索引文件

Courier的文档指定最后一个字段应该是相对于home字段的maildirpath(倒数第二)。 所以正确的格式应该是:

 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] ~ # 

格式是:

  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 

这些字段由制表符分隔。

3.在个人文件夹上设置必要的权限

  maildiracl -set /var/vmail/xxx/a.chaouche/ "INBOX.PRTG" user=ali.mellah@xxx lr 

让ali.mellah@xxx有权列出并阅读a.chaouche@xxx邮箱内的INBOX.PRTG文件夹的内容。

您可以使用maildiracl -list查看文件夹或收件箱的所有用户的权限,如下所示:

 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] ~ # 

您可以使用maildiracl -compute在文件夹中查看特定用户的权限,如下所示:

 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 # 

来自: https : //ychaouche.informatick.net/couriersharefolder