$content
package JWebmail::View::RenderMail; use Mojo::Base -base; use Mojo::ByteStream; use Mojo::Util 'xml_escape'; has 'c'; sub render_text_plain { my ($_self, $_subtype, $content, $_path) = @_; $content = xml_escape $content; return qq'
$content
'; $R .= $self->c->link_to($self->c->url_for(raw => id => $self->c->stash('id'))->query(path => join('.', @$path, $i)), (download => $_->{head}{filename}) => sub { 'Attachment ' . xml_escape($_->{head}{filename}) . ' of type ' . to_mime_type($_->{head}); }); $R .= "
\n"; } else { warn "unknown Content-Disposition '$_->{head}{content_disposition}'"; $R .= "unknown Content-Disposition '$_->{head}{content_disposition}'
\n"; } $R .= "Unsupported MIME type of $maintype/$subtype
.