generated DKIM DNS Record is invalid
short description
There is limit for Bind's TXT record length piece. Current wrong format:
default._domainkey.obugohome.eu. 3600 TXT v=DKIM1; t=s; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3KqmiHNbsxe2Qos9uMIFJoNbrVArBt8vp+Jszn8cSxj3a+sGf1++wpEflk/NaVq88QCQAYl/z1CNUyakAfCuWNxT7oEQbrbS3koq++A8VPBm2PQfEYBJyBDp9bhXId6AfNnk3gfDPGhvP10O4MsFRa5o1IE9ZSyaPI2Q6QRKiN0j/zJxvfGFQ4N1hVRz3CyLkURClc4cBaC+WKjuwVtvcEoYmiNpHBJQQou0amahiYB0JGEvFLsX35PwtA6rwxlVcyXebEsVqEkIOgIaQBTOoVEsGCV0WOg0FFVaUXAsrwG2kW8aIPl4UwtSwsL6QHZFFY7OW07XQvs+P0Mspp3BkQIDAQAB
The quotes also missing here. It results to
Your public key is:
"v=DKIM1"
Your DKIM signature is not valid
correct behaviour
default._domainkey.vitexsoftware.cz. 3600 IN TXT ("v=DKIM1; t=s; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4ydE2hUBtwDTN9XErnPYLgA7o0k7z6K2vczcNR7Yqq03RTwrqy3uglgYWoknqKCBA+iNs3LIx/g2/PxyOBVLdZLfmkwcGY/B9cBjj27NnI6KAoNNhkcZQrKPStbO10qY1PZ4FzbD1FaJ"
"HFk19aSha1rXUsfBLREosO9X3IPt9qaTw8jlJHxnr8XYkcS757bPgwd5GmV2fZllSmfhrhEiXjVrWAqh6ZbVaZ/GXB4fEgJuHfJ8hhp4rFWAQvIGHyVlUNH80bPQ168MRv0Dhuk9R9qAzySTPXDUSbxbGQgdqwz6zNNd5IgINeefvhKwYW6Gn8BtCjYlB6dLUAiNHeA8"
"RwIDAQAB")
environment
Server OS: all Server OS version: all ISPConfig version: (3.1.+)
proposed fix
$dkim_txt = 'v=DKIM1; t=s; p=' . $dns_key;
if(strlen($dkim_txt) > 200){
$keyparts = str_split($dkim_txt, 200);
array_walk($keyparts, function(&$value, $key) { $value = '"'.$value.'"'; } );
$dkim_txt = '('. implode("\n", $keyparts) .')';
}
$dns_record = $rec['dkim_selector'] . '._domainkey.' . $rec['domain'] . '. 3600 IN TXT '.$dkim_txt;
screenshots
Edited by Thom