1 个不稳定版本
0.1.0 | 2021 年 10 月 6 日 |
---|
#238 在 电子邮件
22KB
245 行
Emlx 解析器
解析 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