SymfonyWorld Online 2020
100% online
30+ talks + workshops
Live + Replay watch talks later

New in Symfony 5.2: DKIM email authentication

Contributed by
Fabien Potencier
in #37165.

DKIM (DomainKeys Identified Mail) is an email authentication method designed to detect forged sender addresses in emails (email spoofing), a technique often used in phishing and email spam.

DKIM allows the receiver to check that an email claimed to have come from a specific domain was indeed authorized by the owner of that domain. In Symfony 5.2 we’ve added support for DKIM in the Mailer component to allow you affix a digital signature, linked to a domain name, to each outgoing email messages:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
use Symfony\Component\Mime\Crypto\DkimSigner;
use Symfony\Component\Mime\Email;

$email = (new Email())
    ->from('[email protected]')
    // ...
    ->html('...');

$signer = new DkimSigner('file:///path/to/private-key.key', 'example.com', 'sf');
$signedEmail = $signer->sign($email);

Read the DKIM signer docs to learn about all the available configuration options.

Help the Symfony project!

As with any Open-Source project, contributing code or documentation is the most common way to help, but we also have a wide range of sponsoring opportunities.

Comments

Comments are closed.

To ensure that comments stay relevant, they are closed for old posts.