#eml #apple

emlx

将 Apple Mail.app emlx 文件解析为 eml 和相关元数据

1 个不稳定版本

0.1.0 2021 年 10 月 6 日

#238电子邮件

MIT 许可证

22KB
245

Emlx 解析器

crates.io docs.rs

解析 Apple Mail.app 的 Emlx 文件。

检索实际消息、元信息(plist)和消息标志。

实际消息以 &[u8] 切片的形式返回,并以 eml 格式返回,然后可以与其他 Rust eml 解析器一起解析,例如 eml-parser

用法

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();

有关 Emlx 文件格式的信息是从以下网站获取的:

测试电子邮件数据来自:

依赖项

~4.5MB
~84K SLoC