[Rt-devel] No MessageId set for Attachments?

Petter Reinholdtsen pere at hungry.com
Fri Sep 3 04:32:36 EDT 2004


[Ruslan U. Zakirov]
> I don't think that MessageId should be '' if it's undefind. I prefer
> NULL, but anyway next code is more readable

I just duplicated the code for subject.  I agree that NULL would be
better.

> >+    chomp($MessageId);
> useless

If this is useless for MessageId, it is probably useless for the
subject as well.

Second try, making sure $MessageId is NULL if not available, and
dropping the useless chomp().

Index: lib/RT/Attachment_Overlay.pm
===================================================================
--- lib/RT/Attachment_Overlay.pm        (revision 1413)
+++ lib/RT/Attachment_Overlay.pm        (working copy)
@@ -153,6 +153,9 @@
     defined($Subject) or $Subject = '';
     chomp($Subject);

+    #Get the MessageID, or undef if not available
+    my $MessageId = $Attachment->head->get( 'messageid', 0 );
+
     #Get the filename
     my $Filename = $Attachment->head->recommended_filename || eval {
        ${ $Attachment->head->{mail_hdr_hash}{'Content-Disposition'}[0] }
@@ -167,6 +170,7 @@
             Parent        => 0,
             ContentType   => $Attachment->mime_type,
             Headers => $Attachment->head->as_string,
+            MessageId => $MessageId,
             Subject => $Subject);

         foreach my $part ( $Attachment->parts ) {



More information about the Rt-devel mailing list