amazon-web-services - 使用 Amazon SES 区分反弹和 OOTO

标签 amazon-web-services amazon-ses

我使用 Amazon SES 发送电子邮件并使用 SNS 处理通知。我刚刚意识到我一直在将 OOTO 消息处理为退回邮件,我想解决这个问题,以便正确地区分两者。

OOTO 和退回通知都有 "notificationType":"Bounce" .

通知中必须有一些其他信息可以让您区分退回邮件和 OOTO,但我在任何地方都找不到这些信息。有没有人想过这个?

最佳答案

提供一些额外的信息来帮助他人。以下是从 SES 模拟器收到的电子邮件地址 ooto@simulator.amazonses.com、bounce@simulator.amazonses.com 和抑制列表@simulator.amazonses.com 的示例消息。另外下面是与生产中的OOTO电子邮件对应的消息,这与模拟的不同。

看起来您可以使用“bounceType”来区分 OOTO 和反弹,但最好能从 SES 团队那里得到澄清。在我看来,OOTO 消息不应被视为退回邮件。

来自模拟器的OOTO:

{
u'mail': {
  u'timestamp': u'2013-09-01T17:21:23.000Z', 
  u'destination': [u'ooto@simulator.amazonses.com'], 
  u'source': u'sender@example.com', 
  u'messageId': u'...'}, 
u'notificationType': u'Bounce', 
u'bounce': {
  u'bounceType': u'Transient', 
  u'bounceSubType': u'General', 
  u'bouncedRecipients': [{u'emailAddress': u'ooto@simulator.amazonses.com'}], 
  u'feedbackId': u'...', 
  u'timestamp': u'2013-09-01T17:21:24.000Z'}
}

生产中的OOTO:
{
u'mail': {
  u'timestamp': u'2013-09-01T18:45:10.000Z', 
  u'destination': [u'ooto@example.com'], 
  u'messageId': u'...', 
  u'source': u'sender@example.com'}, 
u'notificationType': u'Bounce', 
u'bounce': {
  u'bouncedRecipients': [], 
  u'bounceType': u'Undetermined', 
  u'bounceSubType': u'Undetermined', 
  u'feedbackId': u'...', 
  u'timestamp': u'2013-09-01T18:45:11.000Z'}
}

从模拟器反弹:
{
u'mail': {
  u'timestamp': u'2013-09-01T17:21:20.000Z', 
  u'destination': [u'bounce@simulator.amazonses.com'], 
  u'messageId': u'...', 
  u'source': u'sender@example.com'}, 
u'notificationType': u'Bounce', 
u'bounce': {
  u'bounceType': u'Permanent',
  u'bounceSubType': u'General', 
  u'bouncedRecipients': [{u'action': u'failed', u'status': u'5.1.1', u'diagnosticCode': u'smtp; 550 5.1.1 user unknown', u'emailAddress': u'bounce@simulator.amazonses.com'}], 
  u'feedbackId': u'...', 
  u'timestamp': u'2013-09-01T17:21:20.767Z', 
  u'reportingMTA': u'dsn; a8-96.smtp-out.amazonses.com'}
}

生产反弹:
{
u'mail': {
  u'timestamp': u'2013-09-02T13:39:02.000Z', 
  u'destination': [u'recipient@example.com'], 
  u'messageId': u'...', 
  u'source': u'sender@example.com'}, 
u'notificationType': u'Bounce', 
u'bounce': {
  u'feedbackId': u'...', 
  u'timestamp': u'2013-09-02T13:38:57.000Z', 
  u'reportingMTA': u'dns; b232-135.smtp-out.amazonses.com', 
  u'bounceSubType': u'General', 
  u'bouncedRecipients': [{u'status': u'5.0.0', u'diagnosticCode': u"smtp; 5.1.0 - Unknown address error 550-'Requested action not taken: mailbox unavailable' (delivery attempts: 0)", u'emailAddress': u'recipient@example.com', u'action': u'failed'}], 
  u'bounceType': u'Permanent'}
}

来自模拟器的抑制列表:
{u'mail': {
  u'timestamp': u'2013-09-01T17:21:31.000Z', 
  u'destination': [u'suppressionlist@simulator.amazonses.com'], 
  u'messageId': u'...', 
  u'source': u'sender@example.com'}, 
u'notificationType': u'Bounce', 
u'bounce': {
  u'bounceType': u'Permanent',
  u'bounceSubType': u'Suppressed', 
  u'bouncedRecipients': [{u'status': u'5.1.1', u'emailAddress': u'suppressionlist@simulator.amazonses.com', u'diagnosticCode': u'Amazon SES has suppressed sending to this address because it has a recent history of bouncing as an invalid address. For more information about how to remove an address from the suppression list, see the Amazon SES Developer Guide: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/remove-from-suppressionlist.html ', u'action': u'failed'}],
  u'feedbackId': u'...', 
  u'timestamp': u'2013-09-01T17:21:32.620Z', 
  u'reportingMTA': u'dns; amazonses.com'}
}

关于amazon-web-services - 使用 Amazon SES 区分反弹和 OOTO,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17396264/

相关文章:

python - Boto3 SES 电子邮件 - 在电子邮件客户端中显示 HTML 代码

java - AWS 使用 uploadUrl 时将元数据添加到文件内容

amazon-cognito - 如果禁用自动预热,如何使用 ses 专用 ips?

php - 在我们使用 AWS SES SMTP 凭证在 PHP 应用程序中发送电子邮件的 AWS SES 中迁移到签名版本 4 的影响?

amazon-web-services - 使用托管策略和内联策略创建角色时出现云形成错误

PHP 向 Amazon SES 发送大量电子邮件

email - 如何使用 email-ext 插件在 Jenkins 中设置发件人地址?

amazon-web-services - 使用 AWS CDK,如何在代码管道中设置源代码的 oathToken,从 GitHub 提取源代码,而不使用 Secret Manager 服务?

c# - 尝试访问 Amazon s3 上的文件时出现 SignatureDoesNotMatch 错误

node.js - AWS lambda 搞乱了我的编码