rustexamples/report_arf_parse.rs -rw-r--r-- 707 B
1/*
2 * Copyright (c) 2020-2023, Stalwart Labs Ltd.
3 *
4 * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 * https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 * <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
7 * option. This file may not be copied, modified, or distributed
8 * except according to those terms.
9 */
10
11use mail_auth::report::Feedback;
12
13const TEST_MESSAGE: &str = include_str!("../resources/arf/001.eml");
14
15fn main() {
16 // Parse Abuse Report Format feedback repot
17 let report = Feedback::parse_rfc5322(TEST_MESSAGE.as_bytes()).unwrap();
18
19 // Write ARF to stdout at JSPON
20 println!("{}", serde_json::to_string_pretty(&report).unwrap());
21}