我在 CentOS Linux 5.6 上使用 PHP 通过 Postfix 发送邮件时遇到了问题。
我有 Postfix 2.3.3 版本,它是通过 Yum 安装的。我还按照教程安装了 Dovecot,但我不确定是否需要它才能通过 SMTP 发送。
当 PHP mail() 命令运行时,我得到这个/var/log/邮件日志:
Aug 22 10:30:57 ade1 postfix[5798]: error: to submit mail, use the Postfix sendmail command
Aug 22 10:30:57 ade1 postfix[5798]: fatal: the postfix command is reserved for the superuser
我已经安装了 Webmin,这是 SMTP 设置页面:http://dl.dropbox.com/u/618674/_perma/2011-08/webmin-postfix-smtp.png
我输入了一些配置设置更改/etc/postfix/main.cf按照本教程: http://wiki.centos.org/HowTos/postfix
在/etc/php.ini我有这个:
sendmail_path = /usr/sbin/postfix -t -i
有人对此有任何想法吗“要提交邮件,请使用 Postfix sendmail 命令”错误?
使用 Sendmail 会更好吗?有人建议我使用 Postfix 更简单!
干杯 :)
另外...(可能相关),
chkconfig --level 345 dovecot on
返回此:
failed to make symlink /etc/rc0.d/K74lvm2-monitor: File exists
failed to make symlink /etc/rc1.d/S26lvm2-monitor: File exists
failed to make symlink /etc/rc2.d/S26lvm2-monitor: File exists
failed to make symlink /etc/rc3.d/S26lvm2-monitor: File exists
failed to make symlink /etc/rc4.d/S26lvm2-monitor: File exists
failed to make symlink /etc/rc5.d/S26lvm2-monitor: File exists
failed to make symlink /etc/rc6.d/K74lvm2-monitor: File exists
failed to make symlink /etc/rc0.d/K35dovecot: File exists
failed to make symlink /etc/rc1.d/K35dovecot: File exists
failed to make symlink /etc/rc2.d/K35dovecot: File exists
failed to make symlink /etc/rc3.d/S65dovecot: File exists
failed to make symlink /etc/rc4.d/S65dovecot: File exists
failed to make symlink /etc/rc5.d/S65dovecot: File exists
failed to make symlink /etc/rc6.d/K35dovecot: File exists
failed to make symlink /etc/rc3.d/S65dovecot: File exists
failed to make symlink /etc/rc4.d/S65dovecot: File exists
failed to make symlink /etc/rc5.d/S65dovecot: File exists
答案1
您对 Sendmail 软件和/usr/sbin/sendmail
发送邮件的标准界面感到困惑。将sendmail_path
其恢复为默认值,一切就都好了。Postfix 提供了一个sendmail
兼容的包装器,它可以正确地将邮件发送到 Postfix 系统。
顺便说一句,您不需要 Dovecot 通过 SMTP 发送邮件。