[Rt-devel] No MessageId set for Attachments?

Petter Reinholdtsen pere at hungry.com
Fri Sep 3 08:35:33 EDT 2004


[Ruslan U. Zakirov]
> There is two cases message is multipart and not in 
> Attachments_Overlay::Create(), you've added argument only in one place.

Doh, of course.  I should get a larget terminal. :)

Thank you very much for pointing this out.

This patch is tested and work as it should.  Please include in a
future version of RT.

Now I just need to find a way to map a message id to ticket id. :)

--- lib/RT/Attachment_Overlay.pm        2004-07-12 20:00:53.000000000 +0200
+++ local/lib/RT/Attachment_Local.pm    2004-09-03 14:31:19.000000000 +0200
@@ -131,6 +131,10 @@
     defined($Subject) or $Subject = '';
     chomp($Subject);

+    #Get the MessageID, or undef if not available
+    my $MessageId = $Attachment->head->get( 'message-id', 0 );
+    $RT::Logger->info( "Found message id '$MessageId'" );
+
     #Get the filename
     my $Filename = $Attachment->head->recommended_filename || eval {
        ${ $Attachment->head->{mail_hdr_hash}{'Content-Disposition'}[0] }
@@ -145,6 +149,7 @@
             Parent        => 0,
             ContentType   => $Attachment->mime_type,
             Headers => $Attachment->head->as_string,
+            MessageId     => $MessageId,
             Subject => $Subject);

         foreach my $part ( $Attachment->parts ) {
@@ -176,6 +181,7 @@
                                        ContentEncoding => $ContentEncoding,
                                        Parent          => $args{'Parent'},
                                        Headers       =>  $Attachment->head->as_string,
+                                       MessageId       => $MessageId,
                                        Subject       =>  $Subject,
                                        Content         => $Body,
                                        Filename => $Filename, );


More information about the Rt-devel mailing list