익명 14:21

2048 bit DKIM key not working

2048 bit DKIM key not working

I've setup DKIM for my domain (burvil.org), where opendkim-keygen gives:

$ cat /etc/opendkim/keys/burvil.org/default.txt
default._domainkey      IN      TXT     ( "v=DKIM1; h=sha256; k=rsa; "
          "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0UkIedJ1/Oq9hKcQsMHobH2cZ61i//SoO1AR8FNQZ9UdKcxsdNe9eKPtX2hlJSOg/VVrDXY/mP8QM7NIFrng1iOeyZBLEUL5RY7G4z7iG0rafCFJ+C8UAQj5rUQqlfxMOrPUaB6kVcirYeV2FS3FR1IWdS6Es8T/6F1czi8VVKC8PJeAuuhNVxubhAUrD9wiY5mncuafE1oJCh"
          "DDlmsyVmCQmPUKvtycz/q+B2KIXJQCSqCbZmqcGZZDnb2fVBA5u7HsrT3V0sBetU12wIYe2oiGotvHDCw+tnoiqRWPN5lgZ9fCP3c4EE7YWjtyQjGJ8TZ4drvka5gYeJKHHqGK0QIDAQAB" )  ; ----- DKIM key default for burvil.org

which matches "OpenDKIM generates 2 keys" in that I also have a 2048 bit public key that's split into two sections. I tried the solution in that article and a) put the sections in double quotes as well as b) putting a \ between the two sections, but get the same results, i.e that DKIM record is not valid. This is based on the output below. Note that for security reasons, I don't want to use a 1024 bit key, and while I could confirm that doing that works, I don't see it buying much, as it seems pretty clear it's due to the length of the key, which needs to be broken up. Again, the output below says there's something wrong with the DKIM record.

https://www.mail-tester.com/spf-dkim-check gives:

We were not able to retrieve the key length, there is maybe an issue in that key

and https://mxtoolbox.com/SuperTool.aspx# gives:

  • Public Key
  • The syntax and semantics of this tag value before being encoded in base64 are defined by the (k) tag.
  • The value is not in the right format

After a couple iterations with Network Solution's UI, I got dig to return the output below. This is where I entered the whole, concatenated string of the public key from opendkim-keygen with no spaces, no quotes, no backslashes to escape anything.

 ~ dig TXT default._domainkey.burvil.org | grep default
; <<>> DiG 9.10.6 <<>> TXT default._domainkey.burvil.org
;default._domainkey.burvil.org. IN  TXT
default._domainkey.burvil.org. 1800 IN  TXT "v=DKIM1; h=sha256; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0UkIedJ1/Oq9hKcQsMHobH2cZ61i//SoO1AR8FNQZ9UdKcxsdNe9eKPtX2hlJSOg/VVrDXY/mP8QM7NIFrng1iOeyZBLEUL5RY7G4z7iG0rafCFJ+C8UAQj5rUQqlfxMOrPUaB6kVcirYeV2FS3FR1IWdS6Es8T/6F1czi8VVKC8PJeAuuhNVxu" "bhAUrD9wiY5mncuafE1oJCh DDlmsyVmCQmPUKvtycz/q+B2KIXJQCSqCbZmqcGZZDnb2fVBA5u7HsrT3V0sBetU12wIYe2oiGotvHDCw+tnoiqRWPN5lgZ9fCP3c4EE7YWjtyQjGJ8TZ4drvka5gYeJKHHqGK0QIDAQABI"

Which seems to me to have everything in the key. The space between the two quotes seems necessary to me, as per https://www.reddit.com/r/dns/comments/4ewwqv/txt_record_255_character_limit_with_2048bit_dkim/, the maximum size of a TXT record is 255 bytes.

Any thoughts on why this isn't working?



Top Answer/Comment:

Figured out that I had a trailing I in what was in DNS. Once I put the correct entire string into Network Solution's accounts page to edit the TXT record, it updated DNS properly.

상단 광고의 [X] 버튼을 누르면 내용이 보입니다