A user is having trouble receiving admin registration emails for a Discourse forum hosted on Digital Ocean, using SendGrid as SMTP and Netlify for DNS. Despite multiple configuration attempts with different ports (25, 587, 2525) and username/password combinations (including API keys), they receive a “535 Authentication failed” error. The issue is narrowed down to authentication, with suggestions that the problem might be with the SendGrid API key or password, not outbound SMTP blocking by Digital Ocean. The user confirms connectivity to SendGrid via openssl from their Mac and VPS, but the authentication fails. The community suggests regenerating the API key, ensuring the app.yml changes are applied by restarting the container (e.g., with ./launcher destroy app), and testing the API key independently. The user is awaiting a response from Digital Ocean support regarding outbound SMTP, but the consensus is that the issue is likely not with the network but with the credentials. erickimme is investigating further, with the possibility of resolving the issue by resetting the API key and ensuring proper container restarts.
I tried the configurations below in nano containers/app.yml
DISCOURSE_HOSTNAME: ‘discourse.myblog.com’
DISCOURSE_DEVELOPER_EMAILS: ‘adminEmail@gmail.com’
AFAIK if you want to use an API key you need to use the username ‘apikey’ with the associated password. I can’t see anything on whether it’s case sensitive, but better to be safe.
You might want to reach out to DigitalOcean support, they’ve been known to block outbound SMTP to third party services on new accounts. Can you telnet to that port from the host?
I think that there might be an issue with port being Filtered State
PORT STATE SERVICE
25/tcp filtered smtp
587/tcp filtered submission
2525/tcp filtered ms-v-worlds
Here is the message coming from Digital Ocean
Check whether you have opened Port-25 in the firewall. You can check with following command , nmap -p 25,465,587 “your Droplet’s IP address”
Sample nmap command:
nmap -p 25,465,587 142.93.189.227
Starting Nmap 7.70 ( [https://nmap.org](https://nmap.org/) ) at 2019-10-08 11:10 IST
Nmap scan report for [unms.adastratechnology.com](http://unms.adastratechnology.com/) (142.93.189.227)
Host is up (0.56s latency).
PORT STATE SERVICE
25/tcp closed smtp
465/tcp closed smtps
587/tcp closed submission
Here is the message from Digital ocean:
This will give you an idea of what is the current status of PORT 25. If it is in either Filtered state or closed state, you can open Cloud Firewall for PORT 25.
Here is our guide to common iptables commands: https://www.digitalocean.com/community/tutorials/iptables-essentials-common-firewall-rules-and-commands#service-mail
Ok, so if you repeat that from droplet via SSH does it connect?
I’ve just checked from one of my droplets in DO and it behaves the same as port 587 is open.
If I was correct earlier, the connection should fail. If it fails then you’re waiting on the right thing - better to know for sure than to wait only to find the issue resided elsewhere!