https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292010-03-12T15:37:29ZRedmineRedmine - Defect #5058: reminder mails are not sent when delivery_method is :async_smtphttps://www.redmine.org/issues/5058?journal_id=150932010-03-12T15:37:29ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Category</strong> set to <i>Email notifications</i></li></ul> Redmine - Defect #5058: reminder mails are not sent when delivery_method is :async_smtphttps://www.redmine.org/issues/5058?journal_id=151002010-03-12T15:54:23ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Confirmed. The reason is that the process doesn't wait for the thread to finish. Adding a simple sleep works but it's not an elegant fix:</p>
<pre>
Index: app/models/mailer.rb
===================================================================
--- app/models/mailer.rb (revision 3560)
+++ app/models/mailer.rb (working copy)
@@ -323,6 +323,7 @@
issues_by_assignee.each do |assignee, issues|
deliver_reminder(assignee, issues, days) unless assignee.nil?
end
+ sleep(10)
end
private
</pre>
<p>Maybe we'd better disable asynchronous sending when sending reminders.</p> Redmine - Defect #5058: reminder mails are not sent when delivery_method is :async_smtphttps://www.redmine.org/issues/5058?journal_id=151562010-03-15T08:49:23ZGo MAEDA
<ul></ul><p>Thanks for investigation.<br />How about this fix? Waiting for all threads to finish.</p>
<pre>
Index: app/models/mailer.rb
===================================================================
--- app/models/mailer.rb (revision 3561)
+++ app/models/mailer.rb (working copy)
@@ -309,6 +309,7 @@
issues_by_assignee.each do |assignee, issues|
deliver_reminder(assignee, issues, days) unless assignee.nil?
end
+ Thread.list.each {|t| t.join(10) unless t == Thread.current}
end
private
</pre> Redmine - Defect #5058: reminder mails are not sent when delivery_method is :async_smtphttps://www.redmine.org/issues/5058?journal_id=257852011-03-01T10:59:01ZEtienne Massip
<ul><li><strong>Target version</strong> set to <i>Candidate for next minor release</i></li></ul> Redmine - Defect #5058: reminder mails are not sent when delivery_method is :async_smtphttps://www.redmine.org/issues/5058?journal_id=257912011-03-01T13:02:26ZEtienne Massip
<ul></ul><p>Go MAEDA wrote:</p>
<blockquote>
<p>Thanks for investigation.<br />How about this fix? Waiting for all threads to finish.</p>
<p>[...]</p>
</blockquote>
<p>Note 19 of <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: no notification on issue creation by mail with redmine:email:receive_imap (Closed)" href="https://www.redmine.org/issues/4228">#4228</a> states that it does not work :(</p> Redmine - Defect #5058: reminder mails are not sent when delivery_method is :async_smtphttps://www.redmine.org/issues/5058?journal_id=263072011-03-12T14:34:27ZEtienne Massip
<ul></ul><p>Would be nice if someone could test this change to <code>lib/tasks/email.rake</code> as proposed in <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: no notification on issue creation by mail with redmine:email:receive_imap (Closed)" href="https://www.redmine.org/issues/4228">#4228</a> :</p>
<pre><code class="ruby syntaxhl"><span class="n">task</span> <span class="ss">:receive_imap</span> <span class="o">=></span> <span class="ss">:environment</span> <span class="k">do</span>
<span class="no">Thread</span><span class="p">.</span><span class="nf">abort_on_exception</span> <span class="o">=</span> <span class="kp">true</span>
<span class="o">...</span>
<span class="p">(</span><span class="n">existing</span> <span class="n">code</span><span class="p">)</span>
<span class="o">...</span>
<span class="n">threads</span><span class="p">.</span><span class="nf">each</span> <span class="p">{</span><span class="o">|</span><span class="n">t</span><span class="o">|</span> <span class="n">t</span><span class="p">.</span><span class="nf">join</span> <span class="p">}</span>
<span class="k">end</span>
</pre></code></pre> Redmine - Defect #5058: reminder mails are not sent when delivery_method is :async_smtphttps://www.redmine.org/issues/5058?journal_id=266552011-03-21T09:01:30ZEtienne Massip
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li></ul><p>Resolved by switching smtp <code>delivery_method</code> setting from <code>async_smtp</code> to <code>smtp</code>, which kind of a feature loss.</p>
<p>Would be great if someone could post a feedback of the change proposed in note-21.</p> Redmine - Defect #5058: reminder mails are not sent when delivery_method is :async_smtphttps://www.redmine.org/issues/5058?journal_id=266572011-03-21T09:03:06ZEtienne Massip
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li></ul><p>Closed accidentally by closing duplicate.</p> Redmine - Defect #5058: reminder mails are not sent when delivery_method is :async_smtphttps://www.redmine.org/issues/5058?journal_id=303232011-06-27T18:06:59ZAnonymous
<ul></ul><p>Etienne, it didnt work for me.</p> Redmine - Defect #5058: reminder mails are not sent when delivery_method is :async_smtphttps://www.redmine.org/issues/5058?journal_id=330402011-10-24T20:55:20ZRobert Hailey
<ul></ul><p>I'm quite sure that this same issue has been causing emails to (sometimes) not be generated in response to email-stimulus (the process-incoming-emails rake task). Drop rate <30%.</p> Redmine - Defect #5058: reminder mails are not sent when delivery_method is :async_smtphttps://www.redmine.org/issues/5058?journal_id=342352011-11-28T04:54:53ZMischa The Evil
<ul></ul><p>I just stumbled upon this issue and finally found out why I never got the reminder emails feature working...</p>
<p>Etienne Massip wrote:</p>
<blockquote>
<p>Would be nice if someone could test this change to <code>lib/tasks/email.rake</code> as proposed in <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: no notification on issue creation by mail with redmine:email:receive_imap (Closed)" href="https://www.redmine.org/issues/4228">#4228</a> :</p>
<p>[...]</code></p>
</blockquote>
<p>Just tested it, but the same as Serge ST, it isn't working.</p>
<p>Note: I've added a reference to this issue on <a class="wiki-page" href="https://www.redmine.org/projects/redmine/wiki/RedmineReminderEmails">RedmineReminderEmails</a> and <a class="wiki-page" href="https://www.redmine.org/projects/redmine/wiki/EmailConfiguration">EmailConfiguration</a>.</p> Redmine - Defect #5058: reminder mails are not sent when delivery_method is :async_smtphttps://www.redmine.org/issues/5058?journal_id=372852012-04-06T18:57:29ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Resolved</i></li><li><strong>Target version</strong> changed from <i>Candidate for next minor release</i> to <i>1.4.0</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>This should be fixed in <a class="changeset" title="Fixed: reminder mails are not sent when delivery_method is :async_smtp (#5058)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/9367">r9367</a>.</p> Redmine - Defect #5058: reminder mails are not sent when delivery_method is :async_smtphttps://www.redmine.org/issues/5058?journal_id=373002012-04-09T06:25:15ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul><p>Merged in <a class="changeset" title="Merged r9367 from trunk." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/9375">r9375</a>.</p>