Defect #11376
closedAsynchronous email notifications aren't sent
0%
Description
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. async_smtp_settings
).
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?
Files
Related issues
Updated by Jean-Philippe Lang over 12 years ago
Actually, it works fine if you use:
development: email_delivery: delivery_method: :async_smtp async_smtp_settings: ...
Updated by Etienne Massip over 12 years ago
It's a bit weird and still may be considered as a regression since it used to work with smtp_settings
, should I consider this issue as solved or is it worth it adding the aliases?
Updated by Etienne Massip over 12 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.
Updated by Krisztian Kocsis over 12 years ago
It is still not working for me even if I rename smtp stuff to async_smtp, please check #11337.
Updated by Etienne Massip over 12 years ago
- File async_parameter.patch 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 AM
async
property?
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.
Updated by xuelin ma over 12 years ago
I have the same problem with you and I am so confused about this.
Can you tell me how to solve this problem?
Thanks!
Updated by Etienne Massip over 12 years ago
Replace smtp_settings
with async_smtp_settings
in your configuration.yml
file if you're using async_smtp
method.
Updated by Bruno Medeiros about 12 years ago
I had the same problem and wasted a lot of time. Is it documented somewhere? If it's not, it should. Please point me the right place and I can write some lines about it.
Updated by Bruno Medeiros about 12 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:
async_smtp:
Received: from localhost.localdomain ([200.150.yyy.zzz])
smtp:
Received: from hm6756-32.xxxxxxxxxx.com.br (hm6756-32.xxxxxxxxxxx.com.br. [201.76.yyy.zzz])
After change smtp_settings
to async_smtp_settings
, everything is ok.
Updated by Andrei C. about 12 years ago
Can anybody help me? (Redmine 2.1.2)
After change smtp_settings to async_smtp_settings, i don't receive any email from Redmine.
Updated by Jean-Philippe Lang about 12 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"
...
Updated by Miodrag Milic almost 12 years ago
This was nowhere in documentation and even some Redmine experts published it wrong. I updated the adequate page with this info EmailConfiguration