Skip to content

Commit

Permalink
webmail: fix showing attachments that are text/plain and have content…
Browse files Browse the repository at this point in the history
…-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.
  • Loading branch information
mjl- committed Sep 3, 2023
1 parent 4283cee commit a6ae87d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions webmail/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit a6ae87d

Please sign in to comment.