Fix email delivery issues by forcing IPv4
Google and other email services sometimes block messages sent from IPv6 addresses. Sending mail over IPv4 instead is often an easy solution.
Many email providers, including Gmail, have stricter spam filtering for IPv6 addresses:
If you're using Postfix, forcing outbound email over IPv4 is simple:
Open the Postfix configuration file:
nano /etc/postfix/main.cfLook for the line:
inet_protocols = allReplace all with ipv4:
inet_protocols = ipv4# For systemd (most modern systems)
systemctl restart postfix
# For SysV init
service postfix restartThat's It!
Postfix will now send all outbound email over IPv4 instead of IPv6. This simple change often resolves delivery issues with Gmail and other providers.
Confirm Postfix is using IPv4:
# Check Postfix configuration
postconf inet_protocols
# Should output: inet_protocols = ipv4
# Send a test email
echo "Test email" | mail -s "Test" your@email.comMake sure your IPv4 address has proper reverse DNS:
See our reverse DNS guide for instructions.
SPF tells receiving servers which IPs can send email for your domain:
yourdomain.com. IN TXT "v=spf1 ip4:YOUR.IP.ADDRESS.HERE ~all"DKIM adds a digital signature to your emails:
DMARC builds on SPF and DKIM:
_dmarc.yourdomain.com. IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com"If email is still rejected after forcing IPv4:
Use these tools to check blacklist status:
Send test emails to these services:
For Exim, add to configuration:
disable_ipv6 = trueFor Sendmail, add to sendmail.mc:
DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp')
DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission')Not Just an IPv6 Problem
While forcing IPv4 often helps, proper email configuration (rDNS, SPF, DKIM, DMARC) is essential regardless of whether you use IPv4 or IPv6. Don't skip these important steps.
IPv6 email delivery can work well when:
However, for new servers or those experiencing issues, IPv4 is the safer choice until IPv6 adoption improves among email providers.
If you're still experiencing email delivery problems after forcing IPv4, contact our support team. We can help review your mail server configuration and identify any remaining issues.