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 email, we use ActiveJob with deliver_later, to send email in the background with Resque.
Occasionally, perhaps once 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 caused by an SMTP timeout issue from Mandrill.
Does anyone know how to avoid this error? Is it best to retry the failed email, and if so how can this be achieved with ActiveJob and Resque?
I'm also seeing this problem. It does not happen with every send and most of my sends are done from resque jobs. I wonder if this is a transient problem on mandrill's side or a network problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With