[rt-users] Official Attachment Status

Art Morales ArtMorales at scionpharma.com
Fri May 16 14:32:24 EDT 2003


Hi there,

I applied the fixes and I can indeed see attachments included through
the web interface, but not if they are sent by email and the mailgate...


Art

-----Original Message-----
From: Autrijus Tang [mailto:autrijus at autrijus.org] 
Sent: Thursday, May 15, 2003 8:26 AM
To: Art Morales
Cc: rt-users at lists.fsck.com
Subject: Re: [rt-users] Official Attachment Status


On Wed, May 14, 2003 at 10:14:55AM -0400, Art Morales wrote:
> Hello,
> 
> After reading through the archives, I'm not entirely clear if 
> attachments are supposed to be working in the latest version (3.0.2). 
> Mine aren't, so before I dig down to figure out what I did wrong, I 
> was wondering if we could get the official word.  I'm running RH8, 
> apache2/modperl1.99 (everything else works great)

Unicode-characters in WebUI's "file attachments" has been fixed here by
the change below.  Hadn't tested it with the mail-gateway, though.

Thanks,
/Autrijus/

Change 5860 by autrijus at ehrtest on 2003/05/15 12:00:25

	* utf8 filenames in attachments is now ok.
	* no longer attempts to convert web-attached textual parts into
utf8, only the body.

Affected files ...

... //depot/RT/rt/lib/RT/Attachment_Overlay.pm#18 edit
... //depot/RT/rt/lib/RT/Interface/Web.pm#50 edit

Differences ...

==== //depot/RT/rt/lib/RT/Attachment_Overlay.pm#18 (text) ====

@@ -136,7 +136,10 @@
     chomp($Subject);
 
     #Get the filename
-    my $Filename = $Attachment->head->recommended_filename;
+    my $Filename = $Attachment->head->recommended_filename || eval {
+	${ $Attachment->head->{mail_hdr_hash}{'Content-Disposition'}[0]
}
+	    =~ /^.*\bfilename="(.*)"$/ ? $1 : ''
+    };
 
     if ( $Attachment->parts ) {
         $id = $self->SUPER::Create(

==== //depot/RT/rt/lib/RT/Interface/Web.pm#50 (text) ====

@@ -453,6 +453,8 @@
         );
     }
 
+    RT::I18N::SetMIMEEntityToUTF8($Message); # convert text parts into 
+ utf-8
+
     my $cgi_object = $m->cgi_object;
 
     if (my $filehandle = $cgi_object->upload(
$args{'AttachmentFieldName'} ) ) { @@ -478,10 +480,11 @@
     $filename = "$filehandle" unless defined($filename);
                    
     $filename =~ s#^.*[\\/]##;
+
     $Message->attach(
         Path     => $temp_file,
-        Filename => $filename,
-        Type     => $uploadinfo->{'Content-Type'}
+        Filename => Encode::decode_utf8($filename),
+        Type     => $uploadinfo->{'Content-Type'},
     );
     close($fh);
 
@@ -490,7 +493,6 @@
     }
 
     $Message->make_singlepart();
-    RT::I18N::SetMIMEEntityToUTF8($Message); # convert text parts into
utf-8
     return ($Message);
 
 }



More information about the rt-users mailing list