0

I am checking the dkim key generated by opendkim and I keep getting an error of key not valid. Here is the output of mail.txt key file:

I replaced my domain with example.com in this scenario.

mail._domainkey IN      TXT     ( "v=DKIM1; h=sha256; k=rsa; "
          "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnfDZPCPKymA9ybytg9YS9yhS4ui118UCJTYC9AeI36bsuLKgcYqJJYVQiaJ8m7zyOrD0UDtR/OIAMmzI9XWK0S9rt10JSr8XYq7Ewz8zMiTzyECtqtCzYlg6NUxbmmSkf6XMgpPBF2ttZ7fa0WroumAgULZmA6+X4APoOQHnWFi7wg0AJ47dMkqIY1RXBBt9/ncMuBlPL7DllH"
          "4SgKyGiKssXbIZwGryO0bDU7eOgKmpFOZk4rjp6cQN/6xG7dl8mKKh6AWhUo7aT9fbqAbg5xJCE8SuvshX8EyoxXFPFfow1RiKBkXWyRQB9NaCbFeOQ+kZSdBUJWrjPzsd+Iz3xwIDAQAB" )  ; ----- DKIM key mail for example.com

I am assuming that my text record should look something like the following:

"v=DKIM1; h=sha256; k=rsa;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnfDZPCPKymA9ybytg9YS9yhS4ui118UCJTYC9AeI36bsuLKgcYqJJYVQiaJ8m7zyOrD0UDtR/OIAMmzI9XWK0S9rt10JSr8XYq7Ewz8zMiTzyECtqtCzYlg6NUxbmmSkf6XMgpPBF2ttZ7fa0WroumAgULZmA6+X4APoOQHnWFi7wg0AJ47dMkqIY1RXBBt9/ncMuBlPL7DllH"

Where I use the p value in the text record. But I also get a second value in double quotes and I don't see that in any other tutorials I have read but I tried to use that value instead of the p value and no luck also I tried a combo of both. Not sure what I am doing wrong here but it is starting to get frustrating. I have also tried to generate new keys but the problem persists.

When I check the key with opendkim-testkey -d example.com -s mail -vvv I get:

opendkim-testkey: using default configfile /etc/opendkim.conf
opendkim-testkey: checking key 'mail._domainkey.example.com'
opendkim-testkey: key not secure
opendkim-testkey: key OK

So idk what is the deal. Any help would be appreciated.

2
  • Two separate things happening: a) opendkim-testkey complains if anyone else can read the private key b) some DNS software expects (for rsa, large) records to be provided as a sequence of short chunks: ("start" "continuation" "end").
    – anx
    Sep 26, 2020 at 1:27
  • Without knowing your domain and file permissions (try namei -l /path/to/keyfile), we cannot tell if either is causing problems for you.
    – anx
    Sep 26, 2020 at 1:28

0

You must log in to answer this question.

Browse other questions tagged .