Simple way of using E-MailRelay to implement DKIM?
SMTP email proxy and relay server
Brought to you by:
graeme_walker
I am trying to add DKIM to an existing windows server which is currently using IIS SMTP for outgoing mail.
It seems like this could be done by using E-MailRelay in connection with a suitable mail filter, but after reading the basics it seems like there is no preconfigured way to do this (such as supplying the name of a .pem file and selector to a default filter and letting E-MailRelay do the rest)
I think I understand the basics of implementing such a filter on my own, but before reinventing the wheel I just wanted to ask if someone has implemented a filter for DKIM signing already.
Thanks in advance for your help!
I'm not aware of any DKIM signers specifically for E-MailRelay but as you say it should be doable with a filter and the starting point would depend on your scripting language of choice -- perhaps perl's Mail::DKIM::Signer. Let us know how you get on.
I've attached a perl script to show how Mail::DKIM::Signer could be turned into an emailrelay filter.
I've tested my signing script and it seems to work. I had to remove the call to dkim CLOSE() because that is done by load() and two CLOSE()s are not idempotent. Instructions for testing are in the header comments.
Thanks a lot, Graeme! This is just what I needed.
Here's a C# / .NET 6 port of your script in case someone else needs this: