blob: b5b48a11ebfb8b1e44b15aa366f865ea9327f7e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
% layout 'mainlayout';
% my $mail_fmt = begin
% my ($category, $value) = @_;
% if (ref $value eq 'ARRAY' && $value->@*) {
<dt> <%= uc l $category %> </dt>
% for ($value->@*) {
<dd>
%= $_->{name} ? qq("$_->{name}" <$_->{address}>) : "$_->{address}"
</dd>
% }
% }
% end
<div class="jwm-base">
<h1>Read Mail</h1>
<dl class="jwm-mail-header">
<dt> <%= uc l 'subject' %> </dt>
<dd> <%= $msg->{head}{subject} %> </dd>
%= $mail_fmt->(from => $msg->{head}{from})
%= $mail_fmt->(to => $msg->{head}{to})
%= $mail_fmt->(cc => $msg->{head}{cc})
%= $mail_fmt->(bcc => $msg->{head}{bcc})
<dt> <%= uc l 'date' %> </dt>
<dd> <%= $msg->{head}{date} %> </dd>
% my $content_type = $msg->{head}{mime}{content_maintype} . '/' . $msg->{head}{mime}{content_subtype};
<dt> <%= uc l 'content-type' %> </dt>
<dd> <%= $content_type %> </dd>
</dl>
% my $body = $msg->{body};
% if ($content_type eq 'multipart/alternative') {
% for (reverse @{$body->{parts}}) {
<div class=jwm-mail-body>
% my $x = mime_render($_->{head}{content_maintype}.'/'.$_->{head}{content_subtype}, $_->{body});
%== $x;
</div>
% last if $x;
% }
% }
% elsif ($msg->{head}{mime}{content_maintype} eq 'multipart') {
% for (@{$body->{parts}}) {
<div class=jwm-mail-body>
%== mime_render($_->{head}{content_maintype}.'/'.$_->{head}{content_subtype}, $_->{body});
</div>
% }
% }
% elsif ($msg->{head}{mime}{content_maintype} eq 'message') {
% die "not implemented"
% }
% else {
<div class=jwm-mail-body>
%== mime_render($content_type, $body);
</div>
% }
<nav>
<a href="javascript:history.back()" class="pure-button">
%= l 'back'
</a>
</nav>
</div>
|