Issue while working with DKIM

Hi,



We encountered also a problem with DKIM.

Encloses the Aspose code that’s not working and the code that is working on the same DKIM configuration using dkim.net.dll:



We use Aspose mail 6.1.0 also tried 5.9.0



public void StuurAsposeDKIMEmail()

{

try

{

Aspose.Email.License license = new Aspose.Email.License();

license.SetLicense(“Aspose.Total.lic”);

string privateKeyFile = @“C://Temp/EmailKey/06012016userv.pem”;

RSACryptoServiceProvider rsa = PemReader.GetPrivateKey(privateKeyFile);

DKIMSignatureInfo signInfo = new DKIMSignatureInfo(“06012016userv”, “userv.nl”);

signInfo.Headers.Add(“From”);

signInfo.Headers.Add(“To”);

signInfo.Headers.Add(“Subject”);

signInfo.BodyCanonicalization = CanonicalizationType.Simple;

signInfo.HeaderCanonicalization = CanonicalizationType.Simple;

signInfo.HashAlgorithm = DKIMHashAlgorithm.RSASha1;

MailMessage mailMessage = new MailMessage(“test@userv.nl”, textBox1.Text);

mailMessage.Subject = “DKIM test message”;

mailMessage.Body = “Test”;

MailMessage signedMsg = mailMessage.DKIMSign(rsa, signInfo);



using (SmtpClient client = new SmtpClient(“", 25, "*”, “******”))

{

client.Send(signedMsg);

}

}

catch (Exception ex)

{

MessageBox.Show(ex.Message);

}

}



This is working with the enclosed attachment:



public void StuurDKIMTestMail()

{

try

{

var privateKey = PrivateKeySigner.LoadFromFile(@“C://Temp/EmailKey/06012016userv.pem”);

var DnsSelector = “06012016userv”;

var dkimSigner = new DkimSigner(privateKey, “userv.nl”, DnsSelector, new string[] { “From”, “To”, “Subject” });

var domainkey = new DomainKeySigner(privateKey, “userv.nl”, DnsSelector, new string[] { “From”, “To”, “Subject” });



System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();

msg.To.Add(textBox1.Text);

msg.Subject = “DKIM test message”;

msg.Body = “Hello world”;

msg.From = new System.Net.Mail.MailAddress(“test@userv.nl”);



msg.DomainKeySign(domainkey);

msg.DkimSign(dkimSigner);

using (System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient())

{

client.Port = 25;

client.Host = “***”;

client.Credentials = new System.Net.NetworkCredential("*", "");

client.Send(msg);

}

}

catch (Exception ex)

{

MessageBox.Show(ex.Message);

}



}

Hi Florent,

We regret the inconvenience you are facing.

We are currently investigating the issue at our end and need little more time to complete our tests. We’ll soon update you here with our results.

Hi Florent,


We have further logged this issue as EMAILNET-35117 in our bug tracking system for investigation by our Product team. Once the issue is investigated and there is some update available, we shall update you here via this thread.

We are sorry for the inconvenience you have faced.

The issues you have found earlier (filed as EMAILNET-35117) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.