Defect #11376

Asynchronous email notifications aren't sent

Added by Etienne Massip over 4 years ago. Updated about 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email notifications
Target version:-
Resolution:Invalid Affected version:2.0.3

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?

async_parameter.patch Magnifier (1.38 KB) Etienne Massip, 2012-07-16 21:03


Related issues

Related to Redmine - Defect #12115: Sending Email redmine 2.1.2 Closed
Duplicated by Redmine - Defect #11634: Asynchronous delivery not work Closed

History

#1 Updated by Etienne Massip over 4 years ago

  • Description updated (diff)

Typo.

#2 Updated by Etienne Massip over 4 years ago

  • Description updated (diff)

#3 Updated by Sepp _ over 4 years ago

Tested, works ;-)

#4 Updated by Jean-Philippe Lang over 4 years ago

Actually, it works fine if you use:

development:
  email_delivery:
    delivery_method: :async_smtp
    async_smtp_settings:
      ...

#5 Updated by Etienne Massip over 4 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?

#6 Updated by Etienne Massip over 4 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.

#7 Updated by Krisztian Kocsis over 4 years ago

It is still not working for me even if I rename smtp stuff to async_smtp, please check #11337.

#8 Updated by Etienne Massip over 4 years ago

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.

#9 Updated by xuelin ma over 4 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!

#10 Updated by Etienne Massip over 4 years ago

Replace smtp_settings with async_smtp_settings in your configuration.yml file if you're using async_smtp method.

#11 Updated by Bruno Medeiros over 4 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.

#12 Updated by Bruno Medeiros over 4 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.

#13 Updated by Andrei C. over 4 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.

#14 Updated by Jean-Philippe Lang about 4 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" 
      ...

#15 Updated by Miodrag Milic about 4 years ago

This was nowhere in documentation and even some Redmine experts published it wrong. I updated the adequate page with this info EmailConfiguration

Also available in: Atom PDF