Can't Send Emails

I’m not receiving emails when I create an account and I was wondering if I did anything wrong… what’s the difference between an SMTP address and an SMTP domain?

SMTP address: user@example.com
SMTP domain: example.com

1 Like

Do you think you could help me? I’ve used an SMTP tool online and it all works fine, but Discourse doesn’t seem to be sending emails when I sign up…

Hello and welcome @ethhaqn :slight_smile:

Have you checked out the troubleshooting guide?

3 Likes

I used telnet mail.theapi.tech 25 and it returned 220 myhelper.tech ESMTP Postfix, an old domain that I used for testing this system. Do you think it’s making an impact on email sending? If so, where can I change the domain? Again, it’s an old domain but I’m not sure where I could’ve inputted this domain for it to be returned when I run telnet mail.theapi.tech 25.

It may also be worth nothing that ./discourse-doctor told me that there was an uncommon error and couldn’t seem to resolve my issue.

Also, I didn’t use ./discourse-setup to setup Discourse as port 80 was taken. Instead, I manually edited containers/app.yml and ran ./launcher rebuild app.

I used tail shared/standalone/log/rails/production.log and the logs say:

Processing by FinishInstallationController#confirm_email as HTML
  Rendered finish_installation/confirm_email.html.erb within layouts/finish_installation (Duration: 0.7ms | Allocations: 255)
  Rendered layout layouts/finish_installation.html.erb (Duration: 6.7ms | Allocations: 2103)
Completed 200 OK in 8ms (Views: 7.4ms | ActiveRecord: 0.0ms | Allocations: 2735)
start
  Rendered layouts/email_template.html.erb (Duration: 0.1ms | Allocations: 34)
Delivered mail 0e5b023a-90f9-4c23-ae2b-488b4d70d907@theapi.tech (39.6ms)
Job exception: hostname "mail.theapi.tech" does not match the server certificate

fail

openssl s_client -connect mail.theapi.tech:25 -starttls smtp -showcerts

Verification error: self signed certificate

So you need to set DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none in your app.yml

1 Like

Won’t that make it so that you don’t need to verify your email?

No. It will make Discourse skip the verification that is failing right now.

Ah, there we go. How would I get an SSL certificate? This is in my app.yml btw:

image

I think the part where you set up your own mail server is outside of the scope of this forum.

1 Like

Nono, not on my mail server. Like, on my actual Discourse site.

Please follow Running other websites on the same machine as Discourse and if that fails, open a new topic.

1 Like

Hi, I’ve upgraded my local instance of Discourse to 2.9.0.beta4 and even after adding DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: “none” in my containers/app.yml file (and rebuilding the app), I still keep getting such errors:

  Rendered layouts/email_template.html.erb (Duration: 0.2ms | Allocations: 34)
Delivered mail 31c5b9eb-1077-4155-b040-314c4a8566cb@taverne.colorfulminis.com (11.3ms)
Job exception: SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate)

This obviously makes my Discourse instance unable to send emails anymore.
Is there any known issue about this?

FYI: I’m running a preprod instance with 2.8.0.beta9 and exactly the same config, and emails get sent like a charm.

Thanks for your help.

1 Like

Hi Alexis,

I have the exact same problem on a VM (Ubuntu 22.04 with docker-based 2.9.0.beta4 Discourse instance). Even with DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none in container/app.yml (and $DISCOURSE_SMTP_OPENSSL_VERIFY_MODE in docker environment set to none), certificate verify failed (self signed certificate) continues to be raised

Edit: fyi, stable version (2.8.3) works as expected