forked from Silverfish/proton-bridge
fix: only set ContentID for inline attachments
This commit is contained in:
@ -510,7 +510,11 @@ func parseAttachment(h message.Header) (*pmapi.Attachment, error) {
|
||||
}
|
||||
}
|
||||
|
||||
att.ContentID = strings.Trim(h.Get("Content-Id"), " <>")
|
||||
// Only set ContentID if it should be inline;
|
||||
// API infers content disposition based on whether ContentID is present.
|
||||
if disp, _, err := h.ContentDisposition(); err == nil && disp == "inline" {
|
||||
att.ContentID = strings.Trim(h.Get("Content-Id"), " <>")
|
||||
}
|
||||
|
||||
return att, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user