You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Multiple attachments with same name get the same Content-ID, causing them to refer to the same file content #480
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.
changed the title [-]Multiple attachments with same name get the same Content-ID[/-][+]Multiple attachments with same name get the same Content-ID, causing them to refer to the same file content[/+]on Nov 26, 2023
changed the title [-]Multiple attachments with same name get the same Content-ID, causing them to refer to the same file content[/-][+]Bug: Multiple attachments with same name get the same Content-ID, causing them to refer to the same file content[/+]on Nov 26, 2023
Activity
bbottema commentedon Nov 23, 2023
Hmm, interesting. I'm not a fan of using UUID, that makes the filenames unwieldy, but a sequence number could work... I'll have a look.
rkurman commentedon Nov 23, 2023
Isn't the filename determined by the filename parameter of the Content-Type header? The Content-ID should not have any influence on the filename.
#480: generate unique Content-ID's for attachments so attachments wit…
[-]Multiple attachments with same name get the same Content-ID[/-][+]Multiple attachments with same name get the same Content-ID, causing them to refer to the same file content[/+][-]Multiple attachments with same name get the same Content-ID, causing them to refer to the same file content[/-][+]Bug: Multiple attachments with same name get the same Content-ID, causing them to refer to the same file content[/+]bbottema commentedon Nov 26, 2023
This should now be fixed in 8.3.2. Can you please verify, if you get a chance?
rkurman commentedon Feb 2, 2024
I can confirm that the problem is resolved now (I checked with version 8.6.2).
Thank you very much, sir.