我无法find关于Maildir的完整教程,以及存在所有者和权限的文件夹(如果有),并且您已经find它,请分享。
无论如何,我想知道是否有一种方法来获得与Maildirconfiguration与Postfix,Dovecot日志或任何其他工具相关的错误输出,类似的东西(嘿这个文件夹有一个错误的所有者或缺乏权限,甚至没有创build)
我知道你要告诉我:给我们你的文件夹和configuration,但我想知道如何debugging这个为未来的其他案件。
我真正想知道的是,例如:我的虚拟用户有/ home / user / domain / usermail / Maildir
什么权限和所有者应该有家,用户,域,用户邮件和Maildir
请记住我最关心的是要学习与文件夹权限相关的debugging问题。
我在dovecot.conf中:
verbose_ssl=yes mail_debug=yes auth_debug=yes auth_verbose=yes
并在master.cf postfix conf这一行
smtp inet n - n - - smtpd -v submission inet n - n - - smtpd -v
BTW是drwxr-s —权限确定用户邮件文件夹?
对于虚拟用户,您需要创build系统用户帐户并拥有邮件,然后在Postfix和Dovecot中configuration该用户的UID和GID。
这里是我的dovecot.conf
的相关部分:
userdb { driver = static args = uid=8 gid=12 home=/var/spool/mail/%n } mail_location = maildir:~ mail_uid = 8 mail_gid = 12
userdb是一个非常简单的passwd-like文件,只有用户名和密码,其他的都在上面的userdb {...}
块中硬编码,所以UID和GID以及用户的“home”在/var/spool/mail
并开始使用任何login(假设它是事先在passwd文件中定义的,否则访问将被拒绝)。
mail_location
告诉它,邮件是maildir格式,位于~
(home),它对应于从上面的userdb获得的“home”path。 mail_gid/uid
再次将邮件的所有权设置为应该拥有邮件的相应系统用户; 在Postfix中显然应该是一样的。
后缀main.cf
:
virtual_mailbox_base = /var/spool/mail virtual_mailbox_maps = hash:/etc/postfix/vmailboxes virtual_uid_maps = static:8 virtual_gid_maps = static:12
与Dovecot相同的基本目录, /etc/postfix/vmailboxes
的语法只有<mail user account> <mail directory>/
例如,如果它包含serverfault serverfault/
告诉Postfix接收到serverfault@domain
任何邮件将最终在/var/spool/mail/serverfault
,这对应于当你使用serverfault
用户名login时,Dovecot会在哪里寻找它们。
virtual_uid/gid_maps
再次将邮件的所有权设置为我们事先select/创build的系统用户,它应该与Dovecot相同。
我不知道任何特定的日志logging显示错误的选项,如果我搞乱虚拟邮件文件夹的权限,我的Dovecot开始在日志中尖叫而没有任何特殊的configuration(我的dovecot.conf中没有与日志相关的选项) :
Mar 07 12:54:04 sanctuary dovecot[2175]: imap(username): Error: chdir(/var/spool/mail/username/) failed: Permission denied (euid=8(mail) egid=12(mail) missing +x perm: /var/spool/mail/username, dir owned by 0:0 mode=0700) Mar 07 12:54:04 sanctuary dovecot[2175]: imap(username): Error: chdir(/var/spool/mail/username) failed: Permission denied Mar 07 12:54:04 sanctuary dovecot[2175]: imap(username): Error: opendir(/var/spool/mail/username) failed: Permission denied (euid=8(mail) egid=12(mail) missing +r perm: /var/spool/mail/username) Mar 07 12:54:04 sanctuary dovecot[2175]: imap(username): Error: opendir(/var/spool/mail/username) failed: Permission denied (euid=8(mail) egid=12(mail) missing +r perm: /var/spool/mail/username) Mar 07 12:54:04 sanctuary dovecot[2175]: imap(username): Error: stat(/var/spool/mail/username/tmp) failed: Permission denied (euid=8(mail) egid=12(mail) missing +x perm: /var/spool/mail/username, dir owned by 0:0 mode=0700) Mar 07 12:54:04 sanctuary dovecot[2175]: imap(username): Error: stat(/var/spool/mail/username/tmp) failed: Permission denied (euid=8(mail) egid=12(mail) missing +x perm: /var/spool/mail/username, dir owned by 0:0 mode=0700) Mar 07 12:54:04 sanctuary dovecot[2175]: imap(username): Error: stat(/var/spool/mail/username/tmp) failed: Permission denied (euid=8(mail) egid=12(mail) missing +x perm: /var/spool/mail/username, dir owned by 0:0 mode=0700) Mar 07 12:54:09 sanctuary dovecot[2175]: imap(username): Error: chdir(/var/spool/mail/username/) failed: Permission denied (euid=8(mail) egid=12(mail) missing +x perm: /var/spool/mail/username, dir owned by 0:0 mode=0700) Mar 07 12:54:09 sanctuary dovecot[2175]: imap(username): Error: chdir(/var/spool/mail/username) failed: Permission denied Mar 07 12:54:09 sanctuary dovecot[2175]: imap(username): Error: stat(/var/spool/mail/username/.Sent Messages/tmp) failed: Permission denied (euid=8(mail) egid=12(mail) missing +x perm: /var/spool/mail/username, dir owned by 0:0 mode=0700) Mar 07 12:54:09 sanctuary dovecot[2175]: imap(username): Error: stat(/var/spool/mail/username/tmp) failed: Permission denied (euid=8(mail) egid=12(mail) missing +x perm: /var/spool/mail/username, dir owned by 0:0 mode=0700) Mar 07 12:54:09 sanctuary dovecot[2175]: imap(username): Error: stat(/var/spool/mail/username/.Sent Messages/tmp) failed: Permission denied (euid=8(mail) egid=12(mail) missing +x perm: /var/spool/mail/username, dir owned by 0:0 mode=0700) Mar 07 12:54:09 sanctuary dovecot[2175]: imap(username): Error: stat(/var/spool/mail/username/tmp) failed: Permission denied (euid=8(mail) egid=12(mail) missing +x perm: /var/spool/mail/username, dir owned by 0:0 mode=0700) Mar 07 12:54:10 sanctuary dovecot[2175]: imap(username): Error: stat(/var/spool/mail/username/.Sent Messages/tmp) failed: Permission denied (euid=8(mail) egid=12(mail) missing +x perm: /var/spool/mail/username, dir owned by 0:0 mode=0700) Mar 07 12:54:10 sanctuary dovecot[2175]: imap(username): Error: stat(/var/spool/mail/username/tmp) failed: Permission denied (euid=8(mail) egid=12(mail) missing +x perm: /var/spool/mail/username, dir owned by 0:0 mode=0700)
当我尝试发送权限搞砸的电子邮件时,与Postfix一样:
Mar 07 12:56:45 sanctuary postfix/virtual[2736]: warning: maildir access problem for UID/GID=8/12: create maildir file /var/spool/mail/username/tmp/1425729405.P2736.sanctuary: Permission denied Mar 07 12:56:45 sanctuary postfix/virtual[2736]: warning: perhaps you need to create the maildirs in advance Mar 07 12:56:45 sanctuary postfix/virtual[2736]: E752F186: to=<username@sanctuary>, relay=virtual, delay=0.05, delays=0.03/0.01/0/0.01, dsn=4.2.0, status=deferred (maildir delivery failed: create maildir file /var/spool/mail/username/tmp/1425729405.P2736.sanctuary: Permission denied)
我假设你正在使用dovecot-lda
将你的邮件发送给你的Maildir。 IIRC dovecot-lda
向您显示有关缺less的权限的详细信息。
dovecot-lda
无法访问dovecot的全球日志logging工具。 所以你必须分别为dovecot-lda
configuration日志logging。 因此,您必须在dovecotconfiguration中查找“protocol lda {”,并根据需要更改参数log_path
和info_log_path
。 如果你把这些文件放在dovecot-lda中,那么你必须修改/ dev / log的权限,如果你想使用syslog(也就是把参数留空)。
dovecot wiki有更多的细节: http ://wiki2.dovecot.org/LDA
顺便说一句:你不需要smtp和提交详细login后缀,如果你想找出什么是本地邮件传递的问题。