Your message dated Sun, 26 May 2013 15:17:08 +0000
with message-id <[email protected]>
and subject line Bug#706117: fixed in ruby-tmail 1.2.7.1-3+deb7u1
has caused the Debian Bug report #706117,
regarding ruby-tmail: Improperly parse unquoted attachment filenames
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
706117: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=706117
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
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                        .''`. 
[email protected]                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
Description: Fix parsing of unquoted attachment filenames
 Upstream commit d3f1d826 introduced a problem when parsing Content-Disposition
 headers with unquoted filenames.
Author: Jérémy Bobbio <[email protected]>
Last-Update: 2013-04-24

 lib/tmail/utils.rb       |    2 +-
 test/test_attachments.rb |    1 +
 test/test_mail.rb        |   11 +++++++++++
 3 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/lib/tmail/utils.rb b/lib/tmail/utils.rb
index 68e5898..5c395d3 100644
--- a/lib/tmail/utils.rb
+++ b/lib/tmail/utils.rb
@@ -350,7 +350,7 @@ module TMail
         head, should_quoted, tail = $~.captures
         # head: "; name="
         # should_quoted: "=?ISO-2022-JP?B?...=?="
-        head  << quote_token(should_quoted) << tail
+        head  << quote_token(should_quoted.strip) << tail
       }
     end
     
diff --git a/test/test_attachments.rb b/test/test_attachments.rb
index 86dcb40..72f53d0 100644
--- a/test/test_attachments.rb
+++ b/test/test_attachments.rb
@@ -79,6 +79,7 @@ HERE
     fixture = File.read(File.dirname(__FILE__) + "/fixtures/unquoted_filename_in_attachment")
     mail = TMail::Mail.parse(fixture)
     assert_equal("image/png", mail.attachments.first.content_type)
+    assert_equal("Picture 7.png", mail.attachments.first.original_filename)
   end
 
   def test_unquoted_apple_mail_content_type
diff --git a/test/test_mail.rb b/test/test_mail.rb
index b63f497..52f26da 100644
--- a/test/test_mail.rb
+++ b/test/test_mail.rb
@@ -530,6 +530,17 @@ EOF
     assert_equal(output, mail.to_s)
   end
 
+  def test_mail_to_s_with_unquoted_filename
+    msg = <<EOF
+From: [email protected]
+Subject: =?utf-8?Q?testing_testing_=D6=A4?=
+Content-Disposition: attachment; filename=README.txt.pif
+
+The body
+EOF
+    assert_equal(msg, TMail::Mail.parse(msg).to_s)
+  end
+
   def test_mail_to_s_with_filename_discards_quotes_as_needed
     msg = <<EOF
 From: [email protected]
-- 

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Source: ruby-tmail
Source-Version: 1.2.7.1-3+deb7u1

We believe that the bug you reported is fixed in the latest version of
ruby-tmail, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jérémy Bobbio <[email protected]> (supplier of updated ruby-tmail package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 14 May 2013 11:55:49 +0200
Source: ruby-tmail
Binary: ruby-tmail libtmail-ruby-doc libtmail-ruby1.8
Architecture: source amd64 all
Version: 1.2.7.1-3+deb7u1
Distribution: stable
Urgency: low
Maintainer: Debian Ruby Extras Maintainers 
<[email protected]>
Changed-By: Jérémy Bobbio <[email protected]>
Description: 
 libtmail-ruby-doc - Transitional package for ruby-tmail
 libtmail-ruby1.8 - Transitional package for ruby-tmail
 ruby-tmail - Mail class library for Ruby
Closes: 706117
Changes: 
 ruby-tmail (1.2.7.1-3+deb7u1) stable; urgency=low
 .
   * Add debian/patches/0004-fix-parsing-of-unquoted-attachment-filenames.patch:
     restore proper parsing of unquoted attachment filenames. (Closes: #706117)
Checksums-Sha1: 
 b58ad41ef6689643b677e87bbe2777e9e7322072 2265 ruby-tmail_1.2.7.1-3+deb7u1.dsc
 342ea626b38b916af0e92dbf79b8e650390e540a 6099 
ruby-tmail_1.2.7.1-3+deb7u1.debian.tar.gz
 86c9e8980a144d5b229c2badf3477548fe3cdff2 64108 
ruby-tmail_1.2.7.1-3+deb7u1_amd64.deb
 895a2434387a5c7e2e415d14422361b307f1486e 6422 
libtmail-ruby-doc_1.2.7.1-3+deb7u1_all.deb
 6a762086dd6bd638d6408a2fef19a4410d38fe86 6422 
libtmail-ruby1.8_1.2.7.1-3+deb7u1_all.deb
Checksums-Sha256: 
 d00fa0cf90c57a6f23e2b276b593ae59a7e9b5a428e490aa02baaa0aa4d05d15 2265 
ruby-tmail_1.2.7.1-3+deb7u1.dsc
 df429420d1f063229b915936707926bf6346cbc1956e615534dfa752d6706f44 6099 
ruby-tmail_1.2.7.1-3+deb7u1.debian.tar.gz
 0904b47d2f8ec8e4e705b4e66e34c93eff5e0feee6200260aa3940058515867f 64108 
ruby-tmail_1.2.7.1-3+deb7u1_amd64.deb
 fd61a234d5824b10cc1669d5fd84f69b781c8f192e18448224b342172cf6fea2 6422 
libtmail-ruby-doc_1.2.7.1-3+deb7u1_all.deb
 bf08ef298f0176c26d79d172266e1a1d275b8845345ec22ce5c367e67810235f 6422 
libtmail-ruby1.8_1.2.7.1-3+deb7u1_all.deb
Files: 
 885d7ec7b2881834c0466ac11f347b6e 2265 ruby optional 
ruby-tmail_1.2.7.1-3+deb7u1.dsc
 004aa45da38676113672d0153a2f25c6 6099 ruby optional 
ruby-tmail_1.2.7.1-3+deb7u1.debian.tar.gz
 279d936ce98839f354333e5df6c26242 64108 ruby optional 
ruby-tmail_1.2.7.1-3+deb7u1_amd64.deb
 6d3a4322274558da6571a3f31a535685 6422 oldlibs extra 
libtmail-ruby-doc_1.2.7.1-3+deb7u1_all.deb
 95614890f7ae5af2541983d4a7a7d89d 6422 oldlibs extra 
libtmail-ruby1.8_1.2.7.1-3+deb7u1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBCAAGBQJRofAlAAoJEEgU3sIrMHw8F2AP/2c12uRn0CgiBrWs8FFWkkXW
iw2n3cCOEuWKL2c7tOxVIbIwJiIKQ1rX1wpyanXtwQrUXlrjRL9+CgFWbMYYn/Xm
Dr2Ga9yj2ZP8pSWwJf8KLLCL5M78IiVExutOgCXBhxNb/duYVsgahLwrtONYiM53
itTSWS8lryqjXdLDQjvRjE3d4kuHkdZLAhDM5F/SpADNf1u2yv0J0yJxqhGpTz2P
jH06hXc+Fm8birdVJULt927eUK2P4EAfGJkEQ+y+xmobWKr8EalpsfJsCn7UVXUb
qS4sbleTrf3L7vtWgVM1GEtgYT29y8Hpc2RIBL5uasfYYxTRA02F1LChmD/YTY3r
DmiaLRQLife53mqJ6sT/BRIDcgbFm2K8uhdllxE9QTRQqknYypITcmDHFyHyabms
n7EAhwfz42g8McTWX0LGNgIKe6RIK/HQ4Za85Qm+xMRsaA8NCY6QojvvwfofV7MG
Hsz1vPVGj0LZicnr6ohNoymx4+ZckueVGCxFSTpmQ6Brok68LU1jGTyW0hK4SQ8v
xR5xezjaryg77Z5TN4I7YP3VH7XG45y18nB6SLjxbC1q5kBtMIs/jq5N7YOR5SHE
n3NrGEKtJl8Ka6cLV3+wh9WypZDLfsrW/6xJ7BNqjop3cLU+3QP/mPWJS7ZRBfVV
+Yzemy+H0mhki6h+xMPX
=sme/
-----END PGP SIGNATURE-----

--- End Message ---
_______________________________________________
Pkg-ruby-extras-maintainers mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ruby-extras-maintainers

Reply via email to