I am setting up a mail server but encountering issues with emails sent from Outlook. When I send an email from a Gmail account to my custom address (e.g., [email protected]), it works without any errors. However, sending an email from an Outlook account results in the following error:
This error occurs when SPF (Sender Policy Framework) validation of the recipient's domain failed. If you are the recipient's mail administrator, check with your domain registrar to ensure that the SPF records associated with your domain are correctly configured. Office 365 supports only one SPF record (i.e., a TXT record that defines SPF) for your domain. Include the following domain name: spf.protection.outlook.com. If you have a hybrid configuration (i.e., if some of your mailboxes are in the cloud and others locally) or if you're a standalone Exchange Online Protection customer, add the outgoing IP address of your local servers to the TXT record.
To resolve this, I updated my SPF record as follows (assuming 123.123.123.124 is my public IP address):
v=spf1 include:spf.protection.outlook.com a mx ip4:123.123.123.124 -all
Despite this change, I am still receiving the same error. Could someone please help me troubleshoot this issue?