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 which 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 ?

Because the registration email never arrived I’ve activated the admin account using the command line.

I logged in with the admin account and sent a test email to anotheruser@anotherdomain.org from Admin / Email settings / server settings → send test email.

This test email was sent immediately as we can see below and was delivered in my inbox :

root@my-vps:/var/discourse# ./launcher enter app
x86_64 arch detected.
root@my-vps-app:/var/www/discourse# rails console
Loading production environment (Rails 8.0.5)
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"],
 ["anotheruser@anotherdomain.org",
  "test_message",
  2026-05-16 14:44:42.978862000 UTC +00:00,
  "250 2.0.0 Ok: queued as D79DFB00573"]]

Then I tried to register with the same email address (anotheruser@anotherdomain.org) but the registration email wasn’t delivered (and not sent because it doesn’t appear in the logs from the rail console).

In conclusion test emails are sent and delivered but registration emails are not sent even with we find a trace in production.log :

cat production.log | grep anotheruser
  Parameters: {"email_address" => "anotheruser@anotherdomain.org"}
Started GET "/u/check_email?email=anotheruser%40anotherdomain.org" for xxx.xxx.xxx.xxx at 2026-05-16 17:40:45 +0000
  Parameters: {"email" => "anotheruser@anotherdomain.org"}
  Parameters: {"email" => "anotheruser@anotherdomain.org", "password" => "[FILTERED]", "username" => "NewUser", "password_confirmation" => "[FILTERED]", "challenge" => "xxxxxxxx", "timezone" => "Europe/Paris"}

People can’t register so what can I do to fix this ?

Finally I switched to another SMTP provider and everything works fine, but I’m frustrated I could not figured out what happened…

Some email providers just don’t work. I spent a long time at first trying to figure out the cause, but after switching to Mailgun, everything worked fine. From what I know, QQ Mail doesn’t integrate well with Discourse.

Once you logged in as admin, did anything show here:

There should be sufficient information there to figure this out.