-
Bug
-
Resolution: Duplicate
-
Neutral
-
None
-
4.4.2
-
None
-
None
-
Windows + JDK 1.6 + Tomcat 5.5
-
-
Empty show more show less
Using constructor info.magnolia.module.mail.templates.MailAttachment(File, String, String, String) results to an UnknownHostException while java mail is trying to get the file on Windows.
The error comes from method MailAttachment.setPath(String) which constructs a URL with file:// + absolutePath. On *nix platforms it gives us a url like file:///tmp/myfile, but on Windows the url is file://C:/temp/myfile which is wrong (root slash is missing).
I'd fix this issue by changing URL construction to :
[143] this.url = new URL(FILE_URL_PREFIX + "/" + StringUtils.removeStart(aPath, "/"));
I tested this fix on both Debian and Windows platforms.
- is duplicated by
-
MAGNOLIA-5168 MailAttachment uri may be set incorrectly
- Closed
-
MGNLMAIL-16 MailAttachment uri may be set incorrectly
- Closed