Mandrill SMTP gives EOFError: end of file reaches errors

We use Mandrill to send transactional email from our Rails application (on 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'],
} 

When we send emails, we use ActiveJob with delivery to send emails in the background using Resque.

Sometimes, maybe every 2-3 days we get the following error:

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

I think this is caused by Mandrill's SMTP timeout problem.

Does anyone know how to avoid this error? Is it better to repeat a failed letter, and if so, how can this be achieved with ActiveJob and Resque?

+4
source share
1 answer

. , . , mandrill .

+3

Source: https://habr.com/ru/post/1626555/


All Articles