Your message dated Wed, 24 Mar 2010 20:42:52 +0000 (WET)
with message-id <[email protected]>
and subject line Package request-tracker3.4 has been removed from Debian
has caused the Debian Bug report #429597,
regarding request-tracker3.6: RFC 2047 header decoding is broken
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.)


-- 
429597: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=429597
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: request-tracker3.6
Version: 3.6.1-4
Severity: normal
Tags: patch fixed-upstream

RT 3.6.1 decodes RFC 2047 MIME headers incorrectly when there are encoded
words mixed with unencoded equals ('=') signs in the same string. This
affects parsing of incoming emails, including their Subject lines, and
may result in a failure to extract the ticket number from the Subject
line of a ticket reply.

An example RFC 2047 encoded header is 

X-MyHeader: key="plain"; key="=?iso-8859-1?Q?encoded?="

Feeding this to the following one-liner:

% perl -Ilib -MRT::I18N -lne 'print RT::I18N::DecodeMIMEWordsToEncoding($_, 
"utf8")'

gives just 

"encoded" 

ie. everything before the encoded part is lost.

The attached patch was applied to upstream SVN branch 3.4-RELEASE as
revision 5822 (released in 3.4.6) and merged into branch 3.6-RELEASE
in revision 6039 (released in 3.6.2).

With the patch the above example decoder returns

X-MyHeader: key="plain"; key="encoded"

as expected.

I'll clone a separate bug to document this for the Etch 3.4 users too.

Cheers,
-- 
Niko Tyni   [email protected]
--- lib/RT/I18N.pm	(revision 5821)
+++ lib/RT/I18N.pm	(revision 5822)
@@ -289,11 +289,13 @@
     my $str = shift;
     my $enc = shift;
 
-   
-    @_ = $str =~ m/([^=]*)=\?([^?]+)\?([QqBb])\?([^?]+)\?=([^=]*)/g;
-
+    @_ = $str =~ m/(.*?)=\?([^?]+)\?([QqBb])\?([^?]+)\?=([^=]*)/gc;
     return ($str) unless (@_);
 
+    # add everything that hasn't matched to the end of the latest
+    # string in array this happen when we have 'key="=?encoded?="; key="plain"'
+    @_[-1] .= substr($str, pos $str);
+
     $str = "";
     while (@_) {
 	my ($prefix, $charset, $encoding, $enc_str, $trailing) =

--- End Message ---
--- Begin Message ---
Version: 3.4.5-2+rm

You filed the bug http://bugs.debian.org/429597 in Debian BTS
against the package request-tracker3.4. I'm closing it at *unstable*, but it 
will
remain open for older distributions.

For more information about this package's removal, read
http://bugs.debian.org/447059. That bug might give the reasons why
this package was removed and suggestions of possible replacements.

Don't hesitate to reply to this mail if you have any question.

Thank you for your contribution to Debian.

--
Marco Rodrigues


--- End Message ---

Reply via email to