9

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 = ('my.name@domain.com',)

MANAGERS = ADMINS



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

EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'name@gmail.com'
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?

Ajay Yadav
  • 798
  • 1
  • 8
  • 18
  • Should you not leave the ADMINS as it is? – lprsd Mar 04 '11 at 06:29
  • That is like normal case, error-mail whenever error occurs,but does not enable "throttled emails" feature in sentry - mail only when first time error is seen or when first time error is seen again after being resolved. http://readthedocs.org/docs/sentry/en/latest/config.html#other-settings – Ajay Yadav Mar 04 '11 at 08:16

2 Answers2

4

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.

Tino
  • 717
  • 1
  • 5
  • 20
0

I believe the issue is that you are trying to use gmail to send the messages but you are trying to send the messages from "my.name@domain.com"

As far as I know, gmail does not allow you to send messages from email addresses which you are not a verified as owning (in gmail).

Try setting your SENTRY_ADMINS to...

SENTRY_ADMINS = (
  "YOUR_GMAIL_ADDRESS@gmail.com",
)
Jiaaro
  • 74,485
  • 42
  • 169
  • 190