当我尝试使用postfix来映射sasl密码文件时,为什么会出现错误?

我刚刚安装了postfix作为卫星系统。 我需要在我的邮件提供商上进行身份validation。 postfix需要从我的sasl-passwd文件构建一个sasl数据库。 但它没有做到这一点。 如何修复此错误(最后一行)?:

root@confus:/etc/postfix# echo 'smtp_sasl_auth_enable = yes' >> main.cf root@confus:/etc/postfix# echo 'smtp_sasl_security_options = noplaintext noanonymous' >> main.cf root@confus:/etc/postfix# echo 'smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd' >> main.cf root@confus:/etc/postfix# ll total 116 drwxr-xr-x 3 root root 4096 2011-06-03 13:56 ./ drwxr-xr-x 154 root root 12288 2011-06-03 13:33 ../ -rw-r--r-- 1 root root 318 2011-06-03 13:32 dynamicmaps.cf -rw-r--r-- 1 root root 1562 2011-06-03 13:53 main.cf -rw-r--r-- 1 root root 5563 2011-06-03 13:32 master.cf -rw-r--r-- 1 root root 19509 2011-05-10 15:06 postfix-files -rwxr-xr-x 1 root root 8729 2011-05-10 15:06 postfix-script* -rwxr-xr-x 1 root root 25752 2011-05-10 15:06 post-install* drwxr-xr-x 2 root root 4096 2011-05-10 15:06 sasl/ -rw------- 1 confus confus 51 2011-06-03 13:56 sasl_passwd -rw-r--r-- 1 root root 28 2011-06-03 13:43 sender_canonical -rw-r--r-- 1 root root 12288 2011-06-03 13:47 sender_canonical.db root@confus:/etc/postfix# postmap sasl_passwd postmap: fatal: open database sasl_passwd.db: Permission denied root@confus:/etc/postfix# postmap hash:sasl_passwd postmap: fatal: open database sasl_passwd.db: Permission denied 

inb4’sudo’:注意“root @ confus”

“你需要确保postfix用户能够读取该文件。你可以发布sudo ls -l /etc/postfix/sasl_passwd.db的输出以获得更多帮助。”

并从评论:“将postfix的配置目录的所有者更改为postfix,它的工作原理。”

资源

通常,这解决了这个问题

  cd /etc/postfix sudo chown -R postfix . sudo chgrp -R postfix . sudo chmod -R ugo+rwx . 

重要的是还要使后缀用户可以写后缀目录,因为它有时会尝试在这里创建或替换文件(它应该保留在其他地方!)