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

.MSG Conversion to JSON #15

Open
curldapps opened this issue Jan 29, 2020 · 7 comments
Open

.MSG Conversion to JSON #15

curldapps opened this issue Jan 29, 2020 · 7 comments

Comments

@curldapps
Copy link

Hi there -

Thanks for this awesome library! By chance, is there functionality here to convert a .msg file's contents to JSON?

@lolo101
Copy link
Owner

lolo101 commented Feb 4, 2020

Hi @curldapps and thanks for your support :)

No there is currently no such feature.
What is your need exactly ? The content of a .msg file may take many shapes. How exactly would you expect the JSON to be structured ?

@curldapps
Copy link
Author

Thanks for the reply!

I built a utility that processes the contents of emails and one component of that is named entity recognition on the body and headers. To feed that named entity recognition model with data it can digest, I use a utility that converts the standard EML mime type emails to JSON and then perform my own processing from there as JSON is much easier to work with.

If I could find a library that could take a .msg email file and create a JSON object something like the following, it would be a lifesaver:

{ 
    headers : {header1: "<value>", header2: "<value>" ...},
    bodyText: "<body text of email here",
    date: "<date-time from email server>",
    subject: "<subject line text>"
    to: "<who the email was addressed to>",
    to: "<address the email was sent from>"
}

@lolo101
Copy link
Owner

lolo101 commented Feb 7, 2020

With MsgViewer you can convert .MSG to .EML and then use the utility to obtain the desired JSON.

This functionality looks too specific for me to be a high priority.

However I will look into it when I have time :)

@curldapps
Copy link
Author

curldapps commented Feb 10, 2020

Thanks for the response. That was my plan :) sounds great.

In that vein, I wanted to ask you if you know whether or not I can run MSGViewer as a subprocess in NodeJS --OR-- since I am not a Java guy, what it would take to wrap this in a RESTful API so I can pass .msg and get back .eml files? I know this is not really in scope for you but still thankful for any advice you'd have.

@lolo101
Copy link
Owner

lolo101 commented Feb 11, 2020

I dont know much about NodeJS, I'm not in position to give you an answer about that point.
MsgViewer as a service looks like a very sexy idea :) I think it's not much work. Just expose a web service using your favorite framework and either embark MsgViewer as a dependency or invoke it through CLI
It may be useful to isolate the GUI part and the service part into different modules. I'll think about it ;)

@curldapps
Copy link
Author

I am working on exposing the msg2Eml functionality as a REST API :) will keep you posted

@lolo101 lolo101 mentioned this issue Mar 8, 2020
@lolo101
Copy link
Owner

lolo101 commented May 7, 2022

Hi @curldapps!

It's been a long time and now I plan on exposing a web API to convert formats.
I'm not planning to do a REST API because there is no state to represent.
It would be a simple HTTP API where .msg are handled as bytes stream and .eml & .mbox as characters stream.

Could you progress on this subject so I don't have to reinvent the wheel?

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

2 participants