First register email not sent

Hi,

I just made a fresh install of Discourse.

The first connection asked me to create a login and password for the admin account and was supposed to send me an activation email.

But I didn’t receive this activation email (I checked the spam folder of course) so I called the doctor and send a test message to myself as requested. This email came immediately in my inbox.

I know I can create an admin account from the command line but I’d like to understand what happens because it could be the same for future users who will try to register.

Can you help ?

Regards.

There’s two things that may have gone wrong:

  • the mail wasn’t sent
  • the mail was sent, but wasn’t delivered

Since this is a new instance, it’s easiest to check all outgoing email logs from the rails console:

discourse(prod)> EmailLog.all.pluck(:to_address, :email_type, :created_at, :smtp_transaction_response)

If you see something, you’ll know it was at least handed off to the SMTP server which is where Discourse’s responsibility ends.

If you don’t, then it probably wasn’t sent and you can probably find informative logs by checking the /logs and /sidekiq URL paths after logging in as admin.

We can see that the test message was sent (and indeed I received it) using ./discourse-doctor but there is no record of the registration messages :

discourse(prod)> EmailLog.all.pluck(:to_address, :email_type, :created_at, :smtp_transaction_response)
=> [["user@domain.org", "test_message", 2026-05-13 16:23:41.417177000 UTC +00:00, "250 2.0.0 Ok: queued as 4B4DDB0059A"]]

We find four registration messages (indeed I tried four times to register) in the production.log file. But those registration messages where never received, so my guess is they have never been sent even if there is no error or warning.
We can notice that there is no trace of the test message which has been successfully sent (and received) in those logs.

root@my-vps-app:/var/www/discourse/log# cat production.log | grep user
  Parameters: {"authenticity_token" => "ityyLIdjT7xvdxEd01LjMT08-xxxx", "email" => "user@domain.org", "username" => "admin", "password" => "[FILTERED]", "commit" => "Register"}
  Parameters: {"authenticity_token" => "tnDxYkOOwXYcv59Ez4t8vWPir-xxxx", "email" => "user@domain.org", "username" => "admin", "password" => "[FILTERED]", "commit" => "Register"}
  Parameters: {"authenticity_token" => "bvOwVYHS3N_UELipxVEG3L3LY-xxxx", "email" => "user@domain.org", "username" => "admin", "password" => "[FILTERED]", "commit" => "Register"}
  Parameters: {"authenticity_token" => "oo6GN-n7clGI5F1-uqzsZcadeP-xxxx", "email" => "user@domain.org", "username" => "admin", "password" => "[FILTERED]", "commit" => "Register"}

Other log files are empty :

root@my-vps-app:/var/www/discourse/log# cat production_errors.log 
root@my-vps-app:/var/www/discourse/log# cat sidekiq.log 
root@my-vps-app:/var/www/discourse/log# cat unicorn.stderr.log 
root@my-vps-app:/var/www/discourse/log# cat unicorn.stdout.log 

The docker logs for the discourse app show four messages saying something is missing (and we have four registration messages who failed) :

root@my-vps:/var/discourse# docker logs app
...
I, [2026-05-13T16:14:30.769269 #3290]  INFO -- : worker=7 gen=0 pid=4295 registered
I, [2026-05-13T16:14:30.815178 #4295]  INFO -- : worker=7 gen=0 pid=4295 ready
X-Accel-Mapping header missing
X-Accel-Mapping header missing
X-Accel-Mapping header missing
X-Accel-Mapping header missing

Can this help ?