Improve deliverability to Google mail users (Emails to gmail only over IPv4)

Discussion in 'Tips/Tricks/Mods' started by Th0m, Feb 11, 2021.

Thread Status:
Not open for further replies.
  1. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    I had some problems with deliverability to gmail and G-Suite email addresses for a while. It turned out that disabling IPv6 for sending to Google's mailservers fixed this problem (which is weird, because the address wasn't blacklisted and a PTR record was set up). Usually, I would not tell you to disable IPv6. But with this trick, you will only disable it for mail to google, not for others.

    Open the master.cf:
    Code:
    nano /etc/postfix/master.cf
    Add this at the end:
    Code:
    smtp-ipv4     unix  -       -       -       -       -       smtp
     -o inet_protocols=ipv4
    Now open the main.cf:
    Code:
    nano /etc/postfix/main.cf
    Add
    Code:
    hash:/etc/postfix/transport
    to the setting
    Code:
    transport_maps =
    The line looks like this for me:
    Code:
    transport_maps = hash:/etc/postfix/transport, hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    Now open the transport file:
    Code:
    nano /etc/postfix/transport
    And add this:
    Code:
    gmail.com smtp-ipv4:
    google.com smtp-ipv4:
    *.google.com smtp-ipv4:
    googlemail.com smtp-ipv4:
    *.googlemail.com smtp-ipv4:
    Run the following commands to apply the changes:
    Code:
    postmap /etc/postfix/transport
    systemctl restart postfix
     
    hadizeid and ahrasis like this.
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Good tips. That're what I applied as well.
     
Thread Status:
Not open for further replies.

Share This Page