eml-codec/src/parse.rs

36 lines
921 B
Rust
Raw Normal View History

2023-06-16 07:58:07 +00:00
use imf_codec::header;
2023-06-08 12:58:20 +00:00
fn main() {
2023-06-16 07:58:07 +00:00
let hdr = r#"Return-Path: <gitlab@framasoft.org>
Delivered-To: quentin@dufour.io
Received: from smtp.deuxfleurs.fr ([10.83.2.2])
by doradille with LMTP
id IKPyOvS8iGTxBAEAvTd7DQ
(envelope-from <gitlab@framasoft.org>)
for <quentin@dufour.io>; Tue, 13 Jun 2023 19:01:08 +0000
Date: Fri, 21 Nov 1997 10:01:10 -0600
2023-06-13 11:52:34 +00:00
From: Mary Smith
<mary@example.net>
2023-06-13 11:42:50 +00:00
Sender: imf@example.com
2023-06-13 11:52:34 +00:00
Reply-To: "Mary Smith: Personal Account" <smith@home.example>
To: John Doe <jdoe@machine.example>
2023-06-13 12:44:41 +00:00
Cc: imf2@example.com
Bcc: (hidden)
2023-06-13 11:52:34 +00:00
Subject: Re: Saying Hello
2023-06-13 14:22:04 +00:00
Comments: A simple message
Comments: Not that complicated
Keywords: hello, world
2023-06-16 08:50:37 +00:00
Héron: Raté
Raté raté
raté raté
2023-06-13 14:22:04 +00:00
Keywords: salut, le, monde
2023-06-13 11:52:34 +00:00
Message-ID: <3456@example.net>
In-Reply-To: <1234@local.machine.example>
References: <1234@local.machine.example>
2023-06-13 11:42:50 +00:00
2023-06-13 11:52:34 +00:00
This is a reply to your hello.
2023-06-13 11:42:50 +00:00
"#;
2023-06-16 07:58:07 +00:00
println!("{:?}", header::section(hdr));
2023-06-08 12:58:20 +00:00
}