Search code examples
phpemailgmaildkimdmarc

PHP Mail to Googlemail. SPF only


i want to send mails via php to googlemail. I created a SPF txt dns record. Do i still need DKIM & DMARC?

No mails reach googlemail at the moment. I checked if the spf was active with https://www.nslookup.io/

Is it not gonna work without DKIM & DMARC? I don't need/want a company account in google.



Solution

  • Google has a lot of published guidance on this topic:

    Requirements for all senders

    Starting February 1, 2024, all email senders who send email to Gmail accounts must meet the requirements in this section.

    Important: If you send more than 5,000 messages per day to Gmail accounts, follow the Requirements for sending 5,000 or more messages per day.

    • Set up SPF or DKIM email authentication for your sending domains.
    • Ensure that sending domains or IPs have valid forward and reverse DNS records, also referred to as PTR records.
    • Use a TLS connection for transmitting email.
    • Keep spam rates reported in Postmaster Tools below 0.3%.
    • Format messages according to the Internet Message Format standard, RFC 5322.
    • Don’t impersonate Gmail From: headers. Gmail will begin using a DMARC quarantine enforcement policy, and impersonating Gmail From: headers might impact your email delivery.
    • If you manage a forwarding service, including mailing lists or inbound gateways, add ARC headers to outgoing email. ARC headers indicate the message was forwarded and identify you as the forwarder. Mailing list senders should also add a List-id: header, which specifies the mailing list, to outgoing messages.

    Requirements for sending 5,000 or more messages per day

    Starting February 1, 2024, email senders who send more than 5,000 messages per day to Gmail accounts must meet the requirements in this section.

    • Set up SPF and DKIM email authentication for your domain.
    • Ensure that sending domains or IPs have valid forward and reverse DNS records, also referred to as PTR records.
    • Use a TLS connection for transmitting email.
    • Keep spam rates reported in Postmaster Tools below 0.30%. Learn more about spam rates
    • Format messages according to the Internet Message Format standard, RFC 5322.
    • Don’t impersonate Gmail From: headers. Gmail will begin using a DMARC quarantine enforcement policy, and impersonating Gmail From: headers might impact your email delivery.
    • If you manage a forwarding service, including mailing lists or inbound gateways, add ARC headers to outgoing email. ARC headers indicate the message was forwarded and identify you as the forwarder. Mailing list senders should also add a List-id: header, which specifies the mailing list, to outgoing messages.
    • Set up DMARC email authentication for your sending domain. Your DMARC enforcement policy can be set to none.
    • For direct mail, the domain in the sender's From: header must be aligned with either the SPF domain or the DKIM domain. This is required to pass DMARC alignment.
    • Marketing messages and subscribed messages must support one-click unsubscribe, and include a clearly visible unsubscribe link in the message body.

    Additionally:

    To verify messages are authenticated, Google performs checks on messages sent to Gmail accounts. To improve email delivery, we recommend that you always set up SPF, DKIM, and DMARC for your domains. Make sure you're meeting the minimum authentication requirements described on this page. Messages that aren’t authenticated with these methods might be marked as spam or rejected with a 5.7.26 error.

    If you use an email service provider, verify that they authenticate your domain’s email with SPF and DKIM.

    Source (and more detail on other configuration requirements): https://support.google.com/a/answer/81126?visit_id=638513785227520464-3322085938&rd=1 (as at 2024-05-15)