Back to Legacy KVM Documentation

    Sending Email over IPv4 with Postfix

    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.

    The Problem

    Many email providers, including Gmail, have stricter spam filtering for IPv6 addresses:

    • Less IPv6 Reputation Data: Fewer email servers use IPv6
    • Easier to Get Blacklisted: New IPv6 addresses lack history
    • Stricter Filtering: Some providers default to blocking IPv6
    • Inconsistent Delivery: Some recipients get mail, others don't

    Quick Fix: Force IPv4 in Postfix

    If you're using Postfix, forcing outbound email over IPv4 is simple:

    1Edit Postfix Configuration

    Open the Postfix configuration file:

    nano /etc/postfix/main.cf

    2Find and Modify inet_protocols

    Look for the line:

    inet_protocols = all

    Replace all with ipv4:

    inet_protocols = ipv4

    3Restart Postfix

    # For systemd (most modern systems)
    systemctl restart postfix
    
    # For SysV init
    service postfix restart

    That'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.

    Verify the Change

    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.com

    Additional Email Deliverability Tips

    1. Set Up Reverse DNS (rDNS)

    Make sure your IPv4 address has proper reverse DNS:

    • rDNS should match your mail server hostname
    • Essential for email deliverability
    • Set via SolusVM or Client Area

    See our reverse DNS guide for instructions.

    2. Configure SPF Records

    SPF tells receiving servers which IPs can send email for your domain:

    yourdomain.com. IN TXT "v=spf1 ip4:YOUR.IP.ADDRESS.HERE ~all"

    3. Set Up DKIM

    DKIM adds a digital signature to your emails:

    • Proves emails actually came from your server
    • Significantly improves deliverability
    • Required by many email providers

    4. Configure DMARC

    DMARC builds on SPF and DKIM:

    _dmarc.yourdomain.com. IN TXT "v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com"

    Troubleshooting Email Issues

    Still Getting Rejected

    If email is still rejected after forcing IPv4:

    • Check Blacklists: Your IP might be listed on spam blacklists
    • Verify rDNS: Must be set and match your hostname
    • Check SPF/DKIM: Ensure they're configured correctly
    • Review Logs: Check /var/log/mail.log for errors

    Check if Your IP is Blacklisted

    Use these tools to check blacklist status:

    Test Your Email Configuration

    Send test emails to these services:

    Other Mail Servers

    Exim

    For Exim, add to configuration:

    disable_ipv6 = true

    Sendmail

    For 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.

    When IPv6 Email Works

    IPv6 email delivery can work well when:

    • You have proper IPv6 reverse DNS configured
    • Your IPv6 address has built up positive reputation
    • SPF includes your IPv6 address
    • DKIM and DMARC are properly configured
    • You're sending from established domains

    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.