Skip to content
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

Support multipart/mixed and multipart/alternative + nested parts #11

Open
vanderstaaij opened this issue Nov 15, 2017 · 4 comments
Open

Comments

@vanderstaaij
Copy link

Hi there,

In some of the emails we receive, the messages are a combination of multipart/mixed and multipart/alternative parts. E.g.:

From: xxxx <xxxx@xxxx.nl>
Date: Wed, 15 Nov 2017 07:49:37 +0100
Subject: xxxx
To: xxxx@xxxx.nl
Content-Type: multipart/mixed; boundary="001a1147380449a331055dffe87c"

--001a1147380449a331055dffe87c
Content-Type: multipart/alternative; boundary="001a1147380449a32d055dffe87a"

--001a1147380449a32d055dffe87a
Content-Type: text/plain; charset="UTF-8"

Message plain text

--001a1147380449a32d055dffe87a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<p>Message HTML</p>

--001a1147380449a32d055dffe87a--
--001a1147380449a331055dffe87c
Content-Type: application/pdf; name="xxxx.pdf"
Content-Disposition: attachment; filename="xxxx.pdf"
Content-Transfer-Encoding: base64
X-Attachment-Id: ab0f0569c61ec80c_0.1


--001a1147380449a331055dffe87c--

When extracting e.g. mail.getText() or mail.getHTML() for these messages I get null as result.

Can this please be supported?

Kind regards,
Eric

@saig0
Copy link
Collaborator

saig0 commented Nov 16, 2017

Hi Eric,

thank you for reaching this out. Do you want to implement this feature and create a pull request?

Best regards,
Philipp

@vanderstaaij
Copy link
Author

Well, I am not a Java developer :) There is a big chance I might screw up implementing a new feature. I'm just using your extension in Camunda and I noticed this happening with nested multipart messages.

I've been digging a bit though. Found this StackOverflow question: https://stackoverflow.com/questions/13331989/how-to-handle-multipart-alternative-mail-with-javamail

I understand that iterating/recursing over all (nested) parts of a multipart mail is quite complicated as there are so many possibilities. So I think it is better to leave it to the pros.

@saig0 saig0 added this to the 1.3.0 milestone Nov 16, 2017
@saig0
Copy link
Collaborator

saig0 commented Nov 16, 2017

Ok, Eric 😄

But it can take a while until I've time to implement this feature. However, I take it on the agenda.

Maybe someone else wants to work on this?

@vanderstaaij
Copy link
Author

Would be great. Thanks!

@jonathanlukas jonathanlukas removed this from the 1.3.0 milestone Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants