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

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

我的 Debian Etch 私人服务器上有一个可以正常工作的 courier-imap 服务器;用户是虚拟的,身份验证通过 mysql。多年来它一直运行良好。

我想在两个用户之间共享一个 imap 文件夹。

我想我只需要做这样的事情:

cd 路径/到/mailusers/dir
ln -s 路径/到/用户1/maildir/.folder_to_be_synced 路径/到/用户2/maildir/

输入命令后,我发现user2在其imap客户端中看到了一个新文件夹,但是该文件夹却是空的。

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

知道我能做什么吗?

谢谢

答案1

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

maildiracl -set /somedirectorypath/user/Maildir/INBOX 用户=其他用户 lr

答案2

以下是对我有用的方法:

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

2. 调用 sharedindexinstall 而不使用任何参数,这将从您之前创建的 /etc/courier/shared.tmp/index 中生成 /etc/courier/shared/index。

3. 向所需用户(或用户们)授予所需文件夹(或收件箱)的必要权利和权限

4.如果您使用 roundcube 作为网络邮件,请不要忘记将其添加到您的配置文件中(通常是 /var/www/whereroundcubeis/config/config.inc.php)

$config['imap_force_ns'] = true;

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

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

Courier 的文档规定最后一个字段应该是相对于 home 字段(倒数第二个)的 maildir 路径。因此正确的格式应该是:

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

相关内容