[DRE-commits] [SCM] ruby-tmail.git branch, master, updated. debian/1.2.7.1-4

Jérémy Bobbio lunar at debian.org
Tue May 7 16:49:35 UTC 2013


The following commit has been merged in the master branch:
commit 56441862f9d74c0c5f4ece76158d182b2c4d0e2a
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Wed Apr 24 22:33:31 2013 +0200

    Add 0004-fix-parsing-of-unquoted-attachment-filenames.patch
    
    Restore proper parsing of unquoted attachment filenames.
    
    Closes: #706117

diff --git a/debian/patches/0004-fix-parsing-of-unquoted-attachment-filenames.patch b/debian/patches/0004-fix-parsing-of-unquoted-attachment-filenames.patch
new file mode 100644
index 0000000..9f8bdb2
--- /dev/null
+++ b/debian/patches/0004-fix-parsing-of-unquoted-attachment-filenames.patch
@@ -0,0 +1,59 @@
+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 <lunar at debian.org>
+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: mikel at example.com
++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: mikel at example.com
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 7739ab1..68be338 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 0001-use_system_rchardet_library.patch
 0002-include_is_binary_data_definition.patch
 0003-deactivate_faulty_test.patch
+0004-fix-parsing-of-unquoted-attachment-filenames.patch

-- 
ruby-tmail.git



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