2 releases
0.1.1 | Sep 10, 2022 |
---|---|
0.1.0 | Mar 14, 2021 |
#315 in Email
29 downloads per month
4MB
2.5K
SLoC
Contains (Cab file, 2MB) data/unicode.msg, (Cab file, 1MB) data/test_email.msg, (Cab file, 730KB) data/test_email_1.msg, (Cab file, 1MB) data/test_email_2.msg, (Cab file, 195KB) data/attachment.msg, (Cab file, 220KB) data/test_email_3.msg and 1 more.
Outlook Email Messsage (.msg) parser.
A simple parser and reader to deserialize a given Outlook Email Message (.msg) File.
Usage
Add this to your Cargo.toml
file:
[dependencies]
msg_parser = "0.1.1"
Example
use msg_parser::Outlook;
fn main() {
// Create Outlook object
let outlook = Outlook::from_path("data/test_email.msg").unwrap();
// Flush as json string
let json_string = outlook.to_json();
println!("{:#?}", outlook);
println!();
println!("json_string ---");
println!("{:?}", json_string);
}
Requirements
- Rust 1.42+
Running the given example
$ cargo run --example parse-email
Compiling msg_parser v0.1.0 (msg-parser)
Finished dev [optimized + debuginfo] target(s) in 3.66s
Running `target/debug/examples/parse-email`
Outlook {
headers: TransportHeaders {
content_type: "",
date: "",
message_id: "",
reply_to: "",
},
sender: Person {
name: "",
email: "",
},
...<clip>
}
Running tests
cargo t --verbose
Building release
cargo b --release
Contributions
Feel free to make pull requests to contribute/enhance/add more features/bug fixes.
License: MIT
Dependencies
~2.8–4.5MB
~88K SLoC