Print body structure tree

This commit is contained in:
Simon Ser 2019-12-03 11:11:49 +01:00
parent 80eeaeeb1e
commit 61f2f3e139
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -6,6 +6,21 @@
<h2>{{.Message.Envelope.Subject}}</h2>
<pre>{{.Body}}</pre>
{{define "message-part"}}
{{.MIMEType}}/{{.MIMESubType}}
{{if gt (len .Parts) 0}}
<ul>
{{range .Parts}}
<li>{{template "message-part" .}}</li>
{{end}}
</ul>
{{end}}
{{end}}
{{template "message-part" .Message.BodyStructure}}
{{if .Body}}
<pre>{{.Body}}</pre>
{{end}}
{{template "foot"}}