プロジェクト

全般

プロフィール

Vote #66677

完了

Email notifications on file upload sent to empty recipient list

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Email notifications_9
対象バージョン:
開始日:
2010/02/24
期日:
進捗率:

0%

予定工数:
category_id:
9
version_id:
18
issue_org_id:
4920
author_id:
12534
assigned_to_id:
1
comments:
9
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
16
ステータス-->[Closed]

説明

I have installed a vanilla copy of Redmine 0.9.2.stable.3474 (MySQL)

In administration -> settings -> Email notifications, the emission email address is correctly set, and "file added" is ticked for notifications.
If I click "Send a test email" from the bottom of the page, the test email is correctly sent and received to my email inbox.

If I now go to a project with just myself as a member, and upload a file, a delivery failure is bounced to the sending account.
Looking in the mailserver logs for the receiving server, I can see that no receipients are set:

qmail-queue-handlers[1697]: Handlers Filter before-queue for qmail started ...
qmail-queue-handlers[1697]: from=redmine@****.co.uk
qmail-queue-handlers[1697]: to=
qmail-queue-handlers[1697]: hook_dir = '/usr/local/psa/handlers/before-queue'
qmail-queue-handlers[1697]: recipient[3] = ''

I have tested this with and without 'BCC' selected in the email notifications settings, with identical results.

Why is Redmine not sending the email with a list of recipients?


journals

As per the FAQ, I modified my config/environments/production.rb settings so that mailer activities would be logged. As you can see, this confirms the issue of no recipient addresses being used:
<pre>
Processing ProjectsController#add_file (for xxx.xxx.xxx.xxx at 2010-02-24 15:50:08) [POST]
Parameters: {"commit"=>"Add", "action"=>"add_file", "authenticity_token"=>"PhQkKzGZ2diEjdIdjsZHPootAQpWWElnx4LkI22/I=", "id"=>"projectid", "controller"=>"projects", "attachments"=>{"1"=>{"file"=>#<File:/tmp/RackMultipart20100224-84201-1ashycm-0>, "description"=>"test"}}}
Sent mail to
Redirected to http://*******.co.uk/projects/projectid/files
Completed in 508ms (DB: 3) | 302 Found [http://*******.co.uk/projects/projectid/files/new]
</pre>

--------------------------------------------------------------------------------
Further to the details above ... My original installation of Redmine was on OSX. That copy is still installed, and still broken.

Since then I created a Fedora VM to test it out there, installed Redmine, and everything is working as expected.

Both installations are approximately identical, bar a few vendor packaging differences.
Both use Apache, Passenger, MySQL, and rails versions. Also, they're both configured with the same email account/server for sending mail.

There is one difference ... Fedora has Ruby 1.8.6, and OSX has Ruby 1.8.7.
I find it hard to believe that is the problem though.
--------------------------------------------------------------------------------
Emails without recipients should not be sent.
A test was added for that in r3518 and it passes with ruby 1.8.7.
--------------------------------------------------------------------------------
I have retested on OSX, with another user added to the project. Again, when a file is uploaded an email is generated with no recipients.
The problem isn't that an email isn't being sent, but that an email is being sent without recipients.

Identical tests on my Fedora installation work perfectly, only my OSX installation is affected.

I have re-installed my OSX redmine from scratch, to be sure I haven't messed up the install, and the problem still occurs.
--------------------------------------------------------------------------------
I just want to add some details:
if submit any changes to the issues, we can see in production.log the message like this: <pre>Sending email notification to: name1.surname1@email.domain.com, name2.surname2@email.domain.com, name3.surname3@email.domain.com</pre>

but if we add a new document or upload a file, we can see another recipients list: <pre>Sending email notification to: Name1 Surname1, Name2 Surname2, Name3 Surname3</pre>

and the notification is not received in the last case.
the logic for recipients has been updated in app/modules/mailer.rb for 9.2 version, and it seems not accurately well.
--------------------------------------------------------------------------------
I've changed app/models/mailer.rb a little and now all notifications are sent to their recipients
<pre><code lang="ruby">Index: app/models/mailer.rb
===================================================================
--- app/models/mailer.rb (revision 3521)
+++ app/models/mailer.rb (working copy)
@@ -114,11 +114,11 @@
when 'Project'
added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container)
added_to = "#{l(:label_project)}: #{container}"
- recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}
+ recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|m| m.mail}
when 'Version'
added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container.project_id)
added_to = "#{l(:label_version)}: #{container.name}"
- recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}
+ recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|m| m.mail}
when 'Document'
added_to_url = url_for(:controller => 'documents', :action => 'show', :id => container.id)
added_to = "#{l(:label_document)}: #{container.title}"
</code></pre>
--------------------------------------------------------------------------------
I've added those changes to my OSX installation and retested ... notifications for file uploads now work perfectly.
--------------------------------------------------------------------------------
Fixed was committed in r3532.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,4966,Defect #4671 No Email Notification on New File Added to Redmine

Admin Redmine さんがほぼ2年前に更新

  • カテゴリEmail notifications_9 にセット
  • 対象バージョン0.9.4_18 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0