Project

General

Profile

Actions

Defect #18383

closed

An error occurred while sending mail (undefined method `error' for :log:Symbol)

Added by Michael Kling over 9 years ago. Updated over 9 years ago.

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

0%

Estimated time:
Resolution:
Affected version:

Description

While sending a test mail the following error is displayed as a result in the settings Email notifications tab:

An error occurred while sending mail (undefined method `error' for :log:Symbol)

Still i receive the test mail.

I encountered this bug while customers complained about not receiving emails. Using debug log i could get the following informations:

Stack:

NoMethodError (undefined method `error' for :log:Symbol):
  app/models/mailer.rb:430:in `deliver_mail'
  app/models/mailer.rb:86:in `block (2 levels) in deliver_issue_edit'
  app/models/issue.rb:826:in `each_notification'
  app/models/mailer.rb:85:in `block in deliver_issue_edit'
  app/models/journal.rb:77:in `block in each_notification'
  app/models/journal.rb:75:in `each'
  app/models/journal.rb:75:in `each_notification'
  app/models/mailer.rb:84:in `deliver_issue_edit'
  app/models/journal.rb:190:in `send_notification'
  app/models/journal.rb:54:in `save'
  app/models/issue.rb:1511:in `create_journal'
  app/models/issue.rb:165:in `create_or_update'
  app/controllers/issues_controller.rb:470:in `block in save_issue_with_child_records'
  app/controllers/issues_controller.rb:458:in `save_issue_with_child_records'
  app/controllers/issues_controller.rb:184:in `update'

That is the super method of the mailer class (ActionMailer::deliver_mail) called at this line.
In order to get more detailed informations i printed out the mail object given to the method and got this in the log - while updating the issue the customer complained about not receiving an email:

Rendered mailer/_issue.html.erb (7.8ms)
Rendered mailer/issue_edit.html.erb within layouts/mailer (15.1ms)
Try to deliver:
#<Mail::Message:60142340, Multipart: true, Headers: <From: m***t@a***o.de>, <To: >, <Cc: >, <Bcc: ["s***h@i***i.com", "a***n@a***o.de", "t***a@a***o.de", "c***i@a***o.de", "M***e@a***o.de", "c***s@s***p.net", "e***a@i***i.com"]>, <Message-ID: <redmine.journal-89253.20141119103615.67eb855ef4d4ad2e@a***o.de>>, <References: <redmine.issue-11121.20141017201624@a***o.de>>, <Subject: [*** Support - Task #11121] create new redmine account for N***r>, <Mime-Version: 1.0>, <Content-Type: multipart/alternative; boundary="--==_mimepart_546c72a06b7e0_1e6c33e4fc412591"; charset=UTF-8>, <X-Redmine-Project: i***u>, <X-Redmine-Issue-Id: 11121>, <X-Redmine-Issue-Author: s***h>, <X-Redmine-Issue-Assignee: Michael.Kling>, <X-Redmine-Sender: Michael.Kling>, <X-Mailer: Redmine>, <X-Redmine-Host: r***p.net>, <X-Redmine-Site: Project-Management>, <X-Auto-Response-Suppress: OOF>, <Auto-Submitted: auto-generated>, <List-Id: <m***o.de>>>
Email delivery error: undefined method `error' for :log:Symbol

(i marked internal informations with *** )

From what i see the mail object looks good.

I tried to look into the actionmailer but my ruby knowledge isn't good enough to go further.
The actionmailer installed is: /vendor/bundle/gems/actionmailer-3.2.17

Environment is:

Environment:
  Redmine version                2.4.3.stable
  Ruby version                   1.9.3-p484 (2013-11-22) [x86_64-linux]
  Rails version                  3.2.17
  Environment                    production
  Database adapter               Mysql2
SCM:
  Git                            1.9.1
  Filesystem
Redmine plugins:
  redmine_auto_watchers          0.3.0
  redmine_backlogs               v1.0.6
  redmine_better_gantt_chart     0.9.0
  redmine_dmsf                   1.4.7 stable
  redmine_git_hosting            0.6.2
  redmine_graphs                 0.1.0
  redmine_hudson                 2.1.1
  redmine_lightbox               0.0.1
  redmine_merge_redmine          0.1.0
  redmine_monitoring_controlling 0.1.1
  redmine_private_wiki           0.2.2
  redmine_spent_time             2.4.0

I tried different mail send options:
/config/configuration.yml

default:
  # Outgoing emails configuration (see examples above)
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: 127.0.0.1
      port: 25
      domain: ascendro.de
      authentication: :login
      user_name: "m***t@a***e" 
      password: "***" 
      openssl_verify_mode: 'none'

and

default:
  # Outgoing emails configuration (see examples above)
  email_delivery:
    delivery_method: :sendmail

without any change.

As already said, i was able to receive the test mail but it is possible that this error appears while sending the first mail and other people will not receive an email anymore.

Actions #1

Updated by Michael Kling over 9 years ago

  • Status changed from New to Resolved

Ok resolved it... the error occured because i did this in /config/environments/production.rb:

  # Disable delivery errors if you bad email addresses should just be ignored
  config.action_mailer.raise_delivery_errors = false

  # No email in production log
  # config.action_mailer.logger = nil
  config.action_mailer.logger = :log

  config.active_support.deprecation = :log

But putting the :log there was wrong. I just should have comment the nil assertion.
Like this:

  # Disable delivery errors if you bad email addresses should just be ignored
  config.action_mailer.raise_delivery_errors = false

  # No email in production log
  # config.action_mailer.logger = nil

  config.active_support.deprecation = :log

The log then generates this:

  Rendered mailer/_issue.text.erb (12.6ms)
  Rendered mailer/issue_edit.text.erb within layouts/mailer (21.2ms)
  Rendered mailer/_issue.html.erb (12.5ms)
  Rendered mailer/issue_edit.html.erb within layouts/mailer (21.1ms)

Sent email "[*** Support - Task #11121] create new redmine account for N***r" (131ms)
  bcc: s***h@i***i.com, A***n@a***o.de, t***a@a***o.de, c***i@a***o.de, M***e@a***o.de, c***s@s***p.net, e***a@i***i.com
Redirected to http://m***o.de/issues/11121

I'm sorry that i wasted your time, i for sure wasted a lot :/

Still dont know why a customer doesn't receive his emails, i'm assuming the issue is not on redmines side.

Actions #2

Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from Resolved to Closed

OK, thanks for the feedback.

Actions

Also available in: Atom PDF