-
-
Notifications
You must be signed in to change notification settings - Fork 274
Issue with attachments sent to certain email providers (targets) #231
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
Comments
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? |
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. |
Any news? |
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. |
Thanks for maintaining this convenient library.
|
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.
MimeMessageHelper.java:240:
attachmentPart.setHeader("Content-Type", contentType + "; filename=\"" + fileName + "\"; name=\"" + fileName + "\"");
Would be great if someone can crosscheck this and we add it to the main code. For us it works now with all kinds of attachments to various providers.
Best regards
Stan
The text was updated successfully, but these errors were encountered: