eml-codec 0.1.2

Email enCOder DECoder in Rust. Support Internet Message Format and MIME (RFC 822, 5322, 2045, 2046, 2047, 2048, 2049).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//use imf_codec::fragments::section::Section;
//use imf_codec::multipass::segment;
use std::io;
use std::io::Read;

fn main() {
    // Read full mail in memory
    let mut rawmail = Vec::new();
    io::stdin().lock().read_to_end(&mut rawmail).unwrap();

    let (_, eml) = eml_codec::parse_message(&rawmail).unwrap();
    println!("{:#?}", eml);
    assert!(eml.imf.date.is_some());
    assert!(!eml.imf.from.is_empty());
}