Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email alerts not being sent #217

Closed
gdubicki opened this issue Apr 18, 2015 · 8 comments
Closed

Email alerts not being sent #217

gdubicki opened this issue Apr 18, 2015 · 8 comments

Comments

@gdubicki
Copy link
Contributor

Sending email via Gmail SMTP with the login & pass I have in my Cabot conf, from the host Cabot is installed on works for me when I do it from the commandline but NOT from Cabot. There are NO entries mentioning emails in my Cabot's log files.

The problem has been with my Cabot instance since its first deploy, on 2015-02-27 v. 8362690.

Currently I am using Cabot v. 2708ee7, redeployed today (redeploy didn't help).

@gdubicki
Copy link
Contributor Author

Relevant fragments of my production.env:

# Plugins to be loaded at launch
CABOT_PLUGINS_ENABLED=cabot_alert_email==1.3.1

# You shouldn't need to change anything above this line
# Django admin email
ADMIN_EMAIL=<one of my emails, working>
CABOT_FROM_EMAIL=<some Gmail account user name WITH @gmail.com>

SES_HOST=smtp.gmail.com
SES_USER=<some Gmail account user name without @gmail.com>
SES_PASS=<some password>
SES_PORT=465

Note that the above credentials and port work when using the commandline to send email.

@gdubicki
Copy link
Contributor Author

How to debug email alert plugin?

I tried to edit /home/ubuntu/venv/lib/python2.7/site-packages/cabot_alert_email/models.py and add some logging calls but apparently this file is not being used..

@xinity
Copy link
Contributor

xinity commented Apr 20, 2015

do you see alert list in your service configuration ?

@gdubicki
Copy link
Contributor Author

@xinity what do you mean? Status of my check is "failing", service is "critical". UPDATE: I have noticed that I had empty "Alert Types" in my service.. Testing if adding "Email" here helps.

@xinity
Copy link
Contributor

xinity commented Apr 20, 2015

"that I had empty "Alert Types" in my service.. Testing if adding "Email" here helps."
==> @grzegorz-dubicki that's what i meant :)

@romankor
Copy link
Contributor

romankor commented Jun 2, 2015

@grzegorz-dubicki In order to make it work with Gmail i had to adjust the following configuration in settings.py

EMAIL_USE_TLS = os.environ.get('EMAIL_USE_TLS', True)
EMAIL_HOST = os.environ.get('SES_HOST', 'localhost')
EMAIL_PORT = int(os.environ.get('SES_PORT', 25))
EMAIL_HOST_USER = os.environ.get('SES_USER', '')
EMAIL_HOST_PASSWORD = os.environ.get('SES_PASS', '')
#EMAIL_BACKEND = os.environ.get('SES_BACKEND', 'django_smtp_ssl.SSLEmailBackend')

@gdubicki
Copy link
Contributor Author

I am using a clean, new instance of Cabot now (f5f201c) and it also doesn't send emails through Gmail. Or rather Google Apps company account this time, to be precise. The account I am using works in other SMTP clients.

@xinity I have enabled "Email" in "Alert Types" and it didn't help.

@romankor Thank you, tried that - didn't help.

In which log file should I look for traces of sending emails? How to increase the log level to see more?

@gdubicki
Copy link
Contributor Author

Ok, it started to work 💃 with the following configuration (but YMMV):

  • Cabot version - f5f201c
  • NO modifications of settings.py
  • relevant fragments of my production.env
  • the check failing is part of some Service (see below)
  • enabled "Email" in "Alert Types" for this Service
  • email entered for the user watching this Service
# Plugins to be loaded at launch
CABOT_PLUGINS_ENABLED=cabot_alert_email==1.3.1

# You shouldn't need to change anything above this line
# Django admin email
ADMIN_EMAIL=<one of my emails, working>
CABOT_FROM_EMAIL=<full Google Apps account address)

SES_HOST=smtp.gmail.com
SES_USER=<full Google Apps account address)
SES_PASS=<some password>
SES_PORT=465

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants