FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Embedded Attachment CID is set as Name ('Causes Security Rejections When Content-ID set as unique-id@domain.com) · Issue #602 · bbottema/simple-java-mail · GitHub

Embedded Attachment CID is set as Name ('Causes Security Rejections When Content-ID set as unique-id@domain.com) #602

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL