Asynchronous email notifications aren't sent
Since upgrade to 2.x and keeping the SMTP settings untouched (using
:async_smtp delivery method), mails are simply not received anymore.
After digging around, it seems that the settings never make their way to the
Net::SMTP instance and that mail is attempted to be sent with default options (to
localhost:25 with no auth).
According to RoR 3.2.6 code, settings are supposed to be fetched from mailer model using a delivery method-specific getter (e.g.
And indeed, adding the following lines in source:/tags/2.0.3/app/models/mailer.rb is enough to have the notifications sent back again:
class << self alias_attribute :async_smtp_settings, :smtp_settings alias_attribute :async_sendmail_settings, :sendmail_settings end
Aside note: there is no error in log even at development level, why is that?
#6 Updated by Etienne Massip over 8 years ago
Please also note that Rails 4 will handle an
async property directly in the AM instance so the Async* delivery methods might be dropped, see http://reefpoints.dockyard.com/ruby/2012/06/26/rails-4-sneak-peek-async-actionmailer.html.
Not tomorrow, I agree.
#8 Updated by Etienne Massip over 8 years ago
- File async_parameter.patch added
What would you think of turning this into a FR and applying this patch which deprecates
async_* delivery methods in favor of a "Rails 4" style
BTW, please notice that the
AM#deliver! override seems to not be called anymore (and coverage says the same) which may explain the lack of error logging.
#12 Updated by Bruno Medeiros over 8 years ago
In my case my emails didn't stop being sent, it was a more subtle problem. As I have sendmail configured properly on my machine, the mail messages started to be filtered as spam on some receivers. The headers looked like:
Received: from localhost.localdomain ([200.150.yyy.zzz])
Received: from hm6756-32.xxxxxxxxxx.com.br (hm6756-32.xxxxxxxxxxx.com.br. [201.76.yyy.zzz])
async_smtp_settings, everything is ok.
#14 Updated by Jean-Philippe Lang over 8 years ago
- Status changed from Confirmed to Closed
- Target version deleted (
Candidate for next minor release)
- Resolution set to Invalid
Closing it. The proper configuration for using asynchronous SMTP is:
production: email_delivery: delivery_method: :async_smtp async_smtp_settings: address: "localhost" ...