Closed mtmulch0191 closed 1 year ago
So I was able to resolve this DKIM signature issue by appending the following meta tag prior to our string content from the user.
Is meta being appended due to a specification I don't know about that the SMTP server would be expecting?
bodyBuilder.HtmlBody = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">" + messageDto.MessageBody;
MailKit isn't appending any html tags ever, but based on that, I would say it sounds like an email server somewhere is adding that.
Great thanks for the info.
Describe the bug When attempting to relay an email through Office 365 using MailKits SMTP Client and constructing a MimeMessage containing an HtmlBody the DKIM validation fails on the recipient side of gmail, yahoo, aol. Switching the HTMLBody to a TextBody allows DKIM validation to pass. I am preparing the message with SevenBit Encoding prior to signing with DKIM and attempted to switch to EightBit encoding and none.
I also attempted to convert the string that is being appended to the HTML Body as ASCII.
Platform (please complete the following information):
To Reproduce Steps to reproduce the behavior:
Expected behavior I would expect the HTMLBody to pass DKIM validation without extra data being appended to the HTML body causing the validation to fail just like the TextBody.
Code Snippets If applicable, add code snippets to help explain your problem.
Constructing the MimeMessage
Signing with DKIM
Additional context Example MimeMessage Written To File System Prior to Being Sent
Original Source of Gmail Email