[rt-devel] Decoding of Subjects broken in 3.0.3pre3 (3.0.3pre2 was OK)

Jesse Vincent jesse at bestpractical.com
Wed Jun 11 13:43:46 EDT 2003


Interesting.  What if you back it out just for the Subject, but leave it
in for the Headers?  The problem we're trying to solve is that _some_
mail readers send headers containing _unencoded_ non-ascii character
sets, which makes postgres go down in flames. Which is clearly not what
we want ;)


On Wed, Jun 11, 2003 at 04:47:33PM +0400, Dmitry Sivachenko wrote:
> Hello!
> 
> In 3.0.3pre3 you committed the following patch.  It broke charset recongizing
> of Subjects like =?koi8-r?B?1MXT1A==?=
> This perfectly valid subject, but after RT processing it becomes '????????'.
> 
> When I rollback the following patch, everythink becomes OK.
> 
> Please fix!
> 
> 
> Thanks!!!
> 
> 
> 
> --- rt-3-0-3pre2/lib/RT/Attachment_Overlay.pm   Thu Jun  5 01:22:36 2003
> +++ rt-3-0-3pre3/lib/RT/Attachment_Overlay.pm   Wed Jun 11 00:17:58 2003
> @@ -146,8 +146,11 @@
>              TransactionId => $args{'TransactionId'},
>              Parent        => 0,
>              ContentType   => $Attachment->mime_type,
> -            Headers       => $Attachment->head->as_string,
> -            Subject       => $Subject,
> +
> +            # We need to untaint the data here, because there's a high likelyho
> od that some incompetent MUA
> +            # Author will try to put bogus non-ascii data in a message header.
> +            Headers => Encode::encode( utf8 => $Attachment->head->as_string, En
> code::FB_PERLQQ ),
> +            Subject => Encode::encode( utf8 => $Subject, Encode::FB_PERLQQ )
> 
>          );
>          foreach my $part ( $Attachment->parts ) {
> @@ -219,14 +222,15 @@
>              $Body = MIME::Base64::encode_base64($Body);
> 
>          }
> -
>          my $id = $self->SUPER::Create( TransactionId => $args{'TransactionId'},
>                                         ContentType   => $Attachment->mime_type,
>                                         ContentEncoding => $ContentEncoding,
>                                         Parent          => $args{'Parent'},
> +                                       # We need to untaint the data here, beca
> use there's a high likelyhood that some incompetent MUA
> +                                       # Author will try to put bogus non-ascii
>  data in a message header.
> +                                       Headers       => Encode::encode(utf8 =>
> $Attachment->head->as_string, Encode::FB_PERLQQ),
> +                                       Subject       => Encode::encode(utf8 =>
> $Subject, Encode::FB_PERLQQ),
>                                         Content         => $Body,
> -                                       Headers  => $Attachment->head->as_string
> ,
> -                                       Subject  => $Subject,
>                                         Filename => $Filename, );
>          return ($id);
>      }
> _______________________________________________
> rt-devel mailing list
> rt-devel at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-devel
> 

-- 
http://www.bestpractical.com/rt  -- Trouble Ticketing. Free.



More information about the Rt-devel mailing list