mail-auth 0.12.1

DKIM, ARC, SPF and DMARC library for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC <hello@stalw.art>
 *
 * SPDX-License-Identifier: Apache-2.0 OR MIT
 */

use mail_auth::report::Report;

const TEST_MESSAGE: &str = include_str!("../resources/dmarc-feedback/100.eml");
const MAX_REPORT_SIZE: usize = 25 * 1024 * 1024;

fn main() {
    // Parse DMARC aggregate report
    let report = Report::parse_rfc5322(TEST_MESSAGE.as_bytes(), MAX_REPORT_SIZE).unwrap();

    // Write report to stdout at JSPON
    println!("{}", serde_json::to_string_pretty(&report).unwrap());
}