% layout 'mainlayout'; % my $mail_fmt = begin % my ($category, $value) = @_;
<%= ucfirst l $category %>
%= ref $value ? join(' ' . l('and') . ' ', map {"$_->{name} <$_->{address}>"} @$value) : $value
% end

Read Mail

<%= uc l 'subject' %>
<%= $msg->{head}{subject} %>
%= $mail_fmt->('from', $msg->{head}{from}) %= $mail_fmt->('to', $msg->{head}{to}) %= $mail_fmt->('cc', $msg->{head}{cc}) if !ref $msg->{head}{cc} || @{ $msg->{head}{cc} } %= $mail_fmt->('bcc', $msg->{head}{bcc}) if !ref $msg->{head}{bcc} || @{ $msg->{head}{bcc} }
<%= uc l 'date' %>
<%= $msg->{head}{date} %>
<%= uc l 'size' %>
<%= print_sizes10 $msg->{size} %>
<%= uc l 'content-type' %>
<%= $msg->{head}{content_type} %>
% my $body = $msg->{body}; % if ($msg->{head}{content_type} eq 'multipart/alternative') { % for (reverse @$body) {
% my $x = mime_render($_->{head}{content_type}, $_->{body}); %== $x;
% last if $x; % } % } % elsif (ref $body eq 'HASH') { % for (%$body) {
%== mime_render($_->{head}{content_type}, $_->{body});
% } % } % else {
%== mime_render($msg->{head}{content_type}, $body);
% }