Avoid Your Email Going To Gmail Spam Folder

First of all im sorry for my broken english and im very new in webhost but i love CyberPanel.

How to avoid your email going to client/user Gmail spam folder? I have troubleshot this and find a workaround for almost 1 week. I have read somewhere if the server have IPv6 and dont enable it Gmail will mark sent email as SPAM.

Please note, before im doing from step 2 till end i already get Pass mark for SPF, DKIM and DMARC on Gmail ‘Original Message’

Here is what im doing;

  1. Follow all these steps Achieve 10/10 Email score with CyberPanel!

  2. You also need IPv6 and Reverse DNS (rDNS) and point to your domain same like IPv4, make an AAAA record for your mail.domain.tld. After DNS propagation is complete check it using MXtoolbox (MX Lookup)

  3. If you are using CloudFlare like me the DKIM you get from CyberPanel DKIM Manager should look like this:

    "v=DKIM1; h=sha256; k=rsa; "
    	  "p=PS9v22Gnk3XAx3sRhVyRbL8jyWaP6QnTPw7cWpqDtPnbdzz2SCNpppnsJ7tCK8rFTYnnd4LYQnbxtE3NWCvKSHLax6CMvGsF3vLCeezhJeCrvydh8rn6yVt5YVJcDVPyT9CgBFyxnbnG7CFwpNzHysq4hL249Uu8GnVXDL2nKGy7TkewngsrLpN6W4tfVH5qzKrn6PVb3LKR2dVt5TM9cwUvgn9QMskWyzwTgBc4KT8zsfNbEKNrNYVNdD"
    	  "QAUsM8uqn8ACgFzmcEgEwTu2E4JHJDUaJwThpyXp7RQMEnzgRUEXnXhZVYVcqNcDz2BCuwDYFQxbbzrKswt3yeKPQW3xnbMR5MPzv7ntbcAGDAVxk3RXt68GnQQcPvycqpZYM23HDwfeCA"
    

    You need to remove all quotes (") and spaces after p=, should look like this:

    v=DKIM1; h=sha256; k=rsa; p=PS9v22Gnk3XAx3sRhVyRbL8jyWaP6QnTPw7cWpqDtPnbdzz2SCNpppnsJ7tCK8rFTYnnd4LYQnbxtE3NWCvKSHLax6CMvGsF3vLCeezhJeCrvydh8rn6yVt5YVJcDVPyT9CgBFyxnbnG7CFwpNzHysq4hL249Uu8GnVXDL2nKGy7TkewngsrLpN6W4tfVH5qzKrn6PVb3LKR2dVt5TM9cwUvgn9QMskWyzwTgBc4KT8zsfNbEKNrNYVNdDQAUsM8uqn8ACgFzmcEgEwTu2E4JHJDUaJwThpyXp7RQMEnzgRUEXnXhZVYVcqNcDz2BCuwDYFQxbbzrKswt3yeKPQW3xnbMR5MPzv7ntbcAGDAVxk3RXt68GnQQcPvycqpZYM23HDwfeCA
    

    After that test your DKIM on DKIM Record Checker

  4. Make sure your server IPv6 is setup properly and can ping google

    ping6 google.com
    

    Should output something similar to this if you’re connecting to IPv6:

    PING google.com(par21s20-in-x0e.1e100.net (xxxx:xxxx:xxxx:xxxx::xxxx)) 56 data bytes
    64 bytes from par21s20-in-x0e.1e100.net (xxxx:xxxx:xxxx:xxxx::xxxx): icmp_seq=1 ttl=107 time=11.9 ms
    64 bytes from par21s20-in-x0e.1e100.net (xxxx:xxxx:xxxx:xxxx::xxxx): icmp_seq=2 ttl=107 time=8.34 ms
    64 bytes from par21s20-in-x0e.1e100.net (xxxx:xxxx:xxxx:xxxx::xxxx): icmp_seq=3 ttl=107 time=8.43 ms
    64 bytes from par21s20-in-x0e.1e100.net (xxxx:xxxx:xxxx:xxxx::xxxx): icmp_seq=4 ttl=107 time=8.43 ms
    
  5. Edit your TXT record v=spf1 to use IPv6

    v=spf1 ip6:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx ip4:xx.xx.xxx.xxx ~all
    

    X should be your IP

  6. Edit postfix main.cf

    nano /etc/postfix/main.cf
    

    Put this after inet_protocols = all

    smtp_address_preference = ipv6
    

    If you get SMTP Reverse DNS Mismatch while test it on MXToolbox change:

    myhostname = yourreversednsdomain.tld
    

    After save and exit your nano dont forget to reload postfix

    systemctl reload postfix
    

Try sent email to your Gmail account.

Other tools i use to check:
checktls.com

Thank you.

This is related to email and think in right now.
Thanks for sharing

haruskah ? atau hanya untuk ipv6 ?
why we must edit main.cf ?
or only if we use ipv6 ?

Did your hosting provider / server have IPv6?

I have read somewhere if the server have IPv6 and dont enable it Gmail will mark sent email as SPAM.

im not use ipv6

and… my email not marked as spam :slight_smile:

Yeah this helped me thank you!

Thanks for sharing