How to get Office 365 to accept mails from your homepage (contact form)

Recently, a customer had his homepage redesigned without my knowledge, in the belief that this does not require consultation and interaction with me.

Unfortunately they didn't think about the dependency to their mail system, whose migration to Office 365 or Exchange Online was done by me.

Anyway, they had a problem where mails sent from a contact form on their website did not arrive in their mailbox or were classified as spam and ended up as junk in their spam folder.

Following are the steps I have taken to solve the problem:

  • Modifying the SPF record in the DNS management panel

Therefore I added the IP address of the mail system used by the website. The resulting SPD entry looks something like this.

v=spf1 ip4:<xxx.xxx.xxx.xxx> include:spf.protection.outlook.com -all
  • Verifying that the receiving e-mail address uses the default domain included in Office 365 (if this is not possible, there is still the alternative to use the address ".onmicrosoft.com" provided by Microsoft)
  • Creating a transport rule that reduces the spam confidence level of mails sent from the website
New-TransportRule -Name "<UniqueName>" [-SubjectOrBodyMatchesPatterns "<RegEx1>","<RegEx2>"...] [-SubjectOrBodyContainsWords "<WordOrPrhase1>","<WordOrPhrase2>"...] -SetSCL -1

Mails that meet these criteria are now ignored by the spam filter.

After completion of all these activities, the mails could be received again from the website.

At first you think that these tasks can be done quite quickly. But when you are first completely unaware of how to solve the problem, it can take hours...

References:

SPF record / contact form on website
Hi all,recently moved a client to O365.Mails were previously hosten on some antique dell server running multiple virtual linux servers (i think the e-mail was exim?), no backup,...
Set up SPF in Office 365 to help prevent spoofing - 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.
Mail flow rules (transport rules) in Exchange Online
Learn about mail flow rules in Exchange Online.
Use mail flow rules to filter bulk email in Office 365 - Office 365
Admins can learn how to use mail flow rules in Exchange Online Protection for bulk email filtering.