Bonjour,
Comme le titre l'indique, mes mails envoyés par WordPress arrivent dans les spams.
Configuration
J'ai acheté chez OVH un nom de domaine et un hébergement pro (pro2014, avec un plan mail MXPLAN 100 hosting inclus).
J'ai migré les DNS chez CloudFlare.
J'ai choisi Office 365 pour les mails persos et j'ai mis à jour les DNS en conséquence.
Mon hébergement OVH héberge un site WordPress.
Problème
Les visiteurs du site WordPress peuvent demander à recevoir un fichier, que je leur envoie par email avec le plugin Contact Form 7 (utilisant la fonction mail de PHP par défaut).
Cependant, cet email arrive dans les spams, chez Hotmail par exemple.
Investigation
J'ai examiné le header du mail :
Authentication-Results:
spf=pass (sender IP is 46.105.63.226)
smtp.mailfrom=mail-out.cluster030.hosting.ovh.net;
dkim=none (message not signed)
header.d=none;
dmarc=fail
action=none
header.from=my-company.com;
compauth=fail reason=601
Received-SPF:
Pass (protection.outlook.com: domain of mail-out.cluster030.hosting.ovh.net designates 46.105.63.226 as permitted sender)
receiver=protection.outlook.com;
client-ip=46.105.63.226;
helo=7.mo573.mail-out.ovh.net;
Received:
from 7.mo573.mail-out.ovh.net (46.105.63.226)
by VI1EUR06FT050.mail.protection.outlook.com (10.13.7.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.15 via Frontend Transport; Fri, 18 Feb 2022 09:56:46 +0000
…
To: client@hotmail.com
Subject: Flyers
Date: Fri, 18 Feb 2022 09:56:44 +0000
From: My Company
X-Mailer: PHPMailer 6.5.3 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: multipart/mixed;
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrkedtgddtkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhepvffufffhkffogggtsehmtderreehtdejnecuhfhrohhmpefuohhpihgrugcuoehinhhfohesshhophhirggurdgtohhmqeenucggtffrrghtthgvrhhnpeeugeekgeeiieevkedtvdelgeeuffeftdevhefhgffggffguefffefhheefvdegheenucffohhmrghinhepshhophhirggurdgtohhmpdhgohhoghhlvgdrsggvpdhsohhpihgrugdrsggvnecukfhppedtrddtrddtrddtpdehuddrudejkedrudegiedrudelleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepughirhgvtghtohhruddruggvrhhprdhmrghilhdqohhuthdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepsghouhhntggvqdhiugepffdtgeelpegffedvieekkedrtghluhhsthgvrhdtfedtrdhovhhhrdhnvghtpeduieeghedujeekvddthedrheekqdftiefgpfdtsehmrghilhdqohhuthdrtghluhhsthgvrhdtfedtrdhhohhsthhinhhgrdhovhhhrdhnvghtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepthhhohhmrghsrdhvrghssghinhguvghrsehsohhpihgrugdrtghomh
Return-Path: bounce-id=D049=U32688.cluster030.ovh.net=1645178205.58-R6EN0@mail-out.cluster030.hosting.ovh.net
X-MS-Exchange-Organization-SCL: 5
X-Forefront-Antispam-Report:
CIP:46.105.63.226;CTRY:FR;LANG:en;SCL:5;SRV:;IPV:NLI;SFV:SPM;H:7.mo573.mail-out.ovh.net;PTR:7.mo573.mail-out.ovh.net;CAT:SPOOF;SFS:(13230001)(1096003)(3480700007)(15974865002)(336012)(8676002)(5660300002)(42186006)(33964004)(6636002)(356005)(7116003)(58800400005)(28085005)(22186003)(6916009)(166002)(83170400001)(42882007)(26005)(19627405001)(7596003)(6266002)(83380400001)(44190200060)(43540500002)(39280500004)(15398625002);DIR:INB;
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Mailbox-Delivery:
ucf:0;jmr:0;auth:0;dest:J;OFR:SpamFilterAuthJ;ENG:(910001)(944506458)(944626604)(920097)(930097)(3100021);RF:JunkEmail;
J'ai remarqué deux choses :
1) L'email est bien détecté comme spam et spoofing :
- `X-MS-Exchange-Organization-SCL: 5`
- `SFV:SPM`
- `CAT:SPOOF`
2) L'adresse de retour `Return-Path` et une adresse OVH.
Cette adresse est une copie de l'adresse `FROM` de l'enveloppe du mail, comme expliqué sur ce site :
> After recipient mailserver delivers the email to the recipient's mailbox (recipient is always email address in envelope header) is email envelope discarded with one important exception. Mostly, recipient mailserver writes sender email address from email envelope to the email header as Return-Path.
Voici le résultat Mail Tester :
SpamAssassin détecte quand même que l'adresse d'expédition de l'enveloppe et de l'en-tête ne sont pas identiques.
Il n'y a pas de DKIM chez OVH (mentionné ici).
La vérification SPF se fait chez OVH :
* SPF contrôle l'adresse d'envoi dans l'enveloppe et non dans l' en-tête du mail.
* Donc, ce sont les DNS de OVH qui sont consultés pour l'entrée SPF.
* Toute modification des DNS de mon domaine n'a aucun impact sur la vérification SPF.
* Le SPF est donc à `PASS`.
Ma conclusion
Le SPF est à `PASS` mais SpamAssassin (ou équivalent chez Hotmail par exemple) détecte la différence d'adresses `FROM` dans l'enveloppe et dans l' en-tête du mail.
Le mail est donc classé en spam / spoofing.
C'est le seul problème que j'ai trouvé qui pourrait expliquer que mes emails arrivent dans les spams.
Solution ?
Mon analyse est-elle correcte / complète ?
Comment pourrais-je résoudre ce problème ?
Modifier le `FROM` de l'enveloppe ? Pas possible d'après ce message et celui-ci.
Merci d'avance pour vos réponses !



