If local logins are disabled

Hi,

starting a forum, completely new to discourse, hosted on DO, for some reason has issue with smtp or port issue. Now, wanted to find out if you have gone with google logins or social logins and no issue if local sign ups/logins is not in your forum

SMTP is blocked on DO by default. If you want to use mail, you’ll need to find a proxy somewhere. Lots of people have said that Mailgun is what works good for Discourse on the cloud but that is not something I have experience with.

This might be what you’re after:

Yes, you can use social login (Discord, Google, …) or Discourse ID (no setup) without SMTP. You’ll lose digests and email notifications, but if your goal is just a community it will work fine even with lower engagement (digests are designed to help retention).

great, i’ve tried sendgrid, mailgun & resend. have same issue, could be port issue, tried all ports. For now I want to see if social logins are fine, and get rid of local logins.

You can disable the enable local logins site setting if you wish to remove local logins. You can also try Discourse ID.

hello @abeen welcome :wave:
i’ve done numerous self-hosted installs with Mailgun and Resend on Digitalocean (and other cloud servers) - can you give more information on what issue you are encountering? are you editing your app.yml with the appropriate settings? i assume this is a standard install?

for Resend:

  DISCOURSE_HOSTNAME: <forum.yourforum.etc>
  DISCOURSE_DEVELOPER_EMAILS: <your-email@emailaddress.com>
  DISCOURSE_SMTP_ADDRESS: smtp.resend.com
  DISCOURSE_SMTP_PORT: 2525
  DISCOURSE_SMTP_USER_NAME: resend
  DISCOURSE_SMTP_PASSWORD: "xxxx"

for Mailgun

  DISCOURSE_HOSTNAME: <forum.yourforum.etc>
  DISCOURSE_DEVELOPER_EMAILS: <your-email@emailaddress.com>
  DISCOURSE_SMTP_ADDRESS: smtp.mailgun.org
  DISCOURSE_SMTP_PORT: 2525
  DISCOURSE_SMTP_USER_NAME: <your.mailgun.acccount.email>
  DISCOURSE_SMTP_PASSWORD: "xxxx"

DO says “Please be informed that, in addition to the previously blocked port 25, ports 465 and 587 have been blocked on droplets as of March 6, 2025. This is to make sure that the DigitalOcean servers are not used to send spam emails.”

and I see inside the admin panel
There are 30 email jobs that failed. Check your app.yml and ensure that the mail server settings are correct. See the failed jobs in Sidekiq.

recreated the resend api, changed the port to 587, tried with 2525. Nothing is working for me.

this is my yaml


LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
DISCOURSE_HOSTNAME: dobato.au
DISCOURSE_DEVELOPER_EMAILS: myemail@outlook.com
DISCOURSE_SMTP_ADDRESS: smtp.resend.com
DISCOURSE_SMTP_USER_NAME: resend
DISCOURSE_SMTP_PASSWORD: “re_my password here”
DISCOURSE_SMTP_PORT: 2525
DISCOURSE_SMTP_ENABLE_START_TLS: true
DISCOURSE_NOTIFICATION_EMAIL: noreply@dobato.au
DISCOURSE_SMTP_DOMAIN: dobato.au
  • this is probably the main issue causing you problems: you are using curly quotes. YML files do not like this and usually break. you need to use single or double straight quotes like 'password' or "password"
  • did you do a standard install on a subdomain or is this a root domain install? if the former, it should be something like forum.dobato.au or discourse.dobato.au (check what you have on your nameserver). unless you intended to do a root domain install, this needs fixing. if your forum is on subdomain, then the DISCOURSE_NOTIFICATION_EMAIL: noreply@dobato.au will also need changing.
  • this line is unnecessary, remove it
  • this line is not needed; there is no point forcing the mailer to start STARTTLS - the underlying ruby mailer (ActionMailer) uses enable_starttls_auto: true , meaning it will automatically upgrade the connection to TLS if the server (Resend) supports it. delete this line.

your correct app.yml section should look like this:

DISCOURSE_HOSTNAME: dobato.au # (verify this - it may be incorrect!)
DISCOURSE_DEVELOPER_EMAILS: myemail@outlook.com
DISCOURSE_SMTP_ADDRESS: smtp.resend.com
DISCOURSE_SMTP_USER_NAME: resend
DISCOURSE_SMTP_PASSWORD: "re_actual_api_key_here" # note the straight quotes!
DISCOURSE_SMTP_PORT: 2525
DISCOURSE_NOTIFICATION_EMAIL: noreply@dobato.au

YML files are very strict with syntax and spacing so it is important to retain the formatting of the existing template file (see discourse_docker/samples/standalone.yml at main · discourse/discourse_docker · GitHub)

also, you need to rebuild after you make changes to your app.yml file:

cd /var/discourse
./launcher rebuild app

failed jobs in Sidekiq

we can’t resolve that link since we are not admins of your forum :wink: . however, once you fix the above issues, if you an see the list of failed email jobs in sidekiq, you can click Retry All to instantly flush the queue and send out the backed-up emails.
if you really want to purge them (for example, if they are just hundreds of test emails to yourself and don’t want to get flooded): you can go to that same /sidekiq/retries page and click Delete All instead.

this is all assuming you have the proper records in your domain settings on your name server.

But DigitalOcean has blocked 587, and that’s why 2525 is used.

oh i forgot about DO lol. :woman_facepalming:t2: i moved off them awhile back. in my head i was thinking resend and hetzner. so yea use 2525 (i now recall switching that when i migrated too).
edit: i fixed my post. thanks Jakee

Along with the excellent advice above, running a rake emails:test (see Troubleshoot email on a new Discourse install) to immediately show the error is probably going to help.

my site has crashed now. it is a new site with few members, not sure how to download my custom pages and members. don’t want to use smtp at all.

i’m sorry this is happening to you.

yea your yml file is likely broken. post the whole thing here (without the email addresses and passwords). this really shouldn’t be this difficult to get up and running.

just out of curiosity what size of droplet on Digitalocean are you using?

have you been able to configure if your name server is correctly configured?

Hi,

i have Basic / 1 vCPU / 2 GB RAM / 50 GB Disk

env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
DISCOURSE_HOSTNAME: dobato.au
DISCOURSE_DEVELOPER_EMAILS: ``myemail@outlook.com
DISCOURSE_SMTP_ADDRESS: ``smtp.resend.com
DISCOURSE_SMTP_USER_NAME: resend
DISCOURSE_SMTP_PASSWORD: “re_mypassword”
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_ENABLE_START_TLS: true
DISCOURSE_NOTIFICATION_EMAIL: noreply@dobato.au
DISCOURSE_SMTP_DOMAIN: dobato.au
DISCOURSE_SMTP_AUTHENTICATION: login
DISCOURSE_SMTP_FROM_ADDRESS: noreply@dobato.au
UNICORN_WORKERS: 4

i dont want smtp. Googling issue with some commands shows - Nginx and Unicorn are not running.

please read my previous post here carefully. your yml file is incorrect.

this should work for a non-busy forum. do you have a swap file at all? run free -h at the command line and post the output here. it should look something like this (but smaller numbers):

~# free -h
               total        used        free      shared  buff/cache   available
Mem:           3.7Gi       2.5Gi       324Mi       116Mi       1.2Gi       1.2Gi
Swap:          2.0Gi       366Mi       1.6Gi

curl: (52) Empty reply from server
root@dobato:~# free -h
total used free shared buff/cache available
Mem: 1.9Gi 201Mi 1.2Gi 4.0Mi 507Mi 1.6Gi
Swap: 2.0Gi 0B 2.0Gi

how about discourse on amazon Lightsail, they have Amazon SES smpt email as well.

@abeen Have you switched these to straight quotes?

Try using these instead:

"

i’ve got " ", double quotation mark

I see. It’s possible to host Discourse on Lightsail with SES (some users here do that). Or you could try port 2525 if you haven’t already. But if you want to avoid these port headaches, you could shift to a different host, like Hetzner or Lightsail.

rebuild finishes too quickly with this .. don’t know why?