Add inline attachments to comments

If incoming email is configured and an email is sent, inline
attachments are currently not added to the comment if it has the
`Content-Disposition: inline` instead of
`Content-Disposition: attachment` as e.g. with Apple Mail.

This adds inline attachments (`Content-Disposition: inline`) that have a
filename as attachment to the comment.

Fixes #3496
This commit is contained in:
Beowulf 2024-04-28 00:33:03 +02:00
parent bfdbc2371d
commit 162b840100
No known key found for this signature in database
GPG key ID: 44225F5F2792841D

View file

@ -367,6 +367,14 @@ func getContentFromMailReader(env *enmime.Envelope) *MailContent {
Content: attachment.Content,
})
}
for _, inline := range env.Inlines {
if inline.FileName != "" {
attachments = append(attachments, &Attachment{
Name: inline.FileName,
Content: inline.Content,
})
}
}
return &MailContent{
Content: reply.FromText(env.Text),