adamcooke / staytus

💡 An open source solution for publishing the status of your services
http://staytus.co
MIT License
2.17k stars 285 forks source link

Unable to get SMTP to work with Office365 #285

Closed trysorcery closed 3 years ago

trysorcery commented 5 years ago

Greetings and salutations! This is my first foray into a CLI-only distro of Linux, so I'll take any help I can get. I have Staytus up and running, which was a learning experience and I'm incredibly proud to have done it.

That probably tells you where I stand in terms of skill and experience.

Currently, I'm struggling to get SMTP to work. If any user attempts to subscribe to e-mails on our Staytus page, they receive the "We're sorry, but something went wrong. / If you are the application owner check the logs for more information" page. The user will show up under the list of subscribed users, but no e-mail is sent. The logs reliably show the following when subscription is attempted:

"GET /subscribe HTTP/1.0" 200 "POST /500 HTTP/1.0" 500

My environment.yml is as follows:

# Staytus environment configuration. Staytus uses
# unix environment variables to provide its configuration.
# If your hosting environment does not support setting this
# easily, you can add them to config/environment.yml and
# they will be loaded when the application starts.

# The theme to use
STAYTUS_THEME: default

# If enabled, the application will allow any username/password
# combination to login to the admin area.
STAYTUS_DEMO: '0'

# Configure an SMTP server for sending messages. If you don't
# configure an SMTP service, e-mail will be sent using sendmail.
STAYTUS_SMTP_HOSTNAME: 'smtp.office365.com'
STAYTUS_SMTP_PORT: '587'
STAYTUS_SMTP_USERNAME: 'nope@naw.com'
STAYTUS_SMTP_PASSWORD: 'n0pen0pen0pe'
STAYTUS_SMTP_AUTH_MODE: 'login'

# Configure SSL to be forced (ensuring HSTS headers are sent and cookies are all secure)
FORCE_SSL: '0'

I've got a strong feeling that I'm not using the proper syntax in the environment.yml file. Some of the solutions available suggest using single quote marks, some suggest using double quote marks, and exactly where quote marks are used is unclear. Any suggestions or resources I could make use of would be greatly appreciated!