hook(type => "preprocess", id => "mailbox", call => \&preprocess);
} # }}}
-
sub preprocess (@) { #{{{
my %params=@_;
}
+sub make_pair($$){
+ my $message=shift;
+ my $name=shift;
+ my $val=$message->header($_);
+ my $hash={'HEADERNAME'=>$name,'VAL'=>$val};
+ return $hash;
+}
sub format_message(@){
my %params=@_;
my $template=
template("email.tmpl") || error gettext("missing template");
-
- my @headers=map { {'HEADERNAME'=>$_,'VAL'=>$message->header($_)} }
- $message->header_names;
+ my @headers=map { make_pair($message,$_) }
+ $message->header_names;
$template->param(HEADERS=>[@headers]);
$template->param(body=>$message->body);
my $output=$template->output();
- print STDERR $output;
return $output;
}