From a6ae87d7ac594b8430a0a5d4544912cbb68e4bf9 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Sun, 3 Sep 2023 15:20:56 +0200 Subject: [PATCH] webmail: fix showing attachments that are text/plain and have content-disposition: attachment they were not added to the list of attachments when sending the message to the webmail frontend. they were shown on the "open message in new tab" page. --- webmail/message.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/webmail/message.go b/webmail/message.go index f577cd82f8..5c1376f948 100644 --- a/webmail/message.go +++ b/webmail/message.go @@ -207,13 +207,11 @@ func parsedMessage(log *mlog.Log, m store.Message, state *msgState, full, msgite disp, params, err := mime.ParseMediaType(cp) log.Check(err, "parsing content-disposition", mlog.Field("cp", cp)) if strings.EqualFold(disp, "attachment") { - if full { - name := p.ContentTypeParams["name"] - if name == "" { - name = params["filename"] - } - pm.attachments = append(pm.attachments, Attachment{path, name, p}) + name := p.ContentTypeParams["name"] + if name == "" { + name = params["filename"] } + pm.attachments = append(pm.attachments, Attachment{path, name, p}) return } }