https://github.com/terhechte/emlx
Parse Apple Mail.app `Emlx` Files.
https://github.com/terhechte/emlx
Last synced: 2 months ago
JSON representation
Parse Apple Mail.app `Emlx` Files.
- Host: GitHub
- URL: https://github.com/terhechte/emlx
- Owner: terhechte
- Created: 2021-10-06T09:15:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-27T22:06:01.000Z (over 1 year ago)
- Last Synced: 2025-04-12T11:18:50.230Z (2 months ago)
- Language: Rust
- Size: 25.4 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Emlx Parser
[](https://crates.io/crates/emlx)
[](https://docs.rs/emlx/)Parses Apple Mail.app `Emlx` Files.
Retrives the actual message, meta information as plist, and the flags of the message.
The actual message is returned as a `&[u8]` slice in the `eml` format.
This `message` part is almost in the `eml` format, except that
Apple uses `LF` for linebreaks instead of `CRLF`. Currently,
`emlx` has a feature switch (`use-email-parser`) which enables
a custom fork of the [`email-parser`](https://crates.io/crates/email-parser) crate and already parses
the email for you. It can then be found as the `email` property
on the [`Mail`] struct.This feature switch is **on** by default.
## Usage
``` rust
use emlx;
let contents: &[u8] = ...
let parsed = parse_emlx(contents).unwrap();// Flags are a struct with boolean and usize values
let is_read = parsed.flags.is_read;// Dictionary is a key value map to data in the emlx plist part.
let subject = parsed.dictionary["subject"].as_string().unwrap();// The actual eml message as bytes
let message = std::str::from_utf8(parsed.message).unwrap();
```Information on the `Emlx` file format was retrieved from these sites:
- [docs.fileformat.com/email/emlx/](https://docs.fileformat.com/email/emlx/)
- [jwz.org/blog/2005/07/emlx-flags/](https://www.jwz.org/blog/2005/07/emlx-flags/)## Test email data came from
- [qqilihq/partial-emlx-converter](https://github.com/qqilihq/partial-emlx-converter)
- [mikez/emlx](https://github.com/mikez/emlx/tree/b218ba7ada23239aff68726af744a1b2050f75dd)