MailMessageDomainKeysVerify Method
Verifies DKIM and classic DomainKeys signatures of the current e-mail message.

Namespace: MailBee.Mime
Assembly: MailBee.NET.45 (in MailBee.NET.45.dll) Version: 10.0.45.502
Syntax
public DomainKeysVerifyResult DomainKeysVerify()

Return Value

Type: DomainKeysVerifyResult
The result of the verification.
Exceptions
ExceptionCondition
MailBeeExceptionAn error occurred and ThrowExceptions is true.
Remarks

If the message contains only one signature (e.g. only DomainKeys or only DKIM), this method will still succeed (provided that this signature is valid).

If you need more advanced level of DomainKeys/DKIM verification, use DomainKeys class.

Note Note
If the current system is FIPS-compliant and runs .NET 2.0/3.5 and the message contains only DKIM signature created using SHA256 algorithm, the method will return Sha256NotSupported or throw an exception if ThrowExceptions is enabled. This can only occur with older .NET versions (before 4.0) because there was no FIPS-certified SHA256 implementation at that time. On a FIPS system, use MailBee.NET.45.dll and .NET 4.5+ to avoid these issues. See FipsMode and DomainKeysVerifyResult topics for details.
Examples
This example displays the status of DomainKeys/DKIM signature of the last e-mail in the inbox.
using System;
using MailBee;
using MailBee.Mime;
using MailBee.Security;
using MailBee.Pop3Mail;

class Sample
{
    static void Main(string[] args)
    {
        // Download the last e-mail in inbox.
        MailMessage msg = Pop3.QuickDownloadMessage(
            "mail.company.com", "alex@company.com", "secret", -1);

        // Display the result of DomainKeys/DKIM verification.
        Console.WriteLine(msg.DomainKeysVerify().ToString());
    }
}
See Also