Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending Error Mails when using django-sentry not working

I am using django-sentry for logging errors. I also want to enable throttled error mails to be sent to admins whenever an error occurs. But I can not get it working.

a) Normal django error mailing is working. b) but on removing ADMINS and adding SENTRY_ADMINS(like below) it stops working:

   DEBUG = False
TEMPLATE_DEBUG = DEBUG

SENTRY_TESTING = True

ADMINS = ()
SENTRY_ADMINS = ('[email protected]',)

MANAGERS = ADMINS



MIDDLEWARE_CLASSES = (
        'sentry.client.middleware.SentryResponseErrorIdMiddleware',
....
)

EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 587

Though entries are correctly being made and shown in panel. I mark all errors as resolved before testing(to satisfy throttle condition of sentry) but it is still not working.

Can anyone point to what I am doing wrong here?

like image 239
Ajay Yadav Avatar asked Mar 03 '11 22:03

Ajay Yadav


1 Answers

Jiaaro is almost correct. The From address used by Sentry (and Django itself) is defined by settings.SERVER_EMAIL. It will use the SENTRY_ADMINS addresses only to send email to.

So setting SERVER_EMAIL = EMAIL_HOST_USER should fix this.

like image 199
Tino Avatar answered Sep 19 '22 00:09

Tino