my @body;
my @parts;
- if ( $m->{present} ) {
- my $tempdir = File::Temp::tempdir();
- my $e = $m->get_mime($tempdir);
- my $et = $e->effective_type;
- $bodyent = getmailbody($e);
- push @body, $bodyent->bodyhandle->as_lines;
- rmtree $tempdir, 0, 1;
- @parts = getmailparts($e);
-
- # Strip leading and trailing blank lines
- shift @body while @body and $body[0] !~ /\S/;
- pop @body while @body and $body[$#body] !~ /\S/;
- }
- else {
- @body = ("Message not present in archive\n");
- }
my @archives = archive_list( $m->{msgid} );
print pre(
{ -class => "headers" },
. join( ", ", @archives ) . " ]"
) . "\n";
- my $nr = 1;
- foreach my $part (@parts) {
- print pre( { -class => "mime" }, parthdr( $part, $m, $nr ) ) . "\n"
- unless $#parts eq 0;
- print pre( { -class => "body" }, htmlsanit( join( "", @body ) ) ) . "\n"
- if $part == $bodyent;
- $nr++;
+ if ( $m->{present} ) {
+ my $tempdir = File::Temp::tempdir();
+ my $e = $m->get_mime($tempdir);
+ my $et = $e->effective_type;
+ $bodyent = getmailbody($e);
+ push @body, $bodyent->bodyhandle->as_lines;
+ rmtree $tempdir, 0, 1;
+ @parts = getmailparts($e);
+
+ # Strip leading and trailing blank lines
+ shift @body while @body and $body[0] !~ /\S/;
+ pop @body while @body and $body[$#body] !~ /\S/;
+
+ my $nr = 1;
+ foreach my $part (@parts) {
+ print pre( { -class => "mime" }, parthdr( $part, $m, $nr ) ) . "\n"
+ unless $#parts eq 0;
+ print pre( { -class => "body" }, htmlsanit( join( "", @body ) ) )
+ . "\n"
+ if $part == $bodyent;
+ $nr++;
+ }
}
+ else {
+ @body = ("Message not present in archive\n");
+ print pre( { -class => "body" }, htmlsanit( join( "", @body ) ) )
+ . "\n";
+ }
+
print hr . "\n";
}