Hi @easyfilezboy,
Firstly, I’ll recommend using port 465 for sending out messages rather than 25. Port 25 is considered an unsecured port and more often than not providers block emails from it.
Another possibility is the IP of the Droplet is considered as a threat due to some reason.
I do believe messages are being sent but just are always deferred by the host. I’ll recommend using an e-mail checker to see what score your E-mails rank up to. The link is here - https://www.mail-tester.com/. The way it works is you send a message to the given e-mail account and check the score of your message. It will provide you with a scale from 1 to 10 and notify you about any issues you might need to fix.
Try it out and see if after making a 10/10 score on the tester the messages will still be marked as spam.
One other thing, you know content does matter and it’s possibly Gmail are marking your messages based on it.
Additionally, if you do wish to continue using port 25 or port 465, make sure to actually allow those ports to have outgoing traffic in your Firewall.
If you are using UFW
sudo ufw allow 25/tcp
sudo ufw allow 465/tcp
sudo ufw reload
If you are using plain IPtables use:
iptables -A INPUT -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -p tcp --dport 465 -j ACCEPT
Now to allow access to incoming connections:
Allow All Incoming SMTP
To allow your server to respond to SMTP connections, port 25, run these commands:
sudo iptables -A INPUT -p tcp --dport 25 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -p tcp --sport 25 -m conntrack --ctstate ESTABLISHED -j ACCEPT
The second command, which allows the outgoing traffic of established SMTP connections, is only necessary if the OUTPUT policy is not set to ACCEPT.
Regards,
KDSys