【问题标题】:Mandrill SMTP giving EOFError: end of file reached errorsMandrill SMTP 给出 EOFError: end of file reached 错误
【发布时间】:2016-05-07 09:32:40
【问题描述】:

我们使用 Mandrill 从我们的 Rails 应用程序(在 Heroku 上)发送交易电子邮件。

# config/environments/production.rb
config.action_mailer.delivery_method = :smtp  
config.action_mailer.smtp_settings = {
  :address   => "smtp.mandrillapp.com",
  :port      => 587,
  :enable_starttls_auto => true,
  :user_name => ENV['MANDRILL_USERNAME'],
  :password  => ENV['MANDRILL_PASSWORD'],
  :authentication => 'login',
  :domain => ENV['URL_OPTIONS_HOST'],
} 

当我们发送电子邮件时,我们使用 ActiveJob 和 Deliver_later,通过 Resque 在后台发送电子邮件。

有时,可能每 2-3 天一次,我们会收到以下错误:

EOFError: end of file reached
File "/app/bin/rake" line 8 in <main>
....
"queue_name": "production_mailers", "job_class": "ActionMailer::DeliveryJob"

我认为这是由 Mandrill 的 SMTP 超时问题引起的。

有谁知道如何避免这个错误?最好重试失败的电子邮件,如果是这样,如何使用 ActiveJob 和 Resque 来实现?

【问题讨论】:

  • 我们已经看到这类问题很长时间了,现在在 Rails 6 上。作业重新运行并最终通过,但它们在我们的错误跟踪器中产生了很多噪音。你有没有找到对付他们的方法?

标签: ruby-on-rails-4 heroku resque mandrill rails-activejob


【解决方案1】:

我也看到了这个问题。并非每次发送都会发生这种情况,而且我的大部分发送都是通过 resque 作业完成的。我想知道这是 mandrill 方面的暂时性问题还是网络问题。

【讨论】:

  • 是的,我认为这是由于 Mandrill 的 SMTP 服务器偶尔不可用或其他网络问题造成的。我还没有找到最好的解决方法。
  • +1,我们偶尔也会看到它。考虑转向基于 API 的发送。你们中的任何一个都找到解决方法了吗?
猜你喜欢
  • 2014-02-16
  • 2015-06-12
  • 2020-04-21
  • 2018-11-12
  • 1970-01-01
  • 1970-01-01
  • 2022-12-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多