-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add eml parser to generate Msg from .eml files #145
Comments
Added support for quoted-printable encoding in email parser to increase its functionality. The change includes a case handling feature for 'EncodingQP' and related conversions to allow for proper message body reading and encoding setting. This improves the robustness and the scope of email content types that the parser can handle."
Hi @wneessen, thanks for all your hard work on this library! I have a scenario where the network may be unavailable at the time of sending, so
Today I learned this issue is open :) |
Hi @jameshueston, unfortunately I haven't had much time to work on this lately. The branch https://github.com/wneessen/go-mail/tree/feature/145_add-eml-parser-to-generate-msg-from-eml-files has what I would call a poorly tested, yet working PoC for simple mails. The big issue currently are mutlipart mails, which are not that easy to "decode". If the mails you are sending are simple mails with maybe just a single attachment, the code might be working for you already, if they are multi-part, it will most likely do nothing yet. I'll check if I can dedicate some time for this in the next few weeks, to get this finished. Sorry I don't have a more satisfying response right now. |
Hi @wneessen, thanks for your fast reply! If your code doesn't work, I thought about trying k3a/parsemail to read message parts into your No pressure over the weekend. If all else fails, I could save raw data to disk and rebuild mail for retries, which in my case happens often with mobile devices on intermittent cellular service. Thank you again, kindly. |
That sounds good. Crossing fingers that the branch works. Otherwise I'm positive that |
It took a lot of time (due to other priorities and time constraints on my end), but https://github.com/wneessen/go-mail/tree/feature/145_add-eml-parser-to-generate-msg-from-eml-files is now at a state that is usable. It's not complete, but most functionality is given (from what I can see and from what I was able to test). Currently missing:
Please feel free to give the branch a try and provide some feedback. |
Update:
Again, the branch should be ready to test and feedback is appreciated. |
…enerate-msg-from-eml-files This PR introduces an EML parser to go-mail. It allows to read generic EML data from a file, a string or a reader into a go-mail Msg struct. It supports all types of message parts and encodings. It should be able to recognize Mulitpart messages as well as attachments and embeds (inline attachments). This PR closes #145
Is your feature request related to a problem? Please describe.
As requested on discord, it would be nice to generate a new
Msg
from a given.eml
file.Describe the solution you'd like
Ideally the parser would read all headers supported by go-mail and add them to the
Msg
automatically and then fill the body with the mail contents of the .eml. Parsing attachments could be tricky though.Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: