使用Amazon SES配置Sentry

5

网上似乎没有关于这个问题的信息...

如何在sentry.conf.py中设置参数,以使用Amazon SES作为电子邮件后端?

目前,在Django项目中,我们使用以下代码:

EMAIL_BACKEND = 'django_ses.SESBackend'
EMAIL_USE_SSL = True

AWS_ACCESS_KEY_ID = 'key'
AWS_SECRET_ACCESS_KEY = 'secret'

AWS_SES_REGION_NAME = 'eu-west-1'
AWS_SES_REGION_ENDPOINT = 'email.eu-west-1.amazonaws.com'
是有些不同的,有人有见解吗? 非常感谢。
2个回答

5
您可以配置Sentry使用SMTP服务器发送电子邮件,并且您可以从SES获取SMTP凭据。
要为SES设置SMTP接口,请按照以下指南操作:http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-smtp.html 然后,配置您的Sentry安装以使用这些凭据(请参阅:https://docs.sentry.io/server/config/#mail
示例 config.yml:
mail.backend: 'smtp'
mail.host: 'email-smtp.eu-west-1.amazonaws.com'
mail.port: 587
mail.username: 'myuser'
mail.password: 'mypassword'
mail.use-tls: true
# The email address to send on behalf of
mail.from: 'sentry@example.com'

0

使用 django-amazon-ses 进行配置(与 django-ses 不同),无需 SMTP 凭据,具体步骤如下:

sentry/config.yml 文件中编辑如下内容:

mail.backend: 'django_amazon_ses.EmailBackend'
mail.from: 'from@example.com'

# Comment or delete the other `mail.*` options

sentry/sentry.conf.py 中,如果区域不是 us-east-1
AWS_DEFAULT_REGION = "eu-west-1"

sentry/enhance-image.sh 文件中(自 v22.6.0 版本以来):
pip install django-amazon-ses

然后像往常一样使用./install.shdocker compose up -d重新启动Sentry。

PS:假设实例或默认配置文件具有IAM ses:SendEmail权限。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接