用Amazon SES区分弹跳和OOTO

时间:2013-07-01 01:01:37

标签: amazon-web-services amazon-ses

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

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

通知中必须有一些其他信息可以区分弹跳和OOTO,但我无法在任何地方找到这些信息。有没有人想到这个?

1 个答案:

答案 0 :(得分:7)

提供一些额外信息以帮助他人。以下是从SES模拟器收到的电子邮件地址ooto@simulator.amazonses.com,bounce@simulator.amazonses.com和suppressionlist@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'}
}