Open sebastian-schmitt opened 3 weeks ago
alternatively I was looking for some hook to modify the intermediate MimeMessage at some point between being built and being sent. (maybe the CustomMailer?)
after digging deeper into our problem, I found that only one of those parameters (namely the "filename") causes the problems at the remote side: They expect the "name" parameter within the Content-Type header and the "filename" parameter within the Content-Disposition header. So basically, it's the line 265 only (see above) which I try to disable. (for now we forked the repository to do this manipulation by hand, but it would be great to have some kind of tool to access and modify the resulting MimeMessage in more detail)
I'm trying to remember why I left it in the Content-Type to begin with. Legacy? Backwards compatibility? I'm trying to figure out what I might break by simply removing it.
When adding an attachment, the Content-Type header of the corresponding mime-part gets the 'filename' and 'name' of the attachment appended as additional parameters (see link below).
Our remote party is pretty picky about this header and wants us to remove these extra parameters from this header. I could not find a good way to do that - this is why I wish I could opt-out from this behavior:
https://github.com/bbottema/simple-java-mail/blob/cb2f7b2b0dac9c7a7bda1d209c40a21550bf4738/modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageHelper.java#L264-L267