Configurer SPF pour empêcher l’usurpationSet up SPF to help prevent spoofing

Summary: This article describes how to update a Domain Name Service (DNS) record so that you can use Sender Policy Framework (SPF) with your custom domain in Office 365.Summary: This article describes how to update a Domain Name Service (DNS) record so that you can use Sender Policy Framework (SPF) with your custom domain in Office 365. Using SPF helps to validate outbound email sent from your custom domain.Using SPF helps to validate outbound email sent from your custom domain.

In order to use a custom domain, Office 365 requires that you add a Sender Policy Framework (SPF) TXT record to your DNS record to help prevent spoofing.In order to use a custom domain, Office 365 requires that you add a Sender Policy Framework (SPF) TXT record to your DNS record to help prevent spoofing. SPF identifies which mail servers are allowed to send mail on your behalf.SPF identifies which mail servers are allowed to send mail on your behalf. Basically, SPF, along with DKIM, DMARC, and other technologies supported by Office 365, help prevent spoofing and phishing.Basically, SPF, along with DKIM, DMARC, and other technologies supported by Office 365, help prevent spoofing and phishing. SPF is added as a TXT record that is used by DNS to identify which mail servers can send mail on behalf of your custom domain.SPF is added as a TXT record that is used by DNS to identify which mail servers can send mail on behalf of your custom domain. Recipient mail systems refer to the SPF TXT record to determine whether a message from your custom domain comes from an authorized messaging server.Recipient mail systems refer to the SPF TXT record to determine whether a message from your custom domain comes from an authorized messaging server.

For example, let's say that your custom domain contoso.com uses Office 365.For example, let's say that your custom domain contoso.com uses Office 365. You add an SPF TXT record that lists the Office 365 messaging servers as legitimate mail servers for your domain.You add an SPF TXT record that lists the Office 365 messaging servers as legitimate mail servers for your domain. When the receiving messaging server gets a message from joe@contoso.com, the server looks up the SPF TXT record for contoso.com and finds out whether the message is valid.When the receiving messaging server gets a message from joe@contoso.com, the server looks up the SPF TXT record for contoso.com and finds out whether the message is valid. If the receiving server finds out that the message comes from a server other than the Office 365 messaging servers listed in the SPF record, the receiving mail server can choose to reject the message as spam.If the receiving server finds out that the message comes from a server other than the Office 365 messaging servers listed in the SPF record, the receiving mail server can choose to reject the message as spam.

Also, if your custom domain does not have an SPF TXT record, some receiving servers may reject the message outright.Also, if your custom domain does not have an SPF TXT record, some receiving servers may reject the message outright. This is because the receiving server cannot validate that the message comes from an authorized messaging server.This is because the receiving server cannot validate that the message comes from an authorized messaging server.

If you've already set up mail for Office 365, then you have already included Microsoft's messaging servers in DNS as an SPF TXT record.If you've already set up mail for Office 365, then you have already included Microsoft's messaging servers in DNS as an SPF TXT record. However, there are some cases where you may need to update your SPF TXT record in DNS.However, there are some cases where you may need to update your SPF TXT record in DNS. For example:For example:

  • Previously, you had to add a different SPF TXT record to your custom domain if you were using SharePoint Online.Previously, you had to add a different SPF TXT record to your custom domain if you were using SharePoint Online. This is no longer required.This is no longer required. This change should reduce the risk of SharePoint Online notification messages ending up in the Junk Email folder.This change should reduce the risk of SharePoint Online notification messages ending up in the Junk Email folder. Update your SPF TXT record if you are hitting the 10 lookup limit and receiving errors that say things like, "exceeded the lookup limit" and "too many hops".Update your SPF TXT record if you are hitting the 10 lookup limit and receiving errors that say things like, "exceeded the lookup limit" and "too many hops".

  • Vous avez un environnement hybride avec Office 365 et Exchange en local.If you have a hybrid environment with Office 365 and Exchange on-premises.

  • Vous avez l’intention de configurer DKIM et DMARC (recommandé).You intend to set up DKIM and DMARC (recommended).

Mise à jour de votre enregistrement TXT SPF pour Office 365Updating your SPF TXT record for Office 365

Before you update the TXT record in DNS, you need to gather some information and determine the format of the record.Before you update the TXT record in DNS, you need to gather some information and determine the format of the record. This will help prevent you from generating DNS errors.This will help prevent you from generating DNS errors. For advanced examples and a more detailed discussion about supported SPF syntax, see How SPF works to prevent spoofing and phishing in Office 365.For advanced examples and a more detailed discussion about supported SPF syntax, see How SPF works to prevent spoofing and phishing in Office 365.

Collectez les informations ci-dessous :Gather this information:

  • The current SPF TXT record for your custom domain.The current SPF TXT record for your custom domain. For instructions, see Gather the information you need to create Office 365 DNS records.For instructions, see Gather the information you need to create Office 365 DNS records.

  • External IP addresses of all on-premises messaging servers.External IP addresses of all on-premises messaging servers. For example, 131.107.2.200.For example, 131.107.2.200.

  • Domain names to use for all third-party domains that you need to include in your SPF TXT record.Domain names to use for all third-party domains that you need to include in your SPF TXT record. Some bulk mail providers have set up subdomains to use for their customers.Some bulk mail providers have set up subdomains to use for their customers. For example, the company MailChimp has set up servers.mcsv.net.For example, the company MailChimp has set up servers.mcsv.net.

  • Determine what enforcement rule you want to use for your SPF TXT record.Determine what enforcement rule you want to use for your SPF TXT record. We recommend -all.We recommend -all. For detailed information about other syntax options, see SPF TXT record syntax for Office 365.For detailed information about other syntax options, see SPF TXT record syntax for Office 365.

Pour ajouter ou mettre à jour votre enregistrement TXT SPFTo add or update your SPF TXT record

  1. Assurez-vous que vous connaissez la syntaxe SPF du tableau suivant.Ensure that you're familiar with the SPF syntax in the following table.

    Si vous utilisez...If you're using... Courant pour les utilisateurs ?Common for customers? Ajoutez l'élément suivant...Add this...
    11 Un système de messagerie (obligatoire)Any email system (required) Common.Common. All SPF TXT records start with this valueAll SPF TXT records start with this value v=spf1v=spf1
    22 Exchange OnlineExchange Online CourantCommon include:spf.protection.outlook.cominclude:spf.protection.outlook.com
    33 Exchange Online dédié uniquementExchange Online dedicated only Non courantNot common ip4:23.103.224.0/19 ip4:206.191.224.0/19 ip4:40.103.0.0/16 include:spf.protection.outlook.comip4:23.103.224.0/19 ip4:206.191.224.0/19 ip4:40.103.0.0/16 include:spf.protection.outlook.com
    44 Office 365 Germany, Microsoft Cloud Germany uniquementOffice 365 Germany, Microsoft Cloud Germany only Non courantNot common include:spf.protection.outlook.deinclude:spf.protection.outlook.de
    55 Système de messagerie tiersThird-party email system Non courantNot common Incluez : <domain name>include:<domain name>
    est le nom de domaine du système de messagerie tiers.Where domain name is the domain name of the third party email system.
    66 On-premises mail system.On-premises mail system. For example, Exchange Online Protection plus another mail systemFor example, Exchange Online Protection plus another mail system Non courantNot common Utilisez l’un des éléments suivants pour chaque système de messagerie supplémentaire :Use one of these for each additional mail system:
    IP4 : <IP address>ip4:<IP address>
    ip6 : <IP address>ip6:<IP address>
    Incluez : <domain name>include:<domain name>
    Où la valeur de l’élément <IP address> est l’adresse IP de l’autre système de messagerie et <domain name> correspond au nom de domaine de l’autre système de messagerie qui envoie un message au nom de votre domaine.Where the value for <IP address> is the IP address of the other mail system and <domain name> is the domain name of the other mail system that sends mail on behalf of your domain.
    77 Un système de messagerie (obligatoire)Any email system (required) Common.Common. All SPF TXT records end with this valueAll SPF TXT records end with this value <enforcement rule>
    This can be one of several values.This can be one of several values. We recommend that you use -all.We recommend that you use -all.
  2. Si vous ne l’avez pas encore fait, créez votre enregistrement TXT SPF à l’aide de la syntaxe du tableau :If you haven't already done so, form your SPF TXT record by using the syntax from the table:

    Par exemple, si vous êtes entièrement hébergé par Office 365, ce qui signifie que vous n’avez aucun serveur de messagerie local, votre enregistrement TXT SPF inclut les lignes 1, 2 et 7 et se présente comme suit :For example, if you are fully-hosted in Office 365, that is, you have no on-premises mail servers, your SPF TXT record would include rows 1, 2, and 7 and would look like this:

    v=spf1 include:spf.protection.outlook.com -all

    Il s’agit de l’enregistrement TXT SPF le plus courant.This is the most common SPF TXT record. Cet enregistrement fonctionne pratiquement dans tous les cas, peu importe que votre centre de données Microsoft se trouve aux États-Unis, en Europe (y compris en Allemagne) ou dans une autre région.This record works for just about everyone, regardless of whether your Microsoft datacenter is located in the United States, or in Europe (including Germany), or in another location.

    However, if you have purchased Office 365 Germany, part of Microsoft Cloud Germany, you should use the include statement from line 4 instead of line 2.However, if you have purchased Office 365 Germany, part of Microsoft Cloud Germany, you should use the include statement from line 4 instead of line 2. For example, if you are fully-hosted in Office 365 Germany, that is, you have no on-premises mail servers, your SPF TXT record would include rows 1, 4, and 7 and would look like this:For example, if you are fully-hosted in Office 365 Germany, that is, you have no on-premises mail servers, your SPF TXT record would include rows 1, 4, and 7 and would look like this:

    v=spf1 include:spf.protection.outlook.de -all

    Si vous avez déjà effectué un déploiement dans Office 365, que vous avez configuré les enregistrements TXT SPF de votre domaine personnalisé et que vous effectuez une migration vers Office 365 Germany, vous devez mettre à jour votre enregistrement TXT SPF.If you're already deployed in Office 365 and have set up your SPF TXT records for your custom domain, and you're migrating to Office 365 Germany, you need to update your SPF TXT record. Pour ce faire, remplacez include:spf.protection.outlook.com par include.spf.protection.outlook.de.To do this, change include:spf.protection.outlook.com to include:spf.protection.outlook.de.

  3. Une fois que vous avez formulé votre enregistrement TXT SPF, vous devez mettre à jour l'enregistrement dans le système DNS.Once you have formed your SPF TXT record, you need to update the record in DNS. Vous ne pouvez avoir qu'un seul enregistrement TXT SPF pour un domaine.You can only have one SPF TXT record for a domain. Si un enregistrement TXT SPF existe, au lieu d'ajouter un nouvel enregistrement, vous devez mettre à jour l'enregistrement existant.If an SPF TXT record exists, instead of adding a new record, you need to update the existing record. Accédez à Créer des enregistrements DNS pour Office 365, puis cliquez sur le lien correspondant à votre hôte DNS.Go to Create DNS records for Office 365, and then click the link for your DNS host.

  4. Testez votre enregistrement TXT SPF.Test your SPF TXT record.

En savoir plus sur SPFMore information about SPF

Pour obtenir des exemples avancés, des informations plus détaillées sur la syntaxe SPF prise en charge, l’usurpation, la résolution des problèmes et la façon dont Office 365 prend en charge SPF, voir la section Fonctionnement de SPF pour éviter l’usurpation et le hameçonnage dans Office 365.For advanced examples, a more detailed discussion about supported SPF syntax, spoofing, troubleshooting, and how Office 365 supports SPF, see How SPF works to prevent spoofing and phishing in Office 365.

Étapes suivantes : après avoir configuré SPF pour Office 365Next steps: After you set up SPF for Office 365

Having trouble with your SPF TXT record?Having trouble with your SPF TXT record? Read Troubleshooting: Best practices for SPF in Office 365.Read Troubleshooting: Best practices for SPF in Office 365.

SPF is designed to help prevent spoofing, but there are spoofing techniques that SPF cannot protect against.SPF is designed to help prevent spoofing, but there are spoofing techniques that SPF cannot protect against. In order to protect against these, once you have set up SPF, you should also configure DKIM and DMARC for Office 365.In order to protect against these, once you have set up SPF, you should also configure DKIM and DMARC for Office 365. To get started, see Use DKIM to validate outbound email sent from your custom domain in Office 365.To get started, see Use DKIM to validate outbound email sent from your custom domain in Office 365. Next, see Use DMARC to validate email in Office 365.Next, see Use DMARC to validate email in Office 365.