Your message dated Tue, 07 May 2013 16:19:19 +0000
with message-id <[email protected]>
and subject line Bug#706117: fixed in ruby-tmail 1.2.7.1-4
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]
--
signature.asc
Description: Digital signature
--- End Message ---
--- Begin Message ---
Source: ruby-tmail
Source-Version: 1.2.7.1-4
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, 07 May 2013 15:52:14 +0200
Source: ruby-tmail
Binary: ruby-tmail
Architecture: source amd64
Version: 1.2.7.1-4
Distribution: unstable
Urgency: medium
Maintainer: Debian Ruby Extras Maintainers
<[email protected]>
Changed-By: Jérémy Bobbio <[email protected]>
Description:
ruby-tmail - Mail class library for Ruby
Closes: 706117
Changes:
ruby-tmail (1.2.7.1-4) unstable; urgency=medium
.
* Team upload.
* Set urgency to medium, as it fixes a painful bug affecting Schleuder.
* Add debian/patches/0004-fix-parsing-of-unquoted-attachment-filenames.patch:
restore proper parsing of unquoted attachment filenames. (Closes: #706117)
* Remove transitional packages.
Checksums-Sha1:
04c2c921d18fe73da4973c9ec12d889bf1d5a93f 2088 ruby-tmail_1.2.7.1-4.dsc
f60ce3dd2ef1bbce188739c97fb1c535d3ef5690 5971
ruby-tmail_1.2.7.1-4.debian.tar.gz
b0c60c12fd03cbc64233d5d04bb24cb548bc8460 64072 ruby-tmail_1.2.7.1-4_amd64.deb
Checksums-Sha256:
49f2936a565d4d7ebe055e607160a91ed9fbbf376b1ca32334db1b13c8b9c0e8 2088
ruby-tmail_1.2.7.1-4.dsc
1a9d57aa09498b2dfc696e5a5a67b9340187d582ef8e594dce6217631271fcee 5971
ruby-tmail_1.2.7.1-4.debian.tar.gz
9169ea7e8a81f13682c5fe91a1ccc38105a5b2fa6778310d2776bec16fe90d4f 64072
ruby-tmail_1.2.7.1-4_amd64.deb
Files:
9b37cf2e2251516606f58479d8c7974d 2088 ruby optional ruby-tmail_1.2.7.1-4.dsc
c20fbcfdb0bd9d0e64f4fc9e336658ad 5971 ruby optional
ruby-tmail_1.2.7.1-4.debian.tar.gz
c6fe1fdfd53ea83b7cbd65cf2c634ed9 64072 ruby optional
ruby-tmail_1.2.7.1-4_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iQIcBAEBCAAGBQJRiSKHAAoJEEgU3sIrMHw8UyQP/0YQ6VJERFpwoGuUr97WqjHe
5AN1RKugzAIELIvKtj5eYjb6QwFGcdnc97nIIbabsp/IYq+tu+dtBGnY+KJHcwJ1
nkBmDNqLCNgKGvoSiQN9fptTX+YAIYUzFqVn5llyk9IRan5q3kEtxj2yZ7wNXs0A
H8aK3fQtripglNqG923rAioACQZVJKmSoLGTCSstQdkQ3oybRJ9gNQpLW7h7ZxOY
DdBFNBGhHdRgyDZhZjc7MzdcvKNh7CcLs82iastsxg4Iv0IZ/Qi5wwTz0gaa8YLa
3Ea1EMRqYcffiHOU3MN+mlygKDiHgOpiMyFpnM3KRWR4SUOByhbJ7BPyFFwbxGTk
SotDTZ9mu/psHz2XTy9qyU/UGotl6hklaPfjBUEKRet3V+E+RQM05LXtvc2GYyed
/woMeexF9iGJpcIQNPo1mwjpkVWn9Rw1J63KCi8Wzx1FvXgT3SNniEl2VMxUZCXi
KSdn/+OyrqavW/rAbrhYDfnE+x3bn5tRTqvYec6CAynKI27TdjOmTUfQXJO5/BnF
kToM5TeMa8QbQb8Yl9I0qSzUpeIla1NQ0opwWFzZ3FzKzRBuC+gNdpGYJfK9v2Y/
1yPMOVMHKF5os8U+4UdTAE8jfdwO+OValizrZ+O1Or84zqwG3Ybp/qEBRolESDgk
+zLeSUd2AJ5m2B20kpWn
=wSGH
-----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