How to get DKIM to authenticate?

37

It looks like your DNS is setup incorrectly. You need to put in your public key that you generated when initially setting up DKIM. A sample DKIM record is as follows:

$ dig +short TXT dkim._domainkey.twitter.com
"v=DKIM1\;" "g=*\;" "k=rsa\;" "p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrZ6zwKHLkoNpHNyPGwGd8wZoNZOk5buOf8wJwfkSZsNllZs4jTNFQLy" "6v4Ok9qd46NdeRZWnTAY+lmAAV1nfH6ulBjiRHsdymijqKy/VMZ9Njjdy/+FPnJSm3+tG9Id7zgLxacA1Yis/18V3TCfvJrHAR/a77Dxd65c96UvqP3QIDAQAB"

Everything after the p= is the public key. Just paste it all on one line. The value that comes before the _domainkey is called your selector. In the twitter example above, their selector is dkim. From your /etc/dkim.conf file, it looks like your selector is called simply mail. So your DNS record should be:

mail._domainkey.MYDOMAIN.com. IN TXT "v=DKIM1; k=rsa; t=s; p=<yourpublickey>"

Once that's setup and after the record has propagated, you should get the full record when you run the following:

$ dig +short TXT mail._domainkey.MYDOMAIN.com

Hope this helps.

Share:
37

Related videos on Youtube

kvs
Author by

kvs

Updated on September 17, 2022

Comments

  • kvs
    kvs almost 2 years

    Hai every one,

    In this I have Three parameters how to move methodname.Equals('xx') method be moved out to a separate method.

     public static String APIMethod(string modulename,string methodname,string postContent )
        {
          string recordId = "1";
        string uri = zohocrmurl + modulename + "/"+methodname+"?";
        /* Append your parameters here */
        postContent = "scope=crmapi";
        postContent = postContent + "&authtoken=0ac32dc177c4918eca902fd290a92f4a";//Give your authtoken
    //how to move this and create them as seperate methods
        **if (methodname.Equals("insertRecords") || methodname.Equals("updateRecords"))
        {
        postContent = postContent + "&xmlData="+ HttpUtility.UrlEncode("Your [email protected]");
        }
        if (methodname.Equals("updateRecords") || methodname.Equals("deleteRecords") || methodname.Equals("getRecordById"))
        {
        postContent = postContent + "&id="+recordId;
        }**
        string result = AccessCRM(uri, postContent);
        return result;
        }
    
    • NinjaCat
      NinjaCat almost 14 years
      typing in: dkim-testkey -d MYDOMAIN.com -k /var/db/dkim/mail.key.pem -s mail gives me: dkim-testkey: res_query(): `mail._domainkey.MYDOMAIN.com' Unknown host
  • Harried Shein
    Harried Shein almost 14 years
    t=y means testing mode. You can use t=y for now while you get everything working, then switch it to t=s when everything is in place. g=* is assumed by default.
  • NinjaCat
    NinjaCat almost 14 years
    Weird thing is that the dig command still returns nothing...
  • NinjaCat
    NinjaCat almost 14 years
    dig (without +sort) returns: ;mail._domainkey.MYDOMAIN.com. IN TXT. Note that there is nothing returned after the "TXT".
  • NinjaCat
    NinjaCat almost 14 years
    do the semicolons need to be escaped as it is in the twitter example?
  • Harried Shein
    Harried Shein almost 14 years
    No, no need to be escaped. Your DNS server will handle that. You also don't need to provide any quotes around it, as your DNS server should place those as well. What is you domain name? I can attempt to make a few lookups on your behalf.