App.yml settings for Internal SMTP relay


(Homebrew Hops) #1

Team,
I have deployed Discourse via Docker container. On initial bootstrap, I left STMP settings commented out. I started the app and registered my Developer account which then sent an email for confirmation, which was never sent because SMTP settings were left out. I destroyed the app, modified the app.yml to just have an SMTP server, and bootstrap and started the app. The SMTP server is an internal relay that is open to all IP sourced from my lab subnet. I have verified DNS and IP connectivity to the relay.

I have reviewed ./launcher logs app and do not see any smtp related events. I have checked spam/junk folders.

Does the app.yml require ALL of the smtp settings to be uncommented regardless of port and/or authentication settings? Is there anywhere else in the docker app for me to check logs relevant to smtp?

Thank you,
Homebrew Hops


(Kane York) #2

Yeah, you should normally set all of them.

If you need to change the authentication mode, add a new line like this:

DISCOURSE_SMTP_AUTHENTICATION: "plain"

With something other than “plain” (that’s the defautl.)

If you want to turn off Start TLS:

DISCOURSE_SMTP_ENABLE_START_TLS: false

(Homebrew Hops) #3

Thank you, I have updated app.yml and destroyed, bootstrapped, started. I suppose it could be hung up on the default authentication type. you are recommending something other than “plain” but we are doing IP based authentication

Here’s what I’ve got and still no emails hitting my relay:

env:
  # your email here
  DISCOURSE_DEVELOPER_EMAILS: 'dev@domain.local'
  # CHANGE ME to your hostname
  DISCOURSE_HOSTNAME: 'discourse.domain.local'
  # SET ME to your smtp server eg mandrill
  # don't forget to set mail
  DISCOURSE_SMTP_ADDRESS: relay01.domain.local
  DISCOURSE_SMTP_AUTHENTICATION: "plain"
  DISCOURSE_SMTP_ENABLE_START_TLS: false
  # DISCOURSE_SMTP_PORT: 587
  # DISCOURSE_SMTP_USER_NAME: user@example.com
  # DISCOURSE_SMTP_PASSWORD: p@ssword

Thank you,
Homebrew Hops


(Kane York) #4

Just because I mentioned something doesn’t mean you should use it right away, Start TLS is a very important performance setting.

Can you try asking those in charge of operating the SMTP relay and ask them what the settings should be?

Have you tried just connecting straight to Mandrill and verifying that the actually blocked, and going through this proxy is actually necessary?


(Homebrew Hops) #5

Thanks for your help. I entered the Mandrill settings on the original containers app.yml. With no luck. I created a new copy of samples/standalone.yml and added the same Mandrill settings and was able to get the email settings working.

I checked the email logs in the /admin and found that it only sent the 1 email when I first signed up and there was no record of any of the times I had hit the Resend Activation Email from the login prompt.

Anyway, thanks for your responses, I’m logged in as Admin and Test Emails through Mandrill work.

-Homebrew Hops


(Kane York) #6

Glad to hear you got it to work!


(Dave Howell) #7

Hmm. I’d love to find out what the answer is to the original topic, though. I just activated my own Discourse install. I can’t yet do anything with it because my account confirmation is not getting delivered. I really do not want to have to configure a Mandrill account (good lord the instructions are not short!) when I’ve got a perfectly good, fully operant SMTP server sitting right here. It even is configured to accept unauthenticated message from other machines on the local network. “Plain” however, is not accepted.

So how to I get discourse to either use no authentication at all, or MD5? (I have tried both “none” and “md5” for DISCOURSE_SMTP_AUTHENTICATION but it’s still trying to use plain…)


#8

For my relay SMTP (ISP provided) mail server mail.isp.tld, the following three lines were all I needed:

DISCOURSE_SMTP_ADDRESS: mail.isp.tld
DISCOURSE_SMTP_AUTHENTICATION: none
DISCOURSE_SMTP_PORT: 25

I found the
DISCOURSE_SMTP_ENABLE_START_TLS: false
setting was NOT required, but putting it in did not break things.


Can't use 'none' DISCOURSE_SMTP_AUTHENTICATION
(Richard Kay) #9

Thanks for this. These settings were what I needed. I run my own mailserver on a cloud virtual machine which authenticates SMTP clients of my email hosted users using a similar approach to dynamic DNS. I’ve now got my own test implementation of discourse working on a temporary VM.
:smiley: