Symfony 5.2 DkimSigner not working (DKIM lookup KO)

I never ask questions here usually but I’m stuck right now.

I’ve just upgraded my Symfony projet from 5.0 to 5.2 because I needed to DKIM sign my emails and there is a new feature to sign emails with Symfony Mailer on 5.2 :

I can’t find any support on this so I hope someone had the same problem as me.

I basically followed documentation by implementing my signature on my mail like that :

$email = (new TemplatedEmail())
         ->from(new Address('[email protected]', 'Noreply'))
         ->text('My email text format')

$signer = new DkimSigner(
$signedEmail = $signer->sign($email);


I also tried getting content :

$signer = new DkimSigner(

I still have "body has been altered" when using multiple DKIM lookup and the test fail.

I don’t think there is a problem in charging the private key file because I first had those kind of errors that I fixed by adding the "/../" on the path.

I’ve set the public key on my DNS with TXT record and domain like that :


I don’t think this is a problem of key integrity because I used openssl to generate the private and public keys :

openssl genrsa -out private.key 1024
openssl rsa -in private.key -pubout -out public.key

And I can’t sign my email by using my SMTP server because I’m having a mutualized offer and I can’t change server configurations.

Thank you for your time and I hope someone had the same problem !

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *