Bulk Email Server Guide: DKIM keys for sending domains

This is the last step that MUST be done before you can press SEND for the first time. Invalid DKIM signature is almost guaranteed delivery to spam.

Why didn't we do this before when we were playing with NS records? Well, we didn't know what to add for DKIM yet so it was either we do all NS records now or only DKIM, and since you want to start sending it's better that your NS records (well most of them) have already been done hopefully at least a few hours ago and should already be propagated across the globe or plate (?) in case you think the earth is flat.

Since Mumara did all the hard work for us there is only some copy/pasting that needs to be done. Everything has already been generated and private keys are where they should be /etc/pmta/dkim/. What you have to do now is to copy the public part as a TXT record for each of your sending domains.

Open DKIM.txt and add a public key for each domain in this file. I know this is a long guide and if you are doing this for the first time you are tired and lost. Take my advice and take at least 15 to rest. This part is very important and if you miss just one letter your emails might never see what your inbox looks like.

Having problems?
Please use the comments below for your questions. This way other users can benefit from provided answers. Please read this first!

This tutorial is a part of the complete Do It Yourself Bulk Email Server Guide. If you are interested in starting with email marketing or want to improve your delivery, open, and click rates I recommend that you follow it from the beginning. Almost 15 years in this business and many, many tests show that this is the best long-run solution for every mass email sender with a double opt-in, scraped, or bought list.

Join Hundreds of Happy Email Marketers!

Start the Guide Now!

This Post Has 19 Comments

  1. ninja

    Here are most frequent problems users have in this step.

    None so far.

  2. ljjtfyl3c1sharpd4b

    Ah finally everything is working as it should. But what about list unsubscribe and custom header? Or we can mail just as is?

    1. ljjtfyl3c1sharpd4b

      Ops sorry, the list unsubscribe header is there, overlooked. What’s your suggestion on custom headers, things like campain uid, subscriber uid? thanks!

      1. ninja

        Be sure to add your domains to postmaster before adding anything. After everything is verified go to “Settings Custom Headers” and add it as instructed by Google.

        1. ljjtfyl3c1sharpd4b

          Thanks! 😀

  3. ljjtfyl3c1sharpd4b

    Not really sure how to set this up, Feedback-ID: CampaignIDX:CustomerID2:MailTypeID3:SenderId,
    can’t find any answer to this, need your help, thanks!

    1. ninja

      You need to register with Postmaster first. After that just add a custom header like instructed by Google and use available tags.

      1. ljjtfyl3c1sharpd4b

        Something like this?
        Header Label = Feedback-ID
        Header Value = {68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}campaign_id{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}:{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}email_id{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}:{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}list_id{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}:{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}from_email{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}{68e7e9a41b18d877ce48f6781f70190f02eae72a8a860d5cd4744b65c53b0402}
        lol

        1. ninja

          yes 🙂

          1. ljjtfyl3c1sharpd4b

            Thanks!

  4. ljjtfyl3c1sharpd4b

    How about List-Unsubscribe Header in Application Settings? I tried using tags but it didn’t work, made one in custom headers List-Unsubscribe: it looks fine but I don’t think it is the correct way. Any tips? or it is not important?
    Thanks! 😀

    1. ninja

      unsubscribe header is added by default

      1. ljjtfyl3c1sharpd4b

        thanks! yea, the link is added, i was trying to add the mailto header 😀

  5. pritich

    /etc/pmta/dkim/ of the sending server is empty. There are no files there. kindly advice.

    1. ninja

      was the connection to server successful?

  6. PhoenixR5

    How do we know if it was done correctly? I followed your guide perfectly so for this part i created a TXT record and the value was public key? Is that correct?

    1. ninja

      yes. you will see if its correct once you send out an email

  7. jnyyzzz

    After changing the DKIM key, there is an error message in amavisd -c /etc/amavisd/amavisd.conf testkeys => fail (bad RSA signature). How to make it pass?

    1. ninja

      Why did you change it? Did it pass before?

Comments are closed.