I am using Sendmail to handle emails for my domain, which has properly configured SPF records. When I send emails to external addresses, everything works correctly and the SPF check passes without any issues. However, when I receive emails in the Gmail client, fetched via POP3, Gmail marks the email from our domain as SPAM because failed SPF check.
The sender connects to our Sendmail server from an external IP using authentication and port 587. I believe the issue arises because the only IP Gmail sees is the sender's client IP, which is not included in our SPF records, causing Gmail to flag the email as spam due to the failed SPF check.
Here's an obfuscated example of one of the failing headers:
Received: from DESKTOPXXXXXXX (134.red-xx-xx-xx.dynamicip.rima-tde.net [xx.xx.xx.xx])
(authenticated bits=0)
by srv104.example.com (8.15.2/8.15.2/Debian-10) with ESMTPSA id 34AAg2ii031999
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
for <[email protected]>; Wed, 10 May 2023 12:42:05 +0200
From: "John Doe" <[email protected]>
To: "Alex Doe" <[email protected]>
How can I prevent Gmail from marking these emails as spam due to failed SPF checks? Is there a way to ensure that the correct IP is included in the SPF validation process, or is there another solution I should consider?