https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292011-07-07T04:47:17ZRedmineRedmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=305542011-07-07T04:47:17ZAlexander Kulemin
<ul></ul><p>I set settings: use BCC in emails. And emails start to work good! But if I don't set use BCC - bug is coming back..</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=312432011-08-03T09:13:10ZTiffany C
<ul></ul><p>I got the same problem after updating to 1.2.1. When there are 6 or 7 recipients (To and/or CC), it happened to me. Is there any limitation on http header size?</p>
<p>I hope this problem can be fix soon!</p>
<p>Thanks.</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=312502011-08-03T22:05:52ZTerence Mill
<ul></ul><p>same here!<br />+1</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=312542011-08-04T02:50:07ZKiwamu Kato
<ul></ul><p>The root cause is TMail version in ActionMailer.<br />There is a strange issue with TMail version 1.2.6 - 1.2.7.1.</p>
<p>(Redmine 1.1.x used Rails 2.3.5 and ActinMailer 2.3.5 used TMail 1.2.3, so it was ok.)</p>
<ul>
<li>Wrong adresses in headers</li>
<li><a class="external" href="https://github.com/mikel/tmail/issues/7">https://github.com/mikel/tmail/issues/7</a><br /><pre>
I discover strange issue with TMail version 1.2.6 - 1.2.7.1.
TMail adds unnecessary line breaks to headers with multiple email adresses.
For example this code:
m=TMail::Mail.new
m.to = ["a.user@example.com", "v.user2@example.com", "e.smith@example.com", "info@example.com", "v.pupkin@example.com"]
puts m.encoded
Produces string with empty lines (double line breaks: "\r\n\t\r\n\"):
=> "To: a.user@example.com,\r\n\t v.user2@example.com,\r\n\t e.smith@example.com,\r\n\t\r\n\tinfo@example.com,\r\n\t v.pupkin@example.com\r\n\r\n"
This mean end of headers part of email (and broke some clients like Outlook 2003).
</pre></li>
</ul>
<p>The fix is here:<br /><a class="external" href="https://github.com/eac/tmail/commit/05940a3c9882147b090b061f7242a796515a2d1e">https://github.com/eac/tmail/commit/05940a3c9882147b090b061f7242a796515a2d1e</a>.</p>
<p>Or downgrade to TMail 1.2.3.</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=313382011-08-08T20:23:34ZDrew Keller
<ul><li><strong>File</strong> <a href="/attachments/6399">encode.rb</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/6399/encode.rb">encode.rb</a> added</li><li><strong>File</strong> <a href="/attachments/6400">header.rb</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/6400/header.rb">header.rb</a> added</li></ul><p>Most of the changes in eac's patch are whitespace fixes. I skipped those and only made the changes in fold_the_string(), but it didn't seem to fix the problem (maybe I missed something or maybe it was based on some other revision). So I also applied the few changes to header.rb and encode.rb as noted at <a class="external" href="https://github.com/mikel/tmail/issues/7">https://github.com/mikel/tmail/issues/7</a>. Outlook is happy now.</p>
Note that there are TMail packages at two locations
<ul>
<li>REDMINE_ROOT\vendor\rails\actionmailer\lib\action_mailer\vendor\tmail-1.2.7\</li>
<li>RUBY_ROOT\lib\ruby\gems\1.8\gems\actionmailer-2.3.11\lib\action_mailer\vendor\tmail-1.2.7\</li>
</ul> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=317992011-08-26T07:53:42ZGilles Cornu
<ul><li><strong>File</strong> <a href="/attachments/6483">redmine_email_recipients_problem.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/6483/redmine_email_recipients_problem.png">redmine_email_recipients_problem.png</a> added</li></ul><p>Alexander Kulemin wrote:</p>
<blockquote>
<p>I set settings: use BCC in emails. And emails start to work good! But if I don't set use BCC - bug is coming back..</p>
</blockquote>
<p>I used the same workaround as Alexander to be able to upgrade my production with Redmine <a class="version" href="https://www.redmine.org/versions/27">1.2.0</a>. I'm happy to see that the problem is identified and I may integrate the patch/fix if Redmine is not fixed asap... Please target this ticket to the next bug fix release of branch 1.2.x ... Such regression is quite bad (see example below):</p>
<p><img src="https://www.redmine.org/attachments/download/6483/redmine_email_recipients_problem.png" alt="" /></p>
<p>Kind regards, Gilles</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=318022011-08-26T08:26:10ZEtienne Massip
<ul><li><strong>Affected version (unused)</strong> set to <i>1.2.0</i></li><li><strong>Affected version</strong> set to <i>1.2.0</i></li></ul> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=318032011-08-26T08:37:25ZEtienne Massip
<ul></ul><p>Gilles Cornu wrote:</p>
<blockquote>
<p>Please target this ticket to the next bug fix release of branch 1.2.x ...</p>
</blockquote>
<p>Actually, it is a TMail issue, so how could we fix Redmine??</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=318052011-08-26T10:37:44ZGilles Cornu
<ul></ul><p>Etienne Massip wrote:</p>
<blockquote>
<p>Gilles Cornu wrote:</p>
<blockquote>
<p>Please target this ticket to the next bug fix release of branch 1.2.x ...</p>
</blockquote>
<p>Actually, it is a TMail issue, so how could we fix Redmine??</p>
</blockquote>
<p>A buggy version of TMail library (1.2.7, problem is present since 1.2.6 and still not solved in latest release, 1.2.7.1) is bundled in Rails 2.3.11, which is the <a class="wiki-page" href="https://www.redmine.org/projects/redmine/wiki/RedmineInstall">current requirement for Redmine 1.2.x</a>. Even worse, the <a href="https://github.com/eac/tmail/commit/05940a3c9882147b090b061f7242a796515a2d1e" class="external">tmail fix</a> has not yet been merged into <a class="external" href="https://github.com/mikel/tmail/commits/master">https://github.com/mikel/tmail/commits/master</a> (even no pull request opened so far).</p>
I see several option to make Redmine release(s) <strong>more robust for Integration Regressions</strong> (by preference order):
<ol>
<li>include/freeze Rails framework (and maybe other libs) directly into redmine packages/releases. This way it would be possible to (temporarily) fork/fix the library bug, and thus be more responsive for Redmine Users. Deployment would be also easier. I don't know how easy it is to do so... (I have similar experiences in PHP world, where I systematically package the complete Symfony 1.4 framework, with customization/hacks if needed)</li>
<li>Increase votes/pressure on Rails 2.3.x (latest was 2.3.14) and TMail 1.2.x to obtain ASAP a fixed release. Once done, change Redmine documentation...</li>
</ol>
<p>I know it's <em>uninteresting stuff</em> from Redmine Developer point of view, but such kind of bugs are critical for end-user acceptance (hopefully we have here the <em>BCC workaround</em>) and therefore Redmine committers + community have strong interest to contribute to these dependencies...</p>
<p>My conclusion: don't reject the issue, but maybe change the category or tracker to something like <strong>Integration Defect</strong>, that clearly expresses that Redmine code is not guilty, but that Redmine Release Management cares about ASAP integrates a library that works. What's your opinion ?</p>
<p>Regards, Gilles</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=318062011-08-26T10:40:14ZGilles Cornu
<ul></ul><p>Gilles Cornu wrote:</p>
<blockquote>
<p>My conclusion: don't reject the issue, but maybe change the category or tracker to something like <strong>Integration Defect</strong>,</p>
</blockquote>
<p>=> switch category to 'third-party libraries' ?</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=318072011-08-26T10:43:38ZGilles Cornu
<ul></ul><p>I guess that Web Frameworks (even more complex) meet now the same debate as the old one C/C++ debate between dynamic or static linking... see <a class="external" href="http://en.wikipedia.org/wiki/Static_library#Advantages_of_static_linking">http://en.wikipedia.org/wiki/Static_library#Advantages_of_static_linking</a></p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=318142011-08-26T12:39:41ZEtienne Massip
<ul></ul><p>Gilles Cornu wrote:</p>
<blockquote>
<p>A buggy version of TMail library (1.2.7, problem is present since 1.2.6 and still not solved in latest release, 1.2.7.1) is bundled in Rails 2.3.11, which is the <a class="wiki-page" href="https://www.redmine.org/projects/redmine/wiki/RedmineInstall">current requirement for Redmine 1.2.x</a>.</p>
</blockquote>
<p>I will update <a class="wiki-page" href="https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Requirements">requirements</a> to include a warning about TMail 1.2.7 version.</p>
<blockquote>
<p>Even worse, the <a href="https://github.com/eac/tmail/commit/05940a3c9882147b090b061f7242a796515a2d1e" class="external">tmail fix</a> has not yet been merged into <a class="external" href="https://github.com/mikel/tmail/commits/master">https://github.com/mikel/tmail/commits/master</a> (even no pull request opened so far).</p>
</blockquote>
<p>I think that the problem is the lack of activity on the TMail project, probably explained by the switch by the RoR project to the use of the Mail gem (by the same author, <a class="external" href="https://github.com/mikel/mail">https://github.com/mikel/mail</a>) as an external dependency for Rails 3.</p>
<blockquote>
<ol>
<li>include/freeze Rails framework (and maybe other libs) directly into redmine packages/releases. This way it would be possible to (temporarily) fork/fix the library bug, and thus be more responsive for Redmine Users. Deployment would be also easier.</li>
</ol>
</blockquote>
<p>Downloadable Redmine packages already includes Rails and its dependencies, including TMail. But there is few probabilities that the RM team will ever tweak the bundled files, sounds like a dirty thing.</p>
<blockquote>
<ol>
<li>Increase votes/pressure on Rails 2.3.x (latest was 2.3.14) and TMail 1.2.x to obtain ASAP a fixed release. Once done, change Redmine documentation...</li>
</ol>
</blockquote>
<p>Feel free to increase pressure on the TMail issue.</p>
<blockquote>
<p>I know it's <em>uninteresting stuff</em> from Redmine Developer point of view, but such kind of bugs are critical for end-user acceptance (hopefully we have here the <em>BCC workaround</em>) and therefore Redmine committers + community have strong interest to contribute to these dependencies...</p>
</blockquote>
<p>There is not really more useful contribution to be done: the issue is known from the TMail author and pretty well identified.</p>
<blockquote>
<p>My conclusion: don't reject the issue, but maybe change the category or tracker to something like <strong>Integration Defect</strong>, that clearly expresses that Redmine code is not guilty, but that Redmine Release Management cares about ASAP integrates a library that works. What's your opinion ?</p>
</blockquote>
<p>This issue will eventually be rejected since this is not a Redmine defect, I keep it open for now because it's more obvious if someone is looking for it.</p>
<p>As Kiwamu said, the solution is to either monkey patch TMail or downgrade it.</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=318162011-08-26T14:09:35ZGilles Cornu
<ul></ul><p>Etienne Massip wrote [...]</p>
<p>Etienne, I agree with all your arguments. IMHO it means that Rails projects (like Redmine) are forced to upgrade 'soon' to latest major version of Rails (after basic googling, it seems there is no 'long term support' goal for 2.3.x). Shouldn't Redmine team now raises the priority of <a class="issue tracker-2 status-5 priority-3 priority-lowest closed" title="Feature: Rails 3 support (Closed)" href="https://www.redmine.org/issues/4796">#4796</a> ?</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=318172011-08-26T14:25:24ZEtienne Massip
<ul></ul><p>Upgrading to Rails 3 is not absolutely needed since Rails 2.3 series is still supported by RoR team and works pretty well (except for this regression); JPL has not stated yet about Ruby 1.9 and Rails 3.1 support (which itself requires Ruby 1.9 support).</p>
<p>Of course, this support will end some day, and upgrading will then become a priority, but there is some time remaining since Rails 3 still does not support plugins and database migrations (Rails 2.3 does). Rails 3.1 will, and RM will then be able to move to it.</p>
<p>By the way, if you look carefully at <a class="issue tracker-2 status-5 priority-3 priority-lowest closed" title="Feature: Rails 3 support (Closed)" href="https://www.redmine.org/issues/4796">#4796</a>, you'll see that Toshi has already made some changes in trunk and external repos towards both Ruby 1.9 and Rails 3 support.</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=319922011-09-04T21:24:57ZGilles Cornu
<ul></ul><p>Etienne Massip wrote:</p>
<blockquote>
<p>Gilles Cornu wrote:</p>
<blockquote>
<p>Please target this ticket to the next bug fix release of branch 1.2.x ...</p>
</blockquote>
<p>Actually, it is a TMail issue, so how could we fix Redmine??</p>
</blockquote>
<p>I've noticed that Redmine already includes some Dependency-Hotfixes by overriding external library code in <a href="http://www.redmine.org/projects/redmine/repository/changes/trunk/config/initializers/10-patches.rb" class="external">*config/initializers/10-patches.rb*</a></p>
<p>Actually the upgrade to Rails 2.3.11 (<a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Upgrade to Rails 2.3.11 (Closed)" href="https://www.redmine.org/issues/6887">#6887</a>) needed another patch on TMail 1.2.7, see <a class="changeset" title="Updgraded Rails to 2.3.11 (#6887)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/4904">r4904</a>.</p>
<p>Therefore, I would propose to apply the <a href="https://github.com/eac/tmail/commit/05940a3c9882147b090b061f7242a796515a2d1e#L0R555" class="external">TMail patch from 'eac'</a> directly into redmine code, until Redmine can be integrated with a fixed version of Rails 2.3.x/TMail 1.2.x</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=319932011-09-04T23:56:15ZDrew Keller
<ul><li><strong>File</strong> <a href="/attachments/6502">11-tmail_multiple_recipients_patch.rb</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/6502/11-tmail_multiple_recipients_patch.rb">11-tmail_multiple_recipients_patch.rb</a> added</li></ul><p>This is the monkey patch I'm using (placed in <span>redmine</span>/config/initializers)</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=319972011-09-05T05:32:37ZGilles Cornu
<ul></ul><p>Drew Keller wrote:</p>
<blockquote>
<p>This is the monkey patch I'm using (placed in <span>redmine</span>/config/initializers)</p>
</blockquote>
<p>Awesome! it perfectly works and this is quite nicer way to quick fix a Redmine Setup. Thanks a lot Drew!</p>
<p>I do vote to integrate this quick-fix ASAP into branch 1.2 (until TMail is fixed or Redmine upgrades to Rails 3.1.x)</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=320042011-09-05T07:17:12ZEtienne Massip
<ul><li><strong>Target version</strong> set to <i>Candidate for next minor release</i></li><li><strong>Affected version (unused)</strong> changed from <i>1.2.0</i> to <i>1.2.1</i></li><li><strong>Affected version</strong> changed from <i>1.2.0</i> to <i>1.2.1</i></li></ul><p>Right.</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=335892011-11-08T13:35:57Zkiran patil
<ul></ul><p>Etienne Massip wrote:</p>
<blockquote>
<p>Right.</p>
</blockquote>
<p>Redmine works without 11-tmail_multiple_recipients_patch.rb.</p>
<p>I am getting error message as follows when I place it in initializers folder.</p>
<p>[git@localhost redmine-1.2.1]$ rake db:migrate:plugins RAILS_ENV=production<br />rake aborted!<br />/home/git/redmine-1.2.1/config/initializers/11-tmail_multiple_recipients_patch.rb:1: syntax error, unexpected '<'<br /><!DOCTYPE html PUBLIC "-//W3C//...<br /> ^<br />/home/git/redmine-1.2.1/config/initializers/11-tmail_multiple_recipients_patch.rb:2: syntax error, unexpected '<'<br /><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><br /> ^<br />/home/git/redmine-1.2.1/config/initializers/11-tmail_multiple_recipients_patch.rb:2: syntax error, unexpected tIDENTIFIER, expecting $end<br /><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><br /> ^</p>
<p>Tasks: TOP => db:migrate:plugins => environment<br />(See full trace by running task with --trace)</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=336172011-11-10T00:37:53ZDrew Keller
<ul></ul><p>kiran patil wrote:</p>
<blockquote>
<p>Redmine works without 11-tmail_multiple_recipients_patch.rb.</p>
</blockquote>
<p>I believe you will only see the problem on certain email clients. Notably for me, Outlook 2002 which more than half of my users have. Other email clients may be able to parse through the headers.</p>
<blockquote>
<p>I am getting error message as follows when I place it in initializers folder.</p>
<p>[git@localhost redmine-1.2.1]$ rake db:migrate:plugins RAILS_ENV=production<br />rake aborted!<br />/home/git/redmine-1.2.1/config/initializers/11-tmail_multiple_recipients_patch.rb:1: syntax error, unexpected '<'<br /><!DOCTYPE html PUBLIC "-//W3C//...<br />^</p>
</blockquote>
<p>This looks like the start of web page code instead of ruby code. I'm guessing the file didn't download correctly.</p> Redmine - Defect #8751: Email notification: bug, when number of recipients more then 8https://www.redmine.org/issues/8751?journal_id=339132011-11-20T09:44:28ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Target version</strong> changed from <i>Candidate for next minor release</i> to <i>1.3.0</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Drew's patch <a class="attachment" href="https://www.redmine.org/attachments/6502">11-tmail_multiple_recipients_patch.rb</a> applied in <a class="changeset" title="Fixed: TMail 1.2.7 malforms To header when number of recipients more then 8 (#8751)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/7863">r7863</a>.</p>