SignDKIM sample - WeOnlyDo Discussion board

SignDKIM sample (wodSmtpServer / wodPop3Server / wodImapServer)

by nestorcastro, Monday, January 13, 2020, 20:43 (1776 days ago)

I'm trying to use SignDKIM Method but I'm not sure about 3th parameter Headers.

When the HeadersReceived events fires, I'm storing the Header into Message Tag like this:

Private Sub SMTPPrivado_HeadersReceived(ByVal User As WODSMTPSERVERCOMLib.ISmtpUser, ByVal Headers As WODSMTPSERVERCOMLib.ISmtpHeaders)
10 User.Message.Tag = Headers.ToString
End Sub

Then, in MailReceived Event, BEFORE relay the message, I'm trying to sign with:

NewMessage.SignDKIM mvarChavePrivada, "1578940440.mydomain", User.Message.Tag

PrivateSMTP.Relays.Add NewMessage

There is no error, but I'm not sure if this procedure is correct.

Can you tell me if this is correct?

SignDKIM sample

by Jasmine, Monday, January 13, 2020, 22:33 (1775 days ago) @ nestorcastro

Hi Nestor,

it's your choice which headers you want to include into the signature. Typically, it would be "From:To:Subject:Date" but in theory you can use any you wish. Recipient of the message will use this value to calculate message hash only using those headers (in the order you specified).

Regards,
Jasmine.

SignDKIM sample

by nestorcastro, Tuesday, January 14, 2020, 12:30 (1775 days ago) @ Jasmine

Hi Nestor,

it's your choice which headers you want to include into the signature. Typically, it would be "From:To:Subject:Date" but in theory you can use any you wish. Recipient of the message will use this value to calculate message hash only using those headers (in the order you specified).

Regards,
Jasmine.

Hello Jasmine,

Just to clarify, in my example, I would use:

NewMessage.SignDKIM mvarChavePrivada, "1578940440.mydomain", "From:To:Subject:Date"

Or

NewMessage.SignDKIM mvarChavePrivada, "1578940440.mydomain", "sender@mycompany.com:other@domain.com;Message Test:2020-01-11"

Best regards,

SignDKIM sample

by Jasmine, Tuesday, January 14, 2020, 16:03 (1775 days ago) @ nestorcastro

Hi.

Just header names, so this one would be valid:

NewMessage.SignDKIM mvarChavePrivada, "1578940440.mydomain", "From:To:Subject:Date"

Regards,
Jasmine