Skip to main content

Dkim2Error

Enum Dkim2Error 

Source
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.

Fields

§m: u32

Revision number (m=) of the instance.

§tag: &'static str

Name of the missing tag.

§

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

§m: u32

Revision number (m=) of the instance.

§value: Box<str>

The start of the recipe JSON, at most 64 bytes.

§

UnknownHash

An h= hash name is not an algorithm this crate implements.

Fields

§m: u32

Revision number (m=) of the instance.

§name: Box<str>

The unknown hash name.

§

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.

Fields

§i: u32

Sequence number (i=) of the signature.

§tag: &'static str

Name of the missing tag.

§

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.

Fields

§i: u32

Sequence number (i=) of the signature.

§tag: &'static str

Name of the unexpected tag.

§

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.

Fields

§i: u32

Sequence number (i=) of the signature.

§value: Box<str>

The SMTP MAIL FROM value.

§

RcptToMismatch

An SMTP RCPT TO address is not listed in rt= of the most recent signature.

Fields

§i: u32

Sequence number (i=) of the signature.

§value: Box<str>

The SMTP RCPT TO value.

§

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

§i: u32

Sequence number (i=) of the signature.

§previous: u32

Sequence number (i=) of the previous signature.

§

CustodyDomainMismatch

No rt= recipient of the previous signature relaxed-matches d=, for a signature with a null mf= or with nd= (§7.1).

Fields

§i: u32

Sequence number (i=) of the signature.

§previous: u32

Sequence number (i=) of the previous signature.

§

PublicKeyFetch

The public key lookup failed with a temporary DNS error.

Fields

§i: u32

Sequence number (i=) of the signature.

§selector: Box<str>

Selector of the key.

§

PublicKeyMissing

The public key record does not exist.

Fields

§i: u32

Sequence number (i=) of the signature.

§selector: Box<str>

Selector of the key.

§

PublicKeyMultiple

The selector has more than one TXT record.

Fields

§i: u32

Sequence number (i=) of the signature.

§selector: Box<str>

Selector of the key.

§

PublicKeySyntax

The public key record has a syntax error.

Fields

§i: u32

Sequence number (i=) of the signature.

§selector: Box<str>

Selector of the key.

§

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).

Fields

§i: u32

Sequence number (i=) of the signature.

§selector: Box<str>

Selector of the key.

§

PublicKeyAlgorithmMismatch

The public key type (k=) does not match the s= algorithm.

Fields

§i: u32

Sequence number (i=) of the signature.

§selector: Box<str>

Selector of the key.

§

PublicKeyRevoked

The public key record has an empty p= tag (revoked key).

Fields

§i: u32

Sequence number (i=) of the signature.

§selector: Box<str>

Selector of the key.

§

IncorrectSignature

An s= signature value does not verify.

Fields

§i: u32

Sequence number (i=) of the signature.

§selector: Box<str>

Selector of the entry that failed.

§

UnknownAlgorithm

An s= entry names an algorithm this crate does not implement.

Fields

§i: u32

Sequence number (i=) of the signature.

§selector: Box<str>

Selector of the entry.

§

NoSignatureGroupPassed(u32)

No |-separated group of s= signatures passed.

§

HeaderHashMismatch

The header fields hash does not match the Message-Instance.

Fields

§m: u32

Revision number (m=) of the instance.

§hash: Dkim2Hash

Hash algorithm that did not match.

§

BodyHashMismatch

The body hash does not match the Message-Instance.

Fields

§m: u32

Revision number (m=) of the instance.

§hash: Dkim2Hash

Hash algorithm that did not match.

§

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Dkim2Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Dkim2Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Dkim2Error

Source§

impl PartialEq for Dkim2Error

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Dkim2Error

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more