diff --git a/plugins/base/routes.go b/plugins/base/routes.go index 7ba6253..0277174 100644 --- a/plugins/base/routes.go +++ b/plugins/base/routes.go @@ -334,7 +334,11 @@ func handleGetPart(ctx *alps.Context, raw bool) error { return fmt.Errorf("failed to parse part Content-Type: %v", err) } if len(partPath) == 0 { - mimeType = "message/rfc822" + if ctx.QueryParam("plain") == "1" { + mimeType = "text/plain" + } else { + mimeType = "message/rfc822" + } } if raw { diff --git a/themes/alps/message.html b/themes/alps/message.html index 5d5f64b..74e2d0b 100644 --- a/themes/alps/message.html +++ b/themes/alps/message.html @@ -11,7 +11,7 @@ {{if .IsText}} href="?part={{.PathString}}" {{else}} - href="/raw?part={{.PathString}}" + href="{{$.Message.URL}}raw?part={{.PathString}}" {{end}} > {{if eq $.Part.PathString .PathString}}{{end}} @@ -178,15 +178,15 @@ {{ $html := .Message.HTMLPart }} {{ $text := .Message.TextPart }}
- {{ if and $html $text }} - {{ if ne $html.PathString $text.PathString }} {{/* https://github.com/golang/go/issues/31103 */}} Plain text + {{ if and $html $text }} + {{ if ne $html.PathString $text.PathString }} HTML {{ end }} {{ end }} + Raw email
{{if .View}} {{.View}} {{else}}

Can't preview this message part.

- Download + Download {{end}}