What are the correct settings passed to ./discourse-setup
for connecting to an smtp server on localhost:25 without auth?
I’m very surprised that this isn’t supported OOTB; it’s the default config on most linux installs…
My server runs postfix locally; it is not accessible from the Internet. It works fine, for example, when running the mail
command. I found a few unofficial guides on the Internet suggesting changes to /var/discourse/containers/app.yml
, and I finally got it to install & start with the following settings:
DISCOURSE_SMTP_ADDRESS: localhost
DISCOURSE_SMTP_PORT: 25
DISCOURSE_SMTP_USER_NAME: discourse@opensouceecology.org
DISCOURSE_SMTP_PASSWORD: "none"
DISCOURSE_SMTP_AUTHENTICATION: none
DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
DISCOURSE_SMTP_ENABLE_START_TLS: false
Note that if I omit the DISCOURSE_SMTP_USER_NAME or DISCOURSE_SMTP_PASSWORD variables, your install script yells at me stating that they’re required (bug?).
And now when I click the “Resend Activation Email” button in the Discourse wui, this entry pops-up in the log file (/var/discourse/shared/standalone/log/rails/production.log):
Started PUT "/finish-installation/resend-email" for 127.0.0.1 at 2019-11-07 13:15:31 +0000
Processing by FinishInstallationController#resend_email as HTML
Parameters: {"authenticity_token"=>"SzQCvRWiqdXsBKzOjIB0X7KkvXro7Od6SdP8Qa8vvrskPeNYZNos5ORHJfyDUrHiKShZR/txM6NHuqHHCQCR1w=="}
Rendering finish_installation/resend_email.html.erb within layouts/finish_installation
Rendered finish_installation/resend_email.html.erb within layouts/finish_installation (Duration: 0.7ms | Allocations: 103)
Rendered layouts/_head.html.erb (Duration: 0.5ms | Allocations: 103)
Completed 200 OK in 98ms (Views: 3.0ms | ActiveRecord: 0.0ms | Allocations: 4763)
Rendering layouts/email_template.html.erb
Rendered layouts/email_template.html.erb (Duration: 0.5ms | Allocations: 141)
Delivered mail c4ca58ca-345e-46c4-81bc-6d0eac7afa04@discourse.opensourceecology.org (11.3ms)
Job exception: wrong authentication type none
…But my authentication type is ‘none’. What should the correct setting be for no authentication?
EDIT: also, can someone link me to the doc that defines all of the possible “DISCOURSE_SMTP_*” variables and all of their valid values?
EDIT2: this is proving to be far more difficult than it should be. I think ‘localhost’ is resolving inside the docker container to the Discourse docker container itself (app
) – not the docker host that is running my postfix smtp server. That’s further complicated by postfix’s mynetworks
and iptables
(which were configured by the discourse-setup
script or its children scripts). What’s the correct config here to just have Discourse use the smtp server on which I want to run Discourse, with no smtp auth?