Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For MacOS, extracting attachments into files is useful so that Spotlight can index them for search. I believe the same is true for Windows.

Mail.app, uses a directory structure that looks similar* to this for say, gmail:

    {account-uuid}/[Gmail].mbox/All Mail.mbox/{mailbox-guid}/Data/Messages/{msguid}.partial.emlx

    {account-uuid}/[Gmail].mbox/All Mail.mbox/{mailbox-guid}/Data/Attachments/{msguid}/{mime part #}/{mime subpart #}/filename.ext
The emlx format is a bit different from eml. It contains the number of bytes for the message at the top and an xml plist at the end that has message flags, last viewed time, gmail labels, etc. For partial.emlx files, the base64 content is removed from the email itself and a content length is added.

This format has its drawbacks, of course.

* Not shown is the hierarchy based on message uid used to keep the number of files in the Messages directory down.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: