πŸ“˜ How to generate a DKIM key for your MTA?

This article will show you step-by-step DKIM key generation.

In this article, we will assume that your domain is yourdomain.com and we will be using the DKIM selector m1.

On your computer (or on your server), on the command line, execute this command:

openssl genrsa -out m1.yourdomain.com.pem 2048

This command generates a file containing the private key for the DKIM signature.

Now, generate the public key based on this private key:

openssl rsa -in m1.yourdomain.com.pem -out m1.yourdomain.com.pub -pubout

Now, you have two files:

  • m1.yourdomain.com.pem is the private key.
  • m1.yourdomain.com.pub is the public key.

Edit your public key and merge lines into one. Be careful about not changing any character inside the file.

Set your DKIM private key on your MTA configuration. This process may vary depending on what MTA you’re using.

As the last step, go to your yourdomain.com DNS control panel and add a TXT record with;

  • Subdomain: m1
  • Record type: TXT
  • Value: k=rsa; p=....... (replace the dot area with the public key one-line content)

That’s all. Now you have your DKIM signature ready.

If you want to use a DKIM generator service instead of running commands shown above, you can try this one: Sparkpost DKIM Wizard

  • The article was helpful
  • The article was not helpful

0 voters