DKIM failure due to quotation

Description

After enabling DKIM and resetting DNS settings in the DNS page against a domain, the record is created just fine.

Should it be relevant, I’m using cloudflare for my DNS provider.

The problem is, this record is contained within quotes “”.

Due to this, DKIM signing is failing, as in this example, both the beginning and end of the DKIM string begins with &quot

Is there a way to correct this? I’ve manually edited the quotes out, and this is now working fine. I’m just wondering if it’s possible to correct the error in apiscp, so DNS record correction is automated.

Thanks so much in advance!
Kind Regards

Looks OK to me.

# dig @jeremy.ns.cloudflare.com +norec +short TXT dkim1._domainkey.futz.net
"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA42oRELTvlhsB6TeuoHUFifG/yKFLDpwyYC4a5COfp1CNKWj+M9CzH6uwIS4vl3WeKfGs0c0K7Ng9JMV+aUJwg9tRaoty5XqnEKVqqdOzy16/6cTRNBMGsMhazcIlRXSpO1bDGF90asDAigozwtW5M/BEG2E6qPYPtMFXwDX6eULg9VW/a+4b4DFa1o17po+wk" "BQl2v0fjbdNsfh2Zetz3ByLe3YjYLbXEEThzCoNGKdB/+zzePUOIQh5u2tiRbzM9Au41flgqN5zvdbZ68YwJJnuuAp4vsnw+gC+2VaXFWAXQ+4LFf0YswLZYBPRXrLPLf5mJoyAc57pWOsxwrgTjQIDAQAB"

Cloudflare reports the record without quotes. dig does so because the label length exceeds 256 bytes. Per RFC 1035:

<domain-name> is a domain name represented as a series of labels, and
terminated by a label with zero length. <character-string> is a single
length octet followed by that number of characters. <character-string>
is treated as binary information, and can be up to 256 characters in
length (including the length octet).

<character-string> is expressed in one or two ways: as a contiguous set
of characters without interior spaces, or as a string beginning with a "
and ending with a ". Inside a " delimited string any character can
occur, except for a " itself, which must be quoted using \ (back slash).

dkim:roll creates the record on Cloudflare as expected:

# dig @jeremy.ns.cloudflare.com +norec +short TXT dkim1._domainkey.futz.net
"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA42oRELTvlhsB6TeuoHUFifG/yKFLDpwyYC4a5COfp1CNKWj+M9CzH6uwIS4vl3WeKfGs0c0K7Ng9JMV+aUJwg9tRaoty5XqnEKVqqdOzy16/6cTRNBMGsMhazcIlRXSpO1bDGF90asDAigozwtW5M/BEG2E6qPYPtMFXwDX6eULg9VW/a+4b4DFa1o17po+wk" "BQl2v0fjbdNsfh2Zetz3ByLe3YjYLbXEEThzCoNGKdB/+zzePUOIQh5u2tiRbzM9Au41flgqN5zvdbZ68YwJJnuuAp4vsnw+gC+2VaXFWAXQ+4LFf0YswLZYBPRXrLPLf5mJoyAc57pWOsxwrgTjQIDAQAB"

# cpcmd dkim:roll
INFO   : Bootstrapper task running in background with roles: mail/rspamd
1

# dig @jeremy.ns.cloudflare.com +norec +short TXT dkim2._domainkey.futz.net
"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyRoi7dNiQhOGkDdHS4AmlZiz3hz1UWJZfNbaXIjp/gKUYIl9sEUG2+ehTJoJto+m37IjEM9i9oVqMbVwJmt4Dw7FSUuurTIBvoc3SUoUyyxzuWb+6quERKI8zwLA0VeJLDy8lQaKuZMuhyChainmT/sKT/NrqvRO7tjt+er8qRzc2odSOzU54hjvZKKrIRi8q" "ZVOjE89CUBWmTRY/dt9q2NB0aELMJ5OSoe/oxnXegbaSdqnhrXpQi2KH3BdiItMU44G/cp7pyBJt31C2C+mTbW2pzqinfINUx8Qzk2L7FBN/3AZHNrJJtoij4u96cEa8pKFfu+qggFZYOQmhx87WwIDAQAB"