I am trying to install Discourse using the basic Docker script on a new instance of an Ubuntu VM. I’m having an issue with emails not sending.
I’ve followed the steps in the install instructions to the letter. I’ve also done this several times, always with the same results.
I looked in the production.log file (/var/discourse/shared/standalone/log/rails/production.log) and found this:
Sent mail to <myusername>@<mycompany>.com (75.1ms) Job exception: getaddrinfo: Name or service not known
Here are what I think are the relevant parts of my app.yml file:
DISCOURSE_DEVELOPER_EMAILS: '<myusername>@<mycompany>.com' DISCOURSE_HOSTNAME: 'discourse-sand.vm.<ourdomain>' DISCOURSE_SMTP_ADDRESS: <smtpserver>.<ourdomain> # (mandatory) DISCOURSE_SMTP_PORT: 25 # (optional) #DISCOURSE_SMTP_USER_NAME: email@example.com # (optional) #DISCOURSE_SMTP_PASSWORD: pa$$word # (optional, WARNING the char '#' in pw can caus$ #DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true) ## If you want to set the 'From' email address for your first registration, uncomment and change: - exec: rails r "SiteSetting.notification_email='<myusername>@<mycompany>.com'" ## After getting the first signup email, re-comment the line. It only needs to run once.
I’m using an internal SMTP server in our company. I asked IT what to use for authentication and they told me that name and port was the only information I should configure, and leave username and password commented out.
Note that the domain of the VM is vm., so I used that for the DISCOURSE_HOSTNAME account. The only quirk that I thought could be an issue is that this SMTP server is configured to only allow traffic to/from certain internal domains, and I don’t know if vm. is causing a problem. Hence the reason I uncommented the ‘From’ email override at the bottom of the .yml file.
However, looking at the log file, I wonder if it’s having trouble finding the server at all. I’m able to ping the SMTP server from the terminal, but I’m out of my depth in Linux troubleshooting at this point and not sure how or where to dig further. Oh, and I tried to send email through the SMTP server via telnet based on this post, and that succeeded. I’m happy to provide any additional log info but you might need to explain how to get at it - I’m a pretty big noob when it comes to Linux or Ruby but I’m really interested in learning more!