Docker-mailserver: DKIM for multiple domains

Created on 24 Feb 2017  路  4Comments  路  Source: tomav/docker-mailserver

First of all, thank you for this wonderful image!

I am running the mail server for two domains. My fqdn is example1.com; I have everything setup correctly, using dkim, spf, ssl and everything. My settings for the dns records are:

A: example1.com -> my VPS IP
MX: example1.com -> example1.com
TXT: example1.com -> "v=spf1 mx ~all"
TXT: mail._domainkey.example1.com -> example1.com dkim key

Dkim is recognised by the receiver and everything is working smoothly.

For the second domain, dkim is not recognised. Here are the dns details:

A: example2.com -> my VPS IP
MX: example2.com -> example2.com
TXT: example2.com -> "v=spf1 mx ~all"
TXT: mail._domainkey.example2.com -> example2.com dkim key

Dkim is not recognised by the receiver, what should I change in my dns records? Thank you in advance.

AN

question

Most helpful comment

Hey,

I've just finished setting up a similar configuration.

Judging from what you posted, it should work. Just confirm that:

  1. The e-mails are actually getting signed with DKIM
  2. Your DKIM keys are correct

My steps in getting this to work were:

  1. Add the new domain mailboxes
  2. Regenerate the DKIM config
  3. Store the DKIM keys in DNS
  4. Restart the container

Without restarting the container the e-mails weren't getting signed with DKIM, even though everything else was configured.

To confirm your DKIM keys use dig TXT mail._domainkey.domain.tld (taken from https://github.com/tomav/docker-mailserver/wiki/Configure-DKIM). Make sure that the keys for both domains are correct.

To confirm that the e-mails are getting signed, send yourself an e-mail and check that it has the DKIM-Signature header. I also really like this site for debugging e-mail setup: https://www.mail-tester.com/

All 4 comments

Hey,

I've just finished setting up a similar configuration.

Judging from what you posted, it should work. Just confirm that:

  1. The e-mails are actually getting signed with DKIM
  2. Your DKIM keys are correct

My steps in getting this to work were:

  1. Add the new domain mailboxes
  2. Regenerate the DKIM config
  3. Store the DKIM keys in DNS
  4. Restart the container

Without restarting the container the e-mails weren't getting signed with DKIM, even though everything else was configured.

To confirm your DKIM keys use dig TXT mail._domainkey.domain.tld (taken from https://github.com/tomav/docker-mailserver/wiki/Configure-DKIM). Make sure that the keys for both domains are correct.

To confirm that the e-mails are getting signed, send yourself an e-mail and check that it has the DKIM-Signature header. I also really like this site for debugging e-mail setup: https://www.mail-tester.com/

Hi @alen12345, does it answers your question?
Thanks.

Hello @tomav , yes it does!

Thank you very much @mrPjer , the problem was that I needed to restart the container, and also wait for the DNS update to propagate. My silly mistake...I have tried on multiple installations and can confirm that the DKIM signatures work perfectly.

Many thanks to both for the reply, this issue can be definitely closed. Thank again!

Great!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

m-a-v picture m-a-v  路  4Comments

dragonito picture dragonito  路  5Comments

H4R0 picture H4R0  路  3Comments

42wim picture 42wim  路  4Comments

cottonthread picture cottonthread  路  4Comments