1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! # msg_parser
//!
//! A parser for Microsoft Outlook `.msg` files (OLE Compound Document format).
//!
//! Extracts message metadata, body content, recipients, attachments, and
//! transport headers from `.msg` files as specified in
//! [MS-OXMSG](https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxmsg)
//! and [MS-OXPROPS](https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxprops).
//!
//! # Quick Start
//!
//! ```no_run
//! use msg_parser::Outlook;
//!
//! let outlook = Outlook::from_path("email.msg").unwrap();
//!
//! // Use Display impl for a human-readable summary
//! println!("{}", outlook);
//!
//! // Or access fields directly
//! println!("From: {}", outlook.sender);
//! println!("Subject: {}", outlook.subject);
//! println!("Date: {}", outlook.message_delivery_time);
//!
//! for attach in &outlook.attachments {
//! println!("Attachment: {}", attach);
//! }
//! ```
//!
//! # Parsing from different sources
//!
//! ```no_run
//! use msg_parser::Outlook;
//!
//! // From a file path
//! let outlook = Outlook::from_path("email.msg").unwrap();
//!
//! // From a byte slice (accepts &[u8], Vec<u8>, or anything AsRef<[u8]>)
//! let bytes = std::fs::read("email.msg").unwrap();
//! let outlook = Outlook::from_slice(&bytes).unwrap();
//!
//! // From any reader (file, stdin, network stream, etc.)
//! let file = std::fs::File::open("email.msg").unwrap();
//! let outlook = Outlook::from_reader(file).unwrap();
//! ```
//!
//! # Embedded messages
//!
//! ```no_run
//! # let outlook = msg_parser::Outlook::from_path("email.msg").unwrap();
//! for attach in &outlook.attachments {
//! if let Some(Ok(nested)) = attach.as_message() {
//! println!("Embedded: {} from {}", nested.subject, nested.sender);
//! }
//! }
//! ```
//!
//! # HTML from RTF fallback
//!
//! ```no_run
//! # let outlook = msg_parser::Outlook::from_path("email.msg").unwrap();
//! let html = if !outlook.html.is_empty() {
//! outlook.html.clone()
//! } else {
//! outlook.html_from_rtf().unwrap_or_default()
//! };
//! ```
// OLE Reader
// Outlook Email Message File Parser
pub use *;