美文网首页
Rails发送邮件失败的解决办法

Rails发送邮件失败的解决办法

作者: jackli0855 | 来源:发表于2019-10-17 21:04 被阅读0次

问题描述

从maillog日志中,查看错误日志如下:

Oct 17 20:43:43 cent6-test postfix[21948]: error: to submit mail, use the Postfix sendmail command
Oct 17 20:43:43 cent6-test postfix[21948]: fatal: the postfix command is reserved for the superuser

解决过程

把config/environments/production.rb中的关于sendmail的配置修改为如下:

ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.sendmail_settings = { 
  :location       => '/usr/sbin/sendmail.postfix', 
  :arguments      => '-i -t'
}

号外

在解决的过程中尝试过如下的命令:

grep TrustedUser /etc/mail/*cf #查看信任的用户

相关文章

网友评论

      本文标题:Rails发送邮件失败的解决办法

      本文链接:https://www.haomeiwen.com/subject/ttxbmctx.html