【发布时间】:2015-01-23 11:21:27
【问题描述】:
我在我的 Rails 应用程序中使用 sendmail。配置如下,
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => 'localhost' }
config.action_mailer.default_options = {from: 'no-reply@example.com'}
config.action_mailer.delivery_method = :sendmail
当我重新启动我的 apache2 服务器和 sendmail 服务时,我会收到一封邮件(一次)。但是,如果稍后我尝试发送邮件,它会显示状态为 200-ok,但我不会收到任何邮件。
仅供参考:
即使localhost:3000也发现了同样的问题
下面也是我的 mail.log 输出
Nov 25 17:58:02 dosysnet267 sendmail[1602]: sAPCS2X3001602: Authentication-Warning: dosysnet267.dreamorbit.in: DREAMORBIT\\karthik.ds set sender to no-reply@gmail.com using -f
Nov 25 17:58:02 dosysnet267 sendmail[1602]: sAPCS2X3001602: from=no-reply@gmail.com, size=473, class=0, nrcpts=1, msgid=<547475d2aa8c3_5dc181896c66978@dosysnet267.mail>, relay=DREAMORBIT\\karthik.ds@localhost
Nov 25 17:58:03 dosysnet267 sm-mta[1604]: sAPCS2bg001604: from=<no-reply@gmail.com>, size=774, class=0, nrcpts=1, msgid=<547475d2aa8c3_5dc181896c66978@dosysnet267.mail>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Nov 25 17:58:03 dosysnet267 sendmail[1602]: sAPCS2X3001602: to=karthik.ds@example.com, ctladdr=no-reply@gmail.com (1200096887/1200095745), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30473, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (sAPCS2bg001604 Message accepted for delivery)
Nov 25 17:58:05 dosysnet267 sm-mta[1609]: sAPCS2bg001604: to=<karthik.ds@example.com>, delay=00:00:03, xdelay=00:00:02, mailer=esmtp, pri=120774, relay=example.com. [174.136.95.75], dsn=2.0.0, stat=Sent (OK)
有什么想法吗?
【问题讨论】:
-
您可以分享发送该电子邮件时调用的代码吗?
-
UserMailer.welcome_user(self).deliver!
-
哦!对我来说似乎没问题。顺便说一句,你检查你的垃圾邮件文件夹了吗?
-
感谢您的回复。是的,我查过了,但没有邮件。
-
好吧,我似乎无能为力。对不起。
标签: ruby-on-rails email sendmail