I discovered that no matter how you configure aaPanel (disable IPv6, point reverse DNS records, open port 25, standard records), Ubuntu will not work effectively and will definitely end up in spam when sending to Gmail. After I switched to Debian 11 and performed the same actions in aaPanel, such as:
- Request the service provider to open port 25.
- Point the Reverse IP of the VPS server to the hostname.
- Install aaPanel with LAMP model (nginx, mysql, etc.).
- Download Redis ( 7.0 ) -> set a random password.
- Add hostname and request Let's Encrypt SSL.
- Download Mail Server Plugin -> Configure SSL in Postfix
smtpd_tls_cert_file = /www/server/panel/vhost/ssl/**hostname-for-you**/fullchain.pem
smtpd_tls_key_file = /www/server/panel/vhost/ssl/**hostname-for-you**/privkey.pem
Don't forget to replace hostname-for-you with your hostname.
- Add the domain and the records as usual, and that's it.
This is a temporary measure to help prevent your email from going directly to the spam folder in Gmail.
At the same time, I hope the aaPanel team can promptly review and fix a very serious issue where emails sent on Ubuntu go to the spam folder (starting from version 7.0.22).