-
-
Notifications
You must be signed in to change notification settings - Fork 278
Description
When I convert a byte source to MimeMessage:
byte[] emailContent = //some proper email content.
InputStream emailInputStream = new ByteArrayInputStream(emailContent);
MimeMessage mimeMessage = EmailConverter.emlToMimeMessage(emailInputStream);
My embedded image part looks like this (as it should be):
------=_Part_0_1439752497.1755587044144
Content-Type: image/png; name=ss.png
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=ss.png
Content-ID: emf08a6e26-b330-4662-b8b1-5122ade7f2f2@2856f0a1.com
Then for my needs I convert it to EmailPopulating > Email > String eml like this:
EmailPopulatingBuilder emailPopulatingBuilder = EmailConverter.mimeMessageToEmailBuilder(mimeMessage);
String eml = EmailConverter.emailToEML(emailPopulatingBuilder.buildEmail());
In the EML embedded image content looks like this:
------=_Part_5_1773492599.1755587598920
Content-Type: image/png; filename="emf08a6e26-b330-4662-b8b1-5122ade7f2f2@2856f0a1.com";
name="emf08a6e26-b330-4662-b8b1-5122ade7f2f2@2856f0a1.com"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="emf08a6e26-b330-4662-b8b1-5122ade7f2f2@2856f0a1.com"
Content-ID: emf08a6e26-b330-4662-b8b1-5122ade7f2f2@2856f0a1.com
As you see filename and name parts became the CID itself. So when I try to send this mail it's rejecting by providers because image names cannot end with .com
I think, embedded file name should be stayed always like at first, conversion make it lost.