Jump to content

Searching Outlook EML Exports

Recommended Posts



I'm trying to solve a problem, and Alfred seems to be the closest to a solution I've found.  This is a variation on searching mail.app messages.


I've exported my sizable e-mail archive to .eml files - they're text files, in a format remarkably similar to raw SMTP messages (including attachments being embedded, not in a separate folder).  This is the format Outlook (2011?) uses when you drag & drop messages into a folder.  I need to be able to search them - really, by attribute, not just string matches (date ranges, from vs. to, subject, perhaps even compound matches).


I've been to this thread: 

However, that code targets Apple Mail mail.app folders and .eml file formats (which are apparently a little different, at least since the attachments aren't embedded).  Since I'm not running Apple Mail, I don't have a working point of reference to gauge the inner workings / success.


I've added the folder where my message files are stored to the scope for the 'emfrom' workflow, and I've dropped one of the files into the emfrom object so it'll pickup the file type (which it sees as com.apple.mail.email).  No joy.



Now, "I don't know what I don't know", so basic suggestions welcomed...  I'd wager a guess that somewhere there needs to be a definition of how to interpret file types (like, extracting the sender's name).





Edited by RichardH
Link to comment

It sounds like you've configured everything correctly, but your email files haven't been indexed by the system.


I don't know enough about the Apple vs MS .eml format to give a definitive answer, but it's possible that they're sufficiently different to be unparseable or they're marked as system files (i.e. shouldn't be indexed).


You can try re-indexing the .eml files from Terminal. If you change to the directory where your .eml files are, and run mdimport -d1 . to (re-)index them.


The command will spit out info on what is has indexed and with which plugin.

Link to comment

Thanks for the suggestion.

2017-03-08 07:36:57.654 mdimport[19002:41924645] Imported 'Foo.eml' of type 'com.apple.mail.email' with no plugIn.

From prior digging, it seems like lack of a plug-in / metadata parser is also the reason Spotlight doesn't search these files.  I never found a fix for that.  My workaround hack has been to suffix .txt to the filenames so they get indexed as text files, but that's a poor-quality search.


Worst-case, how hard would it be to adapt the plug-in for Apple Mail to apply here?


Link to comment

I've done a bit of googling, and .eml files aren't supported, only .emlx (which is the .eml file plus extra data).


MailMate has a Spotlight plugin that supports .eml files. Otherwise, I think you'll have to convert them to .emlx to index them.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...