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
Issue with attachments sent to certain email providers (targets) #231
We discovered, that for certain email providers not all attachments are working, when they contain special characters or blanks e.g. "Köln Ausflugsziel.pdf". Gmail can handle this, but incamail.ch for example not.
We solved this by patching the MimeMessageHelper.java with following line (escaping the fileName and taking the filename variable also for the name attribute, because if non US-ASCII chars are used in attachment name, the attachment extension is changed to .dat. This happens maybe because Simple Java Mail always uses application/octet-stream as Content-Type of attachments instead of application/pdf or image/png, etc.
Interesting since that was recently changed to handle white spaces, which I think takes care of escaping the name as well. Which version are you on, because this was implemented in 5.4.0 (see #226).
I'm not sure using the filename for name is a good idea though. There is some logic to determine what the sender had meant to use, but for 6.0.0 in the develop branch a bug was fixed regarding determining the extension (#151).
I created a new branch off master for you with just that change from develop. Maybe you can try that patch in your branch and see if it fixes your problem.
Thanks for maintaining this convenient library.
I can confirm that upgrading to the latest version 6.0.3 fixed the issue. This works with all our email providers:
mailBuilder.withAttachment("Köln Ausflugsziel.pdf", new FileDataSource(myFile));
Activity
#231: Picked only the changes regarding attachment extensions from de…
bbottema commentedon Oct 20, 2019
Interesting since that was recently changed to handle white spaces, which I think takes care of escaping the name as well. Which version are you on, because this was implemented in 5.4.0 (see #226).
I'm not sure using the filename for name is a good idea though. There is some logic to determine what the sender had meant to use, but for 6.0.0 in the develop branch a bug was fixed regarding determining the extension (#151).
I created a new branch off master for you with just that change from develop. Maybe you can try that patch in your branch and see if it fixes your problem.
This is odd behavior, can you show me where this happens?
staniko commentedon Oct 25, 2019
Thanks a lot, we check it within the next 3 weeks and respond then. Maybe the .dat issue is also resolved with the latest version.
bbottema commentedon Nov 27, 2019
Any news?
bbottema commentedon Dec 3, 2019
Closing this issue as invalid, as I can't proceed without more information. I'll keep the branch around for you for some more time.
I'll be happy to reopen once you can tell me more.
pbernet commentedon Mar 26, 2020
Thanks for maintaining this convenient library.
I can confirm that upgrading to the latest version 6.0.3 fixed the issue. This works with all our email providers: