#self-hosted sentry not send emails

4 messages · Page 1 of 1 (latest)

odd spire
#

how can i san den emails with gmail smpt and whats config i need do?

unreal archBOT
#

Hi @odd spire. I'm happy to dig into this for you! I'll check my internal sources for answers to your question! :wave:

#

I'll help you set up email sending with Gmail SMTP for your self-hosted Sentry instance.

To configure Gmail SMTP for your self-hosted Sentry, you need to make the following changes:

  1. First, edit your config.yml file with these settings:
mail.backend: 'smtp'  # Use dummy if you want to disable email entirely
mail.host: 'smtp.gmail.com'
mail.port: 587
mail.username: 'yourusername@gmail.com'
mail.password: 'your-app-password'
mail.use-tls: true
mail.use-ssl: false

mail.from: 'yourusername@gmail.com'

Note: You must use an App Password for Gmail, not your regular Gmail password. You can generate an App Password in your Google Account settings.

  1. After making these changes, you need to run ./install.sh script to rebuild and restart the containers Self-Hosted Email.

  2. If you're using a reverse proxy, you may also need to enable these settings in sentry/sentry.conf.py:

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
USE_X_FORWARDED_HOST = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SOCIAL_AUTH_REDIRECT_IS_HTTPS = True

Common issues to check if emails still aren't sending:

  • Make sure you're using smtp.gmail.com (not smtp.google.com) GitHub Issue #2868
  • Use double quotes around your password if it contains special characters GitHub Issue #1901
  • If you've set SENTRY_MAIL_HOST in your .env file, be aware this might conflict with your direct config.yml settings

You can test your email configuration by going to the admin panel at /manage/status/mail/ and sending a test email.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@odd spire Our robots are still learning and improving, please let us know if this response was correct by reacting below.