% layout 'mainlayout';
% my $mail_fmt = begin
% my ($category, $value) = @_;
% if (ref $value eq 'ARRAY' && $value->@*) {
Read Mail
% my $body = $msg->{body};
% if ($content_type eq 'multipart/alternative') {
% for (reverse @{$body->{parts}}) {
% my $x = mime_render($_->{head}{content_maintype}.'/'.$_->{head}{content_subtype}, $_->{body});
%== $x;
% last if $x;
% }
% }
% elsif ($msg->{head}{mime}{content_maintype} eq 'multipart') {
% for (@{$body->{parts}}) {
%== mime_render($_->{head}{content_maintype}.'/'.$_->{head}{content_subtype}, $_->{body});
% }
% }
% elsif ($msg->{head}{mime}{content_maintype} eq 'message') {
% die "not implemented"
% }
% else {
%== mime_render($content_type, $body);
% }