https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292011-06-22T12:13:49ZRedmineRedmine - Defect #8651: Email attachments from Apple Mail are not added to issues any more in v1.2https://www.redmine.org/issues/8651?journal_id=301602011-06-22T12:13:49ZRoderik van der Veer
<ul></ul><p>We did some additional debugging and testing (several hours worth :))</p>
<p>"Forwarded email" is always the same one, but we did these tests with multiple emails</p>
<p>New email from Thunderbird on Linux, HTML mail, file attached, no inline image in footer: everything ok<br />New email from Apple Mail on OSX, HTML mail, file attached, no inline image: everything ok<br />New email from Apple Mail on OSX, HTML mail, file attached, inline image: no attachments (no image, and no file)<br />New email from Apple Mail on OSX, Plain Text mail, file attached, inline image: everything ok<br />Forwarded email, originated on Apple Mail on OSX, HTML, no inline image, file attached, forwarded on Thunderbird on Linux as HTML: everything ok<br />Forwarded email, originated on Apple Mail on OSX, HTML, no inline image, file attached, forwarded on Apple Mail OSX as HTML: no attachments<br />Forwarded email, originated on Apple Mail on OSX, HTML, no inline image, file attached, forwarded on Apple Mail OSX as Plain text: everything OK<br />Forwarded email, originated on Apple Mail on OSX, HTML, no inline image, file attached, forwarded on Mail on iOS (ipad/iPhone), don't know the format, i guess html, no inline image, file attached: no attachments<br />New email from Mail on iOS, format unknown, file attached: everything ok.</p>
<p>So in conclusion, as soon as there are inline attachments like Apple does them, no attachments will be added.</p>
<p>I've got a workaround for now by converting them into plain text, but i cannot use the system anymore for customers to send in their bugs with screenshots and i cannot dispatch incoming emails from my iOS devices.</p>
<p>We tried debugging (we are not Ruby programmers but we are programmers :)) but as far as we can determine the issue is in ActionMailer</p> Redmine - Defect #8651: Email attachments from Apple Mail are not added to issues any more in v1.2https://www.redmine.org/issues/8651?journal_id=301622011-06-22T14:05:29ZDaan Poron
<ul></ul><p>I did some further debugging, the problem lies in ActionMailer and has something to do with how Apple Mail handles boundaries. In Tmail::Mail it will read create an object of the mail received. Here it will check for attachments using the boundaries used in mails to separate multiple parts. The problem we are having with Apple Mail is that the boundary defined in the header of the mail is different then for the Actual attachments.</p>
<p>In the header we have this boudary defined:<br />Content-Type: multipart/alternative; boundary="Apple-Mail=_E8397270-291C-4746-8EB1-D568A0ABA967"</p>
<p>Our plain text mail is separated using the right boundary:<br />--Apple-Mail=_E8397270-291C-4746-8EB1-D568A0ABA967</p>
<p>But then our attachments are separated using this boundary:<br />--Apple-Mail=_DA9B1844-6394-4218-88C6-9A692179991E</p>
<p>Before the Attachments We have this part which defines a new boundry:<br />--Apple-Mail=_E8397270-291C-4746-8EB1-D568A0ABA967<br />Content-Type: multipart/mixed;<br /> boundary="Apple-Mail=_DA9B1844-6394-4218-88C6-9A692179991E"</p>
<p>I tried checking the code of TMail::Mail in the method read_multipart but i am not sure if this is done recursively. As Roderik said before we are not experienced Ruby programmers :)</p>
<p>Kind regards,<br />Daan</p> Redmine - Defect #8651: Email attachments from Apple Mail are not added to issues any more in v1.2https://www.redmine.org/issues/8651?journal_id=302252011-06-24T12:39:47ZRoderik van der Veer
<ul></ul><p>We ran a test with an old version of redmine using rails 2.3.5. Redmine 1.0.0.devel.3898 (MySQL)<br />and the same emails work flawlessly there.</p>
<p>I've gotten new emails with the same problems from other clients, so i'm fairly sure it's not an issue with my system :)</p> Redmine - Defect #8651: Email attachments from Apple Mail are not added to issues any more in v1.2https://www.redmine.org/issues/8651?journal_id=302262011-06-24T14:05:11ZDaan Poron
<ul></ul><p>Fixed it by making a small change in the mail_handler model. I added '|| email.multipart?' to the if-statement. The problem for as far as i understand it, is that has_attachments doesn't check for attachments recursively as i tried to explain before. When a multipart mail, has a multipart part with an attachment in the multipart part, then it won't find this. by checking if the mail is multipart, it will get all the attachments, and creates them. The function to get all the attachments in TMail does look for attachments recursively so it will find the deeper nested attachments.</p> Redmine - Defect #8651: Email attachments from Apple Mail are not added to issues any more in v1.2https://www.redmine.org/issues/8651?journal_id=304622011-07-03T15:27:57ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Can you provide a patch for this change and a raw email with such an attachment so I can add a test case?</p> Redmine - Defect #8651: Email attachments from Apple Mail are not added to issues any more in v1.2https://www.redmine.org/issues/8651?journal_id=307802011-07-15T13:38:34ZAlex Shulgin
<ul><li><strong>File</strong> <a href="/attachments/6291">alexk-3.eml.gz</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/6291/alexk-3.eml.gz">alexk-3.eml.gz</a> added</li></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>Can you provide a patch for this change and a raw email with such an attachment so I can add a test case?</p>
</blockquote>
<p>We're also affected by this bug. Only HTML emails originating from Apple's Mail.app seem to cause the problem.</p>
<p>Attached is a sample raw email (gzipped) with all headers which triggers the problem.</p>
<p>In my understanding the problem lies within TMail's <code>has_attachments?</code> code. If I load the mail into <code>TMail::Mail</code> object, I can see that <code>attachments</code> list is non-empty, but <code>has_attachments?</code> give false, so the attachments list is never considered by redmine mail handler.</p>
<pre>
$ ./script/console
Loading development environment (Rails 2.3.11)
>> mail=TMail::Mail.load('/.../alexk-3.eml')
=> #<TMail::Mail port=#<TMail::FilePort:/.../alexk-3.eml> bodyport=nil>
>> mail.has_attachments?
=> false
>> mail.attachments
=> [#<TMail::Attachment:0xa4dff80>]
</pre>
<p>I've also filed this issue against Rails, here: <a class="external" href="https://github.com/rails/rails/issues/2051">https://github.com/rails/rails/issues/2051</a></p> Redmine - Defect #8651: Email attachments from Apple Mail are not added to issues any more in v1.2https://www.redmine.org/issues/8651?journal_id=307812011-07-15T14:10:04ZDaan Poron
<ul><li><strong>File</strong> <a href="/attachments/6292">8651.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/6292/8651.patch">8651.patch</a> added</li></ul><p>I tried making a patch, not sure this will work, patch can be found as attachment. You should patch mail_handler.rb in app/models/</p> Redmine - Defect #8651: Email attachments from Apple Mail are not added to issues any more in v1.2https://www.redmine.org/issues/8651?journal_id=311632011-07-29T17:02:12ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Target version</strong> set to <i>1.2.2</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Thanks, I was able to reproduce with the example email.<br />Fixed and test added in <a class="changeset" title="Fixed: attachments from Apple Mail not added by mail handler (#8651)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/6324">r6324</a>.</p> Redmine - Defect #8651: Email attachments from Apple Mail are not added to issues any more in v1.2https://www.redmine.org/issues/8651?journal_id=311652011-07-29T17:06:40ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p><a class="changeset" title="Fixed: attachments from Apple Mail not added by mail handler (#8651)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/6324">r6324</a> broke all other tests. <a class="changeset" title="Fixes mail handler for when there's no attachments (#8651)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/6325">r6325</a> is just fine.</p> Redmine - Defect #8651: Email attachments from Apple Mail are not added to issues any more in v1.2https://www.redmine.org/issues/8651?journal_id=336472011-11-11T11:35:19ZJean-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 r6324 and r6325 from trunk (#8651)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/7766">r7766</a>.</p> Redmine - Defect #8651: Email attachments from Apple Mail are not added to issues any more in v1.2https://www.redmine.org/issues/8651?journal_id=336902011-11-12T22:11:02ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Subject</strong> changed from <i>Email attachments are not added to issues any more in v1.2</i> to <i>Email attachments from Apple Mail are not added to issues any more in v1.2</i></li></ul>