pub enum Dkim2Error {
Show 44 variants
InstanceMissing(u32),
InstanceSyntax(u32),
InstanceTagMissing {
m: u32,
tag: &'static str,
},
InstanceNotSigned(u32),
InstanceDuplicateHash(u32),
InvalidJson(u32),
InvalidRecipe {
m: u32,
value: Box<str>,
},
UnknownHash {
m: u32,
name: Box<str>,
},
NoHashGroupPassed(u32),
SignatureMissing(u32),
SignatureSyntax(u32),
SignatureTagMissing {
i: u32,
tag: &'static str,
},
SignatureTagUnexpected {
i: u32,
tag: &'static str,
},
DuplicateSelector(u32),
TooManySelectors(u32),
SequenceGap(u32),
SequenceOverflow,
ChainTooLong,
SignatureExpired(u32),
SignatureFromFuture(u32),
MailFromMismatch {
i: u32,
value: Box<str>,
},
RcptToMismatch {
i: u32,
value: Box<str>,
},
MailFromDomainMismatch(u32),
NextDomainMismatch(u32),
CustodyMailFromMismatch {
i: u32,
previous: u32,
},
CustodyDomainMismatch {
i: u32,
previous: u32,
},
PublicKeyFetch {
i: u32,
selector: Box<str>,
},
PublicKeyMissing {
i: u32,
selector: Box<str>,
},
PublicKeyMultiple {
i: u32,
selector: Box<str>,
},
PublicKeySyntax {
i: u32,
selector: Box<str>,
},
PublicKeyMalformed {
i: u32,
selector: Box<str>,
},
PublicKeyAlgorithmMismatch {
i: u32,
selector: Box<str>,
},
PublicKeyRevoked {
i: u32,
selector: Box<str>,
},
IncorrectSignature {
i: u32,
selector: Box<str>,
},
UnknownAlgorithm {
i: u32,
selector: Box<str>,
},
NoSignatureGroupPassed(u32),
HeaderHashMismatch {
m: u32,
hash: Dkim2Hash,
},
BodyHashMismatch {
m: u32,
hash: Dkim2Hash,
},
NullBodyRecipe(u32),
FromNotAuthentic(u32),
HeaderNotRepresentable,
BodyUnreconstructable,
RecipeSyntax,
NotFullyVerified,
}Expand description
Reason a DKIM2 header field failed to parse, a DKIM2 chain failed verification or a message could not be signed.
Carried as Error::Dkim2 inside a
Dkim2Result or returned by the parsing and signing
functions. The i payloads are the i= of the signature involved and the
m payloads the m= of the instance involved. The
Display text is the human-readable string of §14 without the
PERMERROR:/FAIL: prefix, which Dkim2Result
conveys.
Variants§
InstanceMissing(u32)
No Message-Instance with this m=, or the instance numbering has a
gap.
InstanceSyntax(u32)
The Message-Instance has a syntax error or a repeated tag.
InstanceTagMissing
A required Message-Instance tag is missing.
InstanceNotSigned(u32)
The Message-Instance has a higher m= than any signature.
InstanceDuplicateHash(u32)
The Message-Instance lists the same hash algorithm twice.
InvalidJson(u32)
The recipe (r= tag) of the Message-Instance is not valid JSON.
InvalidRecipe
The recipe (r= tag) of the Message-Instance is valid JSON but does
not follow the recipe rules (§5).
Fields
UnknownHash
An h= hash name is not an algorithm this crate implements.
NoHashGroupPassed(u32)
No |-separated group of h= hashes passed.
SignatureMissing(u32)
No DKIM2-Signature with this i=, for example a message with a
Message-Instance but no signature.
SignatureSyntax(u32)
The DKIM2-Signature has a syntax error, a repeated tag, an
undecodable value, an invalid nonce, an address without angle
brackets, or an m= lower than that of the previous signature.
SignatureTagMissing
A required DKIM2-Signature tag is missing.
SignatureTagUnexpected
A DKIM2-Signature tag is not allowed in this position, such as
nd= together with mf=/rt=, nd= on the most recent signature,
or the exploded flag (f=) on the first signature.
DuplicateSelector(u32)
The s= tag names the same selector twice.
TooManySelectors(u32)
The s= tag has more than eight entries, a local limit on the public
key lookups a signature can cause.
SequenceGap(u32)
The signature sequence numbering does not run from 1 without gaps;
carries the first missing i=.
SequenceOverflow
A new signature or instance number would exceed u32::MAX.
ChainTooLong
The message has more than 50 DKIM2-Signature or Message-Instance
header fields.
SignatureExpired(u32)
The signature timestamp (t=) is more than 14 days old.
SignatureFromFuture(u32)
The signature timestamp (t=) is more than one day in the future.
MailFromMismatch
The SMTP MAIL FROM does not match mf= of the most recent
signature.
RcptToMismatch
An SMTP RCPT TO address is not listed in rt= of the most recent
signature.
MailFromDomainMismatch(u32)
The mf= domain is neither d= nor a subdomain of it (§10.8).
NextDomainMismatch(u32)
d= differs from the nd= of the previous signature.
CustodyMailFromMismatch
The mf= domain does not relaxed-match any rt= recipient of the
previous signature (§7.1).
Fields
CustodyDomainMismatch
No rt= recipient of the previous signature relaxed-matches d=,
for a signature with a null mf= or with nd= (§7.1).
Fields
PublicKeyFetch
The public key lookup failed with a temporary DNS error.
PublicKeyMissing
The public key record does not exist.
PublicKeyMultiple
The selector has more than one TXT record.
PublicKeySyntax
The public key record has a syntax error.
PublicKeyMalformed
The public key is malformed: an Ed25519 key that is not 32 octets, an ML-DSA-44 key that is not 1312 octets, an RSA key that cannot be decoded or is shorter than 1024 bits (§14.5).
PublicKeyAlgorithmMismatch
The public key type (k=) does not match the s= algorithm.
PublicKeyRevoked
The public key record has an empty p= tag (revoked key).
IncorrectSignature
An s= signature value does not verify.
Fields
UnknownAlgorithm
An s= entry names an algorithm this crate does not implement.
NoSignatureGroupPassed(u32)
No |-separated group of s= signatures passed.
HeaderHashMismatch
The header fields hash does not match the Message-Instance.
Fields
BodyHashMismatch
The body hash does not match the Message-Instance.
Fields
NullBodyRecipe(u32)
A Message-Instance with this m= has a null body recipe, so the
body hashes of the instances below it cannot be checked and the
message is not a Fully Verified DKIM2 Message (§13).
FromNotAuthentic(u32)
A From header field is not Authentic (§11): its domain does not
relaxed-match d= of the signature that covers it, or it has no
single address with a domain name.
HeaderNotRepresentable
Recipe::diff found a changed header field
value with a bare CR or LF outside folding, which a recipe cannot
recreate.
BodyUnreconstructable
Recipe::apply found a body recipe that
declares the previous body unreconstructable ("b": null).
RecipeSyntax
A recipe could not be serialized to or parsed from JSON, or does not follow the recipe schema (§5).
NotFullyVerified
The message to sign already has DKIM2 header fields but no passing full verification of it was supplied, and the signer has no out-of-band arrangement (§12).
Trait Implementations§
Source§impl Clone for Dkim2Error
impl Clone for Dkim2Error
Source§impl Debug for Dkim2Error
impl Debug for Dkim2Error
Source§impl Display for Dkim2Error
impl Display for Dkim2Error
impl Eq for Dkim2Error
Source§impl PartialEq for Dkim2Error
impl PartialEq for Dkim2Error
impl StructuralPartialEq for Dkim2Error
Auto Trait Implementations§
impl Freeze for Dkim2Error
impl RefUnwindSafe for Dkim2Error
impl Send for Dkim2Error
impl Sync for Dkim2Error
impl Unpin for Dkim2Error
impl UnsafeUnpin for Dkim2Error
impl UnwindSafe for Dkim2Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more