Skip to content

Bug: Multiple attachments with same name get the same Content-ID, causing them to refer to the same file content #480

@rkurman

Description

@rkurman

When I'm trying to send an email where multiple attachments with the same name, the receiver thinks that it is always the same attachment and shows the same content for all attached files.
I have tested this with versions 6.5.2 and 8.3.1.

In my opinion, the problem is the assignment of the BodyPart ID in org.simplejavamail.converter.internal.mimemessage.MimeMessageHelper.getBodyPartFromDatasource(AttachmentResource, String) (line 288) where the Content-ID header of the part is based solely on the filename of the attachment. I suggest to always add a UUID at the end to ensure uniqueness.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions