DmarcVerifierVerify(FormatOptions, MimeMessage, SpfCheckResult, CancellationToken) Method

Validate the message.

Definition

Namespace: MimeKit.Cryptography
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
C#
public DmarcValidationResult Verify(
	FormatOptions options,
	MimeMessage message,
	SpfCheckResult? spfResult,
	CancellationToken cancellationToken = default
)

Parameters

options  FormatOptions
The formatting options used to verify the DKIM signatures.
message  MimeMessage
The message to validate.
spfResult  SpfCheckResult
The result of the SPF check of the MAIL FROM identity, if available.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

DmarcValidationResult
The result of DMARC validation.

Remarks

Validates the message, using the DkimVerifier to verify the DKIM signatures of the message. The signatures are only verified if a DMARC Policy Record applies to the message.

DNS failures do not throw exceptions; they are reported via the Status and Errors of the result.

Exceptions

ArgumentNullException

options is .

-or-

message is .

OperationCanceledException The operation was canceled via the cancellation token.

See Also