msg_auth_status/dkim/header.rs
1//! DKIM header.* or header tags per RFC 6376
2
3use super::*;
4
5//use crate::error::DkimHeaderError;
6
7/// See RFC 6376 s. 3.5 for the full definitions
8#[derive(Clone, Debug, PartialEq)]
9pub enum DkimHeader<'hdr> {
10 /// Required - Version
11 V(DkimVersion<'hdr>),
12 /// Signature Algorithm - see s. 3.3 & IANA
13 A(DkimAlgorithm<'hdr>),
14 /// Signature data in base64 (note about FWS in s. 3.5 b=)
15 B(&'hdr str),
16 /// Hash of canonicalized body part of the message as limited by the 'l=' Body length limit tag - base64.
17 /// Note: Whitespaces / WHS are ignored
18 Bh(&'hdr str),
19 /// Required - Message canonicalization informs the verifier of the type of canonicalization used to prepare the message for signing. See s.3.4
20 C(DkimCanonicalization<'hdr>),
21 /// Required - The SDID claiming responsibility for an introduction of a message into the mail stream.
22 /// The SDID MUST correspond to a valid DNS name under which the DKIM key ecord is published.
23 D(&'hdr str),
24 /// Required - Signed header fields separated by colon ':' - see 'h='
25 H(&'hdr str),
26 /// Optional - The Agent or User Identifier (AUID) on behalf of which the SDID is taking responsibility.
27 I(&'hdr str),
28 /// Optional - Body length limit - see misuse on RFC 6376 s. 8.2.
29 L(&'hdr str),
30 /// Optional - Query method - currently only Dns.
31 Q(&'hdr str),
32 /// Required - The selector subdividing the namespace for the "d=" (domain) tag.
33 /// Internationalized selector names MUST be encoded as A-labels, as described in Section 2.3 of RFC 5890.
34 S(&'hdr str),
35 /// Recommended - Signature Timestamp
36 T(DkimTimestamp<'hdr>),
37 /// Recommended - Signature Expiration
38 X(DkimTimestamp<'hdr>),
39 /// Optional - Copied header fields
40 Z(&'hdr str),
41 /// RFC 6541
42 Atps(&'hdr str),
43 /// RFC 6541
44 Atpsh(&'hdr str),
45 /// RFC 6651
46 R(&'hdr str),
47 /// RFC 5322
48 Rfc5322From(&'hdr str),
49 /// Unknown
50 Unknown(&'hdr str, &'hdr str),
51}