[DRE-maint] Bug#706117: ruby-tmail: Improperly parse unquoted attachment filenames

Jérémy Bobbio lunar at debian.org
Wed Apr 24 20:56:39 UTC 2013


Package: ruby-tmail
Version: 1.2.7.1-3
Severity: important
Justification: regression over Squeeze and affects Schleuder
Control: tags -1 + patch

The following test case shows that TMail currently wrongly parses
unquoted attachment filenames:

--- 8< ---
require 'tmail'
m = TMail::Mail.parse(<<END_OF_MESSAGE)
Content-Type: text/x-diff; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: attachment; filename=statuts.diff

Test
END_OF_MESSAGE
p m['content-type']
p m['content-disposition']
puts m.to_s
--- >8 ---

Outputs:

--- 8< ---
#<TMail::ContentTypeHeader "text/x-diff; charset=utf-8\n">
#<TMail::ContentDispositionHeader "attachment; filename=statuts.diff\n">
Content-Type: text/x-diff; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: attachment; filename="statuts.diff
"

Test
--- >8 ---

The same test case does not insert the '\n"' sequence with version 1.2.3
in Squeeze.

After bisecting upstream changes, it looks like this was introduced by
the following commit:
<https://github.com/mikel/tmail/commit/d3f1d826df44e83287c690d58194f54b42500b0d>

The attached patch adds a test case and fix the issue by properly
striping the newline.

This is an important issue as without a fix, Schleuder chokes (as in
raising an error) on a good deal of emails which worked perfectly
fine on Squeeze.

-- 
Jérémy Bobbio                        .''`. 
lunar at debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-fix-parsing-of-unquoted-attachment-filenames.patch
Type: text/x-diff
Size: 1924 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-ruby-extras-maintainers/attachments/20130424/f410166f/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-ruby-extras-maintainers/attachments/20130424/f410166f/attachment.pgp>


More information about the Pkg-ruby-extras-maintainers mailing list