(05-15-2018, 06:56 PM)chongma Wrote: seems new version of opendkim uses a stronger algorithm. setting SignatureAlgorithm rsa-sha256 in
/etc/opendkim.conf makes the file shorter. still needs to be solved though...
We can fix this with a couple of steps:
First, alter the table structure for the "x_dns" table in the database so that the "dn_target_vc" field length is a suitably high value... might be a good idea to future-proof it and assume one day we will use large strings here, so maybe a few hundred or even a few thousand characters?
Second, you need to edit two files (these paths are CentOS7-based, you might need to change for a different OS):
Code:
/etc/sentora/panel/modules/dns_manager/code/controller.ext.php
/etc/sentora/panel/modules/dns_manager/hooks/OnDaemonRun.hook.php
and replace all occurrences of:
Code:
stripslashes($rowdns['dn_target_vc'])
with:
Code:
rtrim(chunk_split(stripslashes($rowdns['dn_target_vc']), 100, '" "'),'" "')
This will chunk the one long string into several smaller strings of 100 characters. This formats the long TXT entry correctly for records longer than 255.
Try it and see. A DKIM checker like
https://mxtoolbox.com/dkim.aspx should show your DKIM record is correct.
Keith.
Edit: Just to be clear, when a user enters the record they do not need to "chunk" it themselves. They can just paste in the entire record text without any new lines, quotes (which would be removed from the string anyway, along with backslashes), etc. If they later edit it, it will be presented back to them looking exactly the same. The chunking does not get stored in the database, it only affects the txt file that is generated for use by BIND.