Project

General

Profile

Actions

Defect #11376

closed

Asynchronous email notifications aren't sent

Added by Etienne Massip over 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email notifications
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

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

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

Related issues

Related to Redmine - Defect #12115: Sending Email redmine 2.1.2Closed

Actions
Has duplicate Redmine - Defect #11634: Asynchronous delivery not workClosed

Actions
Actions #1

Updated by Etienne Massip over 12 years ago

  • Description updated (diff)

Typo.

Actions #2

Updated by Etienne Massip over 12 years ago

  • Description updated (diff)
Actions #3

Updated by Sepp _ over 12 years ago

Tested, works ;-)

Actions #4

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:
      ...
Actions #5

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?

Actions #6

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.

Actions #7

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.

Actions #8

Updated by Etienne Massip over 12 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.

Actions #9

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!

Actions #10

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.

Actions #11

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.

Actions #12

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.

Actions #13

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.

Actions #14

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" 
      ...
Actions #15

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

Actions

Also available in: Atom PDF