Mail to Gmail starts bouncing with a 550-5.7.1 error, yet the same server still delivers to other providers, SPF passes when you test it, and nobody touched the mail config. In a lot of these cases nothing is broken in the usual sense. The server started sending over IPv6, from an address with no usable reverse DNS, and Gmail is stricter about that than most receivers. This piece walks through the problem as a post-mortem: what the impact looks like, how to trace it, what to do right away, and what the proper fix is.
Initial impact: only Gmail, and only from one server
The pattern is usually narrow. Messages to gmail.com fail, and so do messages to any domain whose MX records point at Google, which covers every Google Workspace customer. Mail to other providers goes through. Because Google hosts so many business domains, users experience this as "half our mail stopped working," and the first ticket usually says something like "Gmail blocked our server."
The instinct at the support desk is to check blacklists and SPF first. Both tend to come back clean. The server's IPv4 address isn't listed anywhere, the SPF record includes it, and a test from an online checker passes. That clean result is the misleading part. Every check confirmed the IPv4 identity of the server, while the failing connections came from a different address.
Investigation: read the bounce, then the log
The bounce message is more useful than the reputation tools. A Gmail rejection normally includes the IP address that connected to it, in square brackets, and the text explains the reason. For this failure, the wording typically mentions IPv6 sending guidelines, PTR records, or authentication. Google adjusts the exact text over time, so search the bounce for those concepts instead of a fixed phrase.
The first question to settle is whether that bracketed address contains colons. If it looks like 2001:db8::25 and not like 203.0.113.10, the message went out over IPv6, and every IPv4 check you ran is irrelevant to this failure.
Next, confirm it from the server's own mail log. Bounces get forwarded, quoted, and trimmed by the time they reach support, so the log is the reliable record. It also shows whether every Gmail delivery uses IPv6 or only some of them.
# Postfix: find recent bounced deliveries to Google (log path varies by distro)
grep 'status=bounced' /var/log/mail.log | grep -i 'google'
# Exim (cPanel default log path): show full transactions mentioning gmail.com
exigrep 'gmail.com' /var/log/exim_mainlog | tail -n 40
# Which local IPv6 address would the kernel use to reach an IPv6 destination?
# Replace the target with the IPv6 address of the Google MX host from your log.
ip -6 route get 2001:db8:ffff::1
In Postfix, look at the relay= field. In Exim, look at the H= field. Both show the remote host and the address used for the connection. The ip -6 route get output includes a src field. That field is the local address your server presents to Gmail, and it's the one whose reverse DNS matters. On Debian and Ubuntu the log is usually /var/log/mail.log, on RHEL-family systems it's /var/log/maillog, and some minimal images only log to journald. Check where yours goes before you conclude that the log is empty.
The discovery: an IPv6 address nobody set up for mail
Nobody decided to send mail over IPv6. Several sensible defaults lined up instead. At some point the server received a global IPv6 address. The provider may have enabled IPv6 on the VPS, a new image may ship with it on, or the network may assign one through router advertisements. The MTA is usually configured to use all available protocols, which is the common packaged default for Postfix and the normal behavior for Exim. Google's MX hosts publish AAAA records. With IPv6 available on both ends, the MTA tries it, and the connection succeeds. Gmail then evaluates an identity nobody has looked at before.
Gmail checks a few things on that identity. The sending IP should have a PTR record, which is the reverse DNS entry mapping the address back to a hostname. That hostname should resolve forward to the same IP. This two-way match is called forward-confirmed reverse DNS. The message should also authenticate with SPF or DKIM. A freshly assigned IPv6 address usually fails the first test. It often has no PTR at all, or it has a generic one from the provider that doesn't resolve back.
SPF often fails as well. If the record lists the server with ip4: only, the IPv6 address isn't authorized. If the record uses the a mechanism and the hostname happens to have an AAAA record, SPF may pass over IPv6 by accident. Either way, checking SPF against the IPv4 address says nothing about this connection. Test against the address from the log.
# Reverse lookup: does the sending IPv6 address have a PTR? (documentation address shown)
dig -x 2001:db8::25 +short
# Forward-confirm: the PTR hostname should return the same IPv6 address
dig AAAA mail.example.com +short
# Does the domain's SPF record cover IPv6 at all?
dig TXT example.com +short | grep 'v=spf1'
A healthy result shows a hostname from the first command, and the second command returns exactly the address you started with. An empty first result, a generic provider hostname, or a forward lookup that returns nothing or a different address all explain the bounce.
One detail catches people out. The address the MTA sends from isn't always the address you configured. If the interface has several IPv6 addresses, or temporary privacy addresses are enabled, the kernel's source address selection may pick one you never added a PTR for. That's why the src value from the route lookup and the address in the log matter more than what the network config file says.
Temporary mitigation: send to the outside world over IPv4 only
The quickest way to stop the bounces is to make the MTA stop using IPv6 for outbound delivery. Mail returns to the IPv4 path that already has a working PTR and SPF. This is a reasonable stopgap, and for many single-server setups it's a perfectly fine permanent state.
# Postfix option A: prefer IPv4 for outbound SMTP but keep IPv6 available as a fallback
postconf -e 'smtp_address_preference = ipv4'
# Postfix option B: disable IPv6 in Postfix entirely (affects listening too)
postconf -e 'inet_protocols = ipv4'
systemctl restart postfix
# Exim: main configuration option that disables IPv6 use
# disable_ipv6 = true
The two Postfix options differ. A preference setting still lets Postfix fall back to IPv6 if IPv4 fails, and the fallback can hit the same Gmail rejection. Setting inet_protocols = ipv4 is the cleaner stop. A change to inet_protocols needs a full restart, not just a reload. Check your current values with postconf inet_protocols smtp_address_preference before you change anything.
On Exim, disable_ipv6 = true belongs in the main section of the configuration. If the server runs cPanel and WHM, don't edit /etc/exim.conf by hand. The panel generates that file and can overwrite your change. Make the change through WHM's Exim Configuration Manager, usually in the advanced editor, so it survives rebuilds. The exact location depends on your cPanel version.
After the change, retry the deferred queue with postqueue -f on Postfix or exim -qff on Exim. Messages that already hard-bounced with a 5xx code won't be retried, so senders need to resend those. Send a fresh test to a Gmail address and check the log to confirm the connection now uses IPv4.
Architectural fix: give the IPv6 sender a real identity
Forcing IPv4 treats the symptom. If you want the server to stay dual-stack, which gets more reasonable as IPv6-only networks grow, the IPv6 path needs the same setup the IPv4 path got years ago.
Start by choosing one IPv6 address for outbound mail and pinning the MTA to it, so source address selection can't wander. In Postfix that's smtp_bind_address6. In Exim, the interface option on the remote SMTP transport does the same job. Then set a PTR record for that exact address, pointing to a hostname such as mail.example.com, and add a matching AAAA record so the lookup confirms in both directions. Ideally that hostname is also what the server announces in its HELO/EHLO greeting.
The PTR record lives in the reverse zone under ip6.arpa. Usually whoever owns the address block controls that zone, not whoever hosts your domain's DNS. Depending on the provider, that's a field in the VPS control panel or a support request. Check the provider's documentation instead of assuming your DNS host can do it.
Finally, add the address, or the whole prefix if you send from several addresses, to SPF with an ip6: mechanism. Make sure DKIM signing works no matter which protocol the message leaves on. Then remove the IPv4-only override and confirm a Gmail test passes over IPv6, by checking the log and not only the inbox.
The trade-off is simple. An IPv4-only mail server is one identity to maintain. A dual-stack server is two, and the IPv6 one can drift when the provider renumbers or the image changes. Neither choice is wrong, but leaving it to defaults is how this incident happens.
The practical habit: when Gmail rejects mail with 550-5.7.1, look at the bracketed IP in the bounce before you run any reputation check. If it has colons, check the PTR, forward confirmation, and SPF for that specific IPv6 address. Then choose between pinning outbound mail to IPv4 or setting up the IPv6 identity properly. Whichever you choose, write it into the server's config deliberately, so the next IPv6 rollout doesn't make the choice for you.