Guide de configuration des protocoles email de Red Sift
- All you need to know about SPF, DKIM and DMARC
- What is SPF?
- Which part of the email does the SPF protocol focus on?
- What is DKIM?
- Which part of the email does the DKIM protocol focus on?
- Why SPF & DKIM are not enough
- The solution? DMARC
- Which part of the email does the DMARC protocol focus on?
- Now that we know what headers each protocol looks at, what is contained in those headers, and what is checked?
- What’s the difference between Strict vs Relaxed alignment?
- What happens if DMARC fails?
- SPF troubleshooting and top tips
- DKIM troubleshooting and top tips
- DMARC troubleshooting and top tips
- All you need to know about SPF, DKIM and DMARC
- What is SPF?
- Which part of the email does the SPF protocol focus on?
- What is DKIM?
- Which part of the email does the DKIM protocol focus on?
- Why SPF & DKIM are not enough
- The solution? DMARC
- Which part of the email does the DMARC protocol focus on?
- Now that we know what headers each protocol looks at, what is contained in those headers, and what is checked?
- What’s the difference between Strict vs Relaxed alignment?
- What happens if DMARC fails?
- SPF troubleshooting and top tips
- DKIM troubleshooting and top tips
- DMARC troubleshooting and top tips
All you need to know about SPF, DKIM and DMARC
In this chapter, we’ve answered some of the most common questions our Customer Success Engineers are asked about SPF, DKIM, and DMARC - the three pillars of modern email authentication. Let’s dive in!
What is SPF?
SPF (Sender Policy Framework) is an email authentication standard that was developed to combat sender address forgery. By verifying the authenticity of the MAIL FROM or HELO/EHLO identities during transmission, SPF compares the sending server's IP address against a list of authorized senders specified in a TXT record within the domain owner's DNS. If the sending IP address aligns with the authorized list, SPF authentication succeeds.
Which part of the email does the SPF protocol focus on?
SPF focuses on the "domain" found in the email header, known by various names such as Return-Path, MAIL-FROM, Bounce address, or Envelope from. If this header is missing, SPF falls back and looks at the “HELO/EHLO” hostname and checks for an SPF record there.
The Return-Path header is a technical header that is not visible to the end user - unless they know how to display the headers of an email in their mail client they won't see it.
What is DKIM?
DKIM (DomainKeys Identified Mail) is used to sign different header fields and bodies to authenticate the sending domain and prevent message modification during transit.
It achieves this by using asymmetric cryptography which consists of a combination of public and private keys. The private key is private to the sender’s domain and is used to sign the emails. The public key is published in the sender’s DNS so it can be retrieved by anyone receiving messages from the sender.
When an email is composed, its headers and body are signed using the private key of the sender to create a digital signature, which is also sent as a header field along with the email. On the receiver’s side (if DKIM is enabled), the server retrieves the public key and verifies if the email was indeed signed by the sending domain. If the signature is successfully validated that proves that the sending domain sent the message and also that the headers and body of the message have not been modified during transmission.
Which part of the email does the DKIM protocol focus on?
DKIM focuses on the “DKIM-Signature” header.
As is the case with SPF, this header is not visible to the end user unless they know how to display the headers of the email they have received.
Why SPF & DKIM are not enough
While DKIM can verify that an email isn't the exact email that was sent, and SPF can recommend that a receiving server should reject an email based on the IP, neither of these are effective at spoofing prevention.
The main reason for this is the header that is checked for each protocol.
SPF checks the record found at the domain in the return-path header, and DKIM checks the key found at the d= domain (Found within the DKIM header).
Both of the above protocols can be set to check any domain.
In an email, the major domain of the sender is the domain found in the From: header, this header determines the big name at the top of emails - the address that the end-user will see if they check who sent the email.
Given the above, your email domain could be impersonated as attackers could make the From: yourdomain.com and the return-path and d= theirdomain.com. Provided the SPF and DKIM records at theirdomain.com were correctly configured, the email would pass both SPF and DKIM resulting in a successfully impersonated domain..
SPF and DKIM have their purposes, but neither alone are enough to prevent imitation.
The solution? DMARC
DMARC stands for Domain-based Message Authentication, Reporting and Conformance and builds upon SPF and DKIM, providing an additional layer of email authentication and policy enforcement.
DMARC does a few things:
- It takes into account the results from SPF and DKIM
- For DMARC to pass, it requires SPF or DKIM to pass and for the domain used by either one to also align with the domain found in the From: address. If you’re interested in learning more about Identifier Alignment, click here.
- It reports SPF, DKIM, and DMARC results back to the domain found in the From: address (ie. sender).
- Finally, it tells receivers how to treat emails that fail DMARC validation by specifying a policy in DNS.
By setting the DMARC policy to p=reject an organization can recommend to receiving servers to drop any emails set on behalf of their domain that don't pass the alignment check. This will stop all imitation attempts where the receiving server is correctly implementing DMARC.
Which part of the email does the DMARC protocol focus on?
DMARC focuses on the domain found in the From: or Header from header which is visible to the end user.
Now that we know what headers each protocol looks at, what is contained in those headers, and what is checked?
Sender Policy Framework (SPF)
SPF verifies if an email was sent by an authorized sender by checking a list of authorized IP addresses you publish in your DNS. The receiving server will take the domain found in the Return-Path header and check for an existing SPF record. It checks the SPF record to see if the sending IP address of the email is contained in the SPF record. If the IP address is contained in the SPF record that means that it is authorized to send emails. This means that SPF PASSED. If the IP address is not in the SPF record then SPF FAILS.
The overall logic is:
- If the sending IP address is contained in the SPF record = SPF PASS
- If the sending IP address is not contained in the SPF record = SPF FAIL
DKIM (DomainKeys Identified Mail)
The receiving server will check the DKIM-Signature header which contains the selector (s=) and signing domain (d=) which are tags used to look up the public key. Once retrieved, the public key is used to validate the email message. If validation is successful then DKIM PASSES and if the validation process is unsuccessful then DKIM FAILS.
The overall logic is:
- If validation is successful = DKIM PASS
- If validation is unsuccessful = DKIM FAIL
DMARC (Domain-based Message Authentication, Reporting & Conformance)
The receiving server will check if either SPF or DKIM PASSED, then it will check if the Return-Path domain used by SPF and/or the d= domain used by DKIM aligns with From: domain, and finally, it will extract the DMARC policy published by the domain found in the “From” address and comply with the policy.
The overall logic is:
- If SPF PASSED and ALIGNED with the “From” domain = DMARC PASS, or
- If DKIM PASSED and ALIGNED with the “From” domain = DMARC PASS
- If both SPF and DKIM FAILED = DMARC FAIL
DMARC not only requires that SPF or DKIM PASS, but it also requires the domains used by either one of those two protocols to ALIGN with the domain found in the
“From” address. Only then will DMARC PASS.
What’s the difference between Strict vs Relaxed alignment?
Strict alignment means that the Return-Path domain or the signing domain “d=” must be an exact match with the domain in the “From” address.
Relaxed alignment means that the Return-Path domain or the signing domain “d=” can be a subdomain of the “From” address and vice versa.
If you’re interested in learning more about Identifier Alignment, click here.
What happens if DMARC fails?
If DMARC fails, the receiving server would typically comply with the policy that you have specified in your DMARC record.
- If you are in report-only mode (p=none) the email will be accepted by the receiving server and scanned by other filtering criteria.
- If you are in quarantine mode (p=quarantine) the email will be quarantined and typically sent to the spam folder of the recipient.
- If you are in reject mode (p=reject) the receiving server will abort the connection with the sending mail server and the email will never reach the end user.
Irrespective of the policy, the metadata for the email will be logged along with the status of the authentication results and forwarded to your DMARC report processor. Learn more about DMARC reports here.
SPF troubleshooting and top tips
- Make sure that you have an SPF record in your Return-Path domain.
- Make sure that you have an SPF record in your HELO/EHLO domain in case of bounces where the Return-Path domain is empty.
- Make sure there is a single SPF record per domain.
- Make sure that the SPF record syntax is correct.
- Make sure that your Return-Path domain aligns with the From domain.
- Make sure that your authorized senders are part of the SPF record.
- Make sure that unauthorized senders are not in your SPF record.
- Make sure that you do not go over the 10 DNS lookup limit imposed by SPF. If you have gone over the 10 DNS lookup limit you will have to consider using a feature such as Red Sift’s OnDMARC’s Dynamic SPF.
- Make sure that deprecated SPF record mechanisms such as the “ptr” mechanism are not used in your SPF record.
DKIM troubleshooting and top tips
- Make sure that the sending systems you use support DKIM.
- Make sure that the emails are DKIM signed.
- Make sure that the signing domain aligns with the “From” domain.
- Make sure that you use a DKIM key size over 1024 bits (a 2048-bit key is advisable)
- Make sure, where possible, that the DKIM selectors you choose closely identify the sending service so you can distinguish between them.
- Make sure to revoke any keys that have been compromised.
- Make sure that the DKIM keys you manage are rotated regularly.
- Make sure that the DKIM key syntax is correct.
- Make sure that there exists a public key for each corresponding private key that signs your emails.
DMARC troubleshooting and top tips
- As DMARC is based on both SPF and DKIM and the domains used by those two protocols, you will have to make sure that the Return-Path domain for SPF is either an exact match or a subdomain of the “From” domain. The same applies to the signing domain used by DKIM.
- Make sure that the DMARC record syntax is correct.
- Make sure that you have configured all of your systems correctly with SPF and DKIM before moving to a reject policy as your emails will be lost.
- Make sure that you use a system or third-party provider such as Red Sift OnDMARC to receive DMARC reports so that you can make sense of those reports and discover any systems that are misconfigured.
- Monitor the status of each of your sending sources and make sure that any changes to SPF and DKIM are identified. Red Sift OnDMARC has this feature as a core part of its product.
Questions fréquemment posées : Guide de configuration des protocoles email
À l’époque pré-DMARC, les enregistrements SPF utilisaient couramment le mécanisme « -all » pour appliquer strictement les politiques d’expéditeur. Cependant, les recommandations actuelles de l’industrie en 2026 privilégient « ~all » pour équilibrer sécurité et délivrabilité, évitant le rejet inutile d’emails légitimes qui pourraient échouer au SPF mais réussir le DKIM et DMARC.
Cela s’explique car « ~all », lorsqu’il est mis en œuvre avec DMARC (à p=reject), permettra toujours de rejeter le courrier non authentifié si SPF et DKIM échouent, sans pour autant bloquer les emails légitimes, ce qui améliore la délivrabilité globale.
La spécification DMARC (RFC 7489) précise qu’un préfixe « - » sur le mécanisme SPF de l’expéditeur, comme « -all », peut déclencher un rejet anticipé, donc avant toute analyse DMARC. Utilisez « -all » uniquement pour les domaines inactifs qui n’envoient jamais d’emails. DMARC ne tient pas compte des nuances entre soft fail et hard fail dans la configuration SPF, les considérant tous deux comme des échecs SPF.
DMARC ne nécessite pas seulement que SPF ou DKIM passe, mais exige aussi qu’au moins un des domaines utilisés par SPF ou DKIM s’aligne avec le domaine trouvé dans l’en-tête From. Un alignement correct est essentiel pour la délivrabilité email en 2026, car les principaux fournisseurs de messagerie imposent désormais ces exigences.
Pour SPF, l’alignement des identifiants signifie que la vérification MAIL FROM/Return-PATH doit passer et que la partie domaine du MAIL FROM/Return-PATH doit correspondre au domaine de l’adresse From. En mode d’alignement strict, les domaines doivent être identiques alors qu’en mode relâché, les sous-domaines sont également acceptés tant qu’ils appartiennent au même domaine organisationnel.
Par exemple, si le MAIL-FROM/RETURN-PATH est @ondmarc.com et que l’en-tête From est @knowledge.ondmarc.com, ils ne sont pas alignés en mode strict. Cependant, en mode relâché, DMARC validerait l’email.
Un rapport agrégé DMARC contient des informations sur l’état d’authentification des messages envoyés au nom d’un domaine. Il s’agit d’un rapport de retour XML conçu pour offrir une visibilité sur les emails ayant passé ou échoué aux contrôles SPF et DKIM. Ce rapport offre aux propriétaires de domaine une vision précise des sources qui envoient en leur nom et du sort réservé à ces emails (la politique appliquée par le récepteur).
Les destinataires consulteront le tag 'rua' de votre enregistrement DMARC pour envoyer les rapports. Vous pouvez spécifier l’intervalle des rapports agrégés avec le tag ri dans votre enregistrement DMARC (par défaut, défini à 86400 secondes, soit 24h). Les rapports médico-légaux contiennent des informations plus détaillées sur chaque échec d’authentification. Toute information personnelle est retirée, mais les données utiles à l’investigation du problème DMARC sont incluses, comme les informations d’échec d’en-tête SPF et DKIM, l’adresse complète de l’expéditeur et l’objet du courriel.
L’adresse de réception des rapports médico-légaux DMARC est spécifiée par le tag 'ruf' de votre enregistrement. Tous les systèmes destinataires ne prennent pas en charge l’envoi de rapports médico-légaux. Red Sift OnDMARC est l’une des rares solutions DMARC du marché à les recevoir grâce à son partenariat avec Yahoo.
Une macro SPF désigne un mécanisme utilisé dans les enregistrements SPF permettant de définir des ensembles réutilisables d’adresses IP. Les macros SPF offrent une flexibilité et une maintenabilité accrues en permettant de définir des ensembles complexes d’IP dans un seul mécanisme, qui peut ensuite être référencé dans plusieurs enregistrements SPF. Par exemple, au lieu d’énumérer chaque adresse IP autorisée, vous pouvez définir une macro comme « %{i} » qui fait appel à l’IP d’expédition de l’email. Gérer SPF de cette manière offre un meilleur contrôle sur de grandes listes IP sans dépasser la limite de consultation SPF, tout en masquant les IP autorisées lors d’une requête publique.
Cependant, selon la structure de l’enregistrement SPF avec macros, l’absence de développement des macros peut entraîner des échecs SPF ou des résultats « Neutre » (notés ?all). Si les macros SPF jouent un rôle clé dans l’autorisation de serveurs d’envoi légitimes, les emails risquent de plus facilement échouer aux contrôles SPF ou d’être considérés comme suspects par les systèmes utilisant SPF pour l’authentification.
Mail Transfer Agent Strict Transport Security (MTA-STS) est une norme qui permet de chiffrer les messages envoyés entre deux serveurs de messagerie. Elle indique aux serveurs expéditeurs que les emails ne peuvent être transmis qu’en connexion sécurisée via Transport Layer Security (TLS), empêchant ainsi l’interception par des cybercriminels.
L’adoption de MTA-STS a fortement progressé, les organisations en 2026 considérant la sécurité de la couche transport comme essentielle pour protéger les emails en transit. Pour activer MTA-STS sur un domaine destinataire, il faut annoncer la prise en charge MTA-STS dans le DNS et publier un fichier de politique sur son site web.
L’activation de MTA-STS doit se faire avec précaution afin d’éviter de bloquer la réception d’emails. Il est conseillé de d’abord déployer MTA-STS en mode test, afin que les rapports TLS permettent de détecter et corriger les éventuelles erreurs avant de passer à l’application stricte. Cette démarche progressive deviendra probablement la norme en 2026 pour les organisations renforçant la sécurité du transport.
Le SMTP TLS Reporting (ou TLS-RPT) permet de rapporter les problèmes de connectivité TLS rencontrés par les MTAs expéditeurs, conformément à RFC8460. À l’instar de DMARC, TLS-RPT utilise des rapports transmis par email pour avertir le propriétaire d’un domaine en cas d’échec de livraison dû à des problèmes TLS. Ces rapports incluent les politiques MTA-STS détectées, des statistiques de trafic, les connexions échouées et les raisons de l’échec.
Avec la fonction MTA-STS de Red Sift OnDMARC, vous n’avez plus besoin de gérer un déploiement complexe. Il suffit simplement d’ajouter les Smart Records MTA-STS fournis par OnDMARC à votre DNS et Red Sift prend en charge tout le reste : hébergement du fichier de politique MTA-STS, gestion du certificat SSL, et signalement de toute violation détectée via un rapport TLS. En 2026, les plateformes DMARC modernes incluent de plus en plus MTA-STS hébergé par défaut, facilitant ainsi le déploiement de la sécurité du transport.
Publié sous RFC 7671, DANE (DNS-based Authentication of Named Entities) introduit une nouvelle norme Internet pour établir une communication TLS entre client et serveur sans dépendre des Autorités de Certification (CA) classiques.
Le modèle traditionnel requiert qu’un CA puisse délivrer un certificat pour n’importe quel domaine. DANE procède autrement, s’appuyant sur l’infrastructure DNSSEC (Domain Name System Security Extensions) pour lier un nom de domaine à un certificat. DANE exploite le protocole DNSSEC existant pour garantir l’authenticité et l’intégrité des données reçues.
DANE introduit aussi un nouvel enregistrement DNS de type TLSA qui signale au client que le serveur supporte TLS. Il est recommandé de mettre en place à la fois MTA-STS et DANE. DANE est requis par de nombreuses administrations, en particulier dans l’UE pour les organismes publics.
DANE et MTA-STS ne sont utiles que si l’expéditeur les prend en charge, or beaucoup ne supportent qu’un seul de ces mécanismes. Déployer les deux améliore donc la sécurité générale. En 2026, les organisations mettent souvent d’abord en place MTA-STS pour une compatibilité maximale, puis ajoutent DANE là où le niveau de sécurité doit être renforcé.
La politique de sous-domaine permet aux administrateurs de protéger différents domaines et sous-domaines selon leur niveau d’avancement dans l’adoption de DMARC. Par exemple, si tous vos services d’envoi au nom du domaine principal sont bien configurés avec SPF et DKIM, vous pouvez protéger votre domaine principal avec une politique DMARC p=reject tout en utilisant p=none sur les sous-domaines, voire l’inverse.
Par ailleurs, si un de vos services d’envoi n’est pas compatible DMARC (il ne prend pas en charge SPF ou DKIM), vous pouvez décider de lui attribuer un sous-domaine dédié et une politique DMARC différente, sans pour autant que cela empêche la protection de vos autres domaines. Cela permet de répartir le trafic sur plusieurs sous-domaines et de protéger chacun en fonction de son besoin.




