-
-
Notifications
You must be signed in to change notification settings - Fork 723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jodd-mail: SendMailSession.createAttachmentBodyPart(): Content-Disposition and Content-ID should be independent from each other #404
Comments
Hey @JensPiegsa! If I understood right, your suggestion is to separate setting
setContentId(String contentId, boolean inline) (Of course, overloaded 1-argument version would be available).
.embed(attachment().bytes(new File(PNG)).setContentId("jodd1.png"))
.embed(attachment().bytes(new File(PNG)).setContentId("jodd2.png").setInline(true)) I don't see any difference in Gmail web client, both inline and non-inline shows as 'embedded', i.e. attachment is not shown. But again, as you said, its just email client. Do you have a public one, just to test?
Thank you, I think this is all for now :) |
Hi @igr ! I completely agree with your ideas - that's how it should be. The different behaviour was observed with Group Office and Outlook. I'd be happy to review / test this change. Jens |
Hey @JensPiegsa If you can find some time to review: https://github.com/oblac/jodd/tree/email-404 It would be super cool! 🥇 |
Hey @igr I build and tested the branch and want to give you a short update about this issue. I'm still puzzled here. Eliminating the spotted difference between the working and the non-working email did not lead to the expected solution. There seems to be something else causing the wanted behaviour. Maybe it's about the kind of nesting of multi-parts. Given that this is a rather minor issue, we should propably leave it well alone, until there is a clear way to solve it with plain java-mail. Thanks again for the effort! |
PS: some unit test are not compatible with Windows: jodd.io.FileNameUtilTest > testGetRelativePaths FAILED
jodd.io.FileNameUtilTest > testResolveHome FAILED
jodd.util.PathUtilTest > testResolve FAILED
|
@JensPiegsa if you find such email you can download it to EML format (plaintext) and send it to me, so I can check the headers... Thanx for testing! |
.. I xed out the addresses. |
Thanx @JensPiegsa, this one has just More I think I believe that the branch change is good overall. In my tests, both inline and content-id behaves the same, in Gmail web client and in few local clients. |
After reading some RFCs and discussions I can conclude the following:
So I guess, the |
Added to the mail FAQ. |
Use case:
The problem:
Content-Disposition
but only theContent-ID
in the image mail part headerSuggestions:
SendMailSession.createAttachmentBodyPart()
to test forattachment.isInline()
andattachment.getContentId() != null
independentlyEmailAttachmentBuilder.setContentId(String contentId)
which setscontentId
but does not touchinline
The text was updated successfully, but these errors were encountered: