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

x-ole-storage instead of vnd.ms-outlook for *.msg files #5

Open
glazzari opened this issue May 6, 2019 · 1 comment
Open

x-ole-storage instead of vnd.ms-outlook for *.msg files #5

glazzari opened this issue May 6, 2019 · 1 comment

Comments

@glazzari
Copy link

glazzari commented May 6, 2019

Is there a way to detect *.msg (outlook) files? I'm getting x-ole-storage instead of vnd.ms-outlook, as returned by Tika, for example. This is my code:

mimeTypeDetector.detectMimeType("filename", new ByteArrayInputStream(fileContent));

My msg file starts with D0 CF 11 E0 A1 B1 1A E1.

@adamhooper
Copy link
Member

Oof! Kinda.

The vnd.ms-outlook format is non-standard -- so non-standard that we at Overview use it for something else (PST files). We implemented ours in extra-mime-info.xml.

To mimic Tika (which detects PST as vnd.ms-outlook-pst), we'd need to change overview-server and mime-types, in lockstep. It's painful.

I think I prefer a different route: let users supply their own mime.cache with whatever types they want. This repo could track shared-mime-info exactly, so there wouldn't be such rigmarole next time. We'd need a small API change (a new ctor for MimeTypeDetector) and a big HOWTO guide.

@glazzari Are you willing to take on the task of tweaking the API and adding a HOWTO? We'd need a new public MimeTypeDetector(InputStream mimeCache) constructor; the default constructor would become MimeTypeDetector(getClass().getResourceAsStream(MimeCache)) and we'd need a unit test with a non-standard mime.cache and a non-standard file (maybe .msg). The HOWTO should guide users on editing extra-mime-info.xml and re-running ./rebuild-mime-cache.sh. The existing <mime-type> in extra-mime-info.xml should be commented out -- it could serve as an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants