SES SNS duplicate notification with different messageID but single email

2

I've set up SNS with SES and while looking at my logs, I'm seeing duplicate entries for open events but with DIFFERENT messageids, despite only a single email. I am able to verify that it's a single email because I've tested it by sending an email to myself, but moreover, in the logs, the timestamps are almost the exact same time (off by milliseconds). The one interesting thing is the ipAddress is slight different (one ends with .211, and the other with .219)

I've attached the record log below of two OPEN records from the same recipient.

{'EventSource': 'aws:sns', 'EventVersion': '1.0', 'EventSubscriptionArn': 'arn:aws:sns:us-west-1:12345678765:topic_name:c765a5cf-06cf-44d8-afdc-28b63033c949', 'Sns': {'Type': 'Notification', 'MessageId': '1123745b-e254-5168-962b-2e6f2e7ac2fb', 'TopicArn': 'arn:aws:sns:us-west-1:12345678765:topic_name', 'Subject': 'Amazon SES Email Event Notification', 'Message': '{"eventType":"Open","mail":{"timestamp":"2021-12-16T03:12:53.124Z","source":"redact","sendingAccountId":"12345678765","messageId":"0111017dc13a7384-bd1cf759-6814-418c-bd29-6f981a451a2e-000000","destination":["destination@gmail.com"],"headersTruncated":false,"headers":[{"name":"Date","value":"Thu, 16 Dec 2021 03:12:53 +0000"},{"name":"From","value":"redact"},{"name":"Reply-To","value":"redact"},{"name":"To","value":"destination@gmail.com"},{"name":"Message-ID","value":"<321132367.51541.1639624373206@ip-10-0-33-160.us-west-1.compute.internal>"},{"name":"Subject","value":"subject line"},{"name":"MIME-Version","value":"1.0"},{"name":"Content-Type","value":"text/html; charset=UTF-8"},{"name":"Content-Transfer-Encoding","value":"quoted-printable"}],"commonHeaders":{"from":["redact"],"replyTo":["redact"],"date":"Thu, 16 Dec 2021 03:12:53 +0000","to":["destination@gmail.com"],"messageId":"0111017dc13a7384-bd1cf759-6814-418c-bd29-6f981a451a2e-000000","subject":"subject line"},"tags":{"ses:operation":["SendTemplatedEmail"],"ses:configuration-set":["topic_name"],"ses:source-ip":["redact"],"ses:from-domain":["b.com"],"ses:caller-identity":["caller_id"]}},"open":{"timestamp":"2021-12-16T05:09:02.500Z","userAgent":"Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)","ipAddress":"0.0.0.211"}}\n', 'Timestamp': '2021-12-16T05:09:02.554Z', 'SignatureVersion': '1', 'Signature': 'e1swVjH1PFog/9syhhDOvS6BgNZnI3RN6k+fRfkXUaUXfmsiy2kAJ+ozKUi9BlnLRtCMnnxRH2GEV6w6t2C4WjWi/IBYr+YUn5veiZtAyQYG/NYgZhCM6yqvfIpfog2wPC3cc0tXj2oehZo8OXj8YvCbz3i8LR+wXn6lNewitJiYNX0yOVzCAWH6xd0QFlNULTk3RYNarM/a5ZmRXil35fhGWsDJnGWjNC5r32WXJB9eAZANpoNMiX/dbUxZTLWqolRGqC3M+JH3qjl/Cy/JSu+pWbSN/mtl/RzLD6W2fZBRtbApHTT+BoRi+x4hz/W6kl5FVUvl3NiSAiZsFQ4DoQ==', 'SigningCertUrl': 'https://sns.us-west-1.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem', 'UnsubscribeUrl': 'https://sns.us-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-west-1:12345678765:topic_name:c765a5cf-06cf-44d8-afdc-28b63033c949', 'MessageAttributes': {}}}
{'EventSource': 'aws:sns', 'EventVersion': '1.0', 'EventSubscriptionArn': 'arn:aws:sns:us-west-1:12345678765:topic_name:c765a5cf-06cf-44d8-afdc-28b63033c949', 'Sns': {'Type': 'Notification', 'MessageId': '39179993-647d-521d-ab77-c3a7a853b700', 'TopicArn': 'arn:aws:sns:us-west-1:12345678765:topic_name', 'Subject': 'Amazon SES Email Event Notification', 'Message': '{"eventType":"Open","mail":{"timestamp":"2021-12-16T03:10:32.670Z","source":"redact","sendingAccountId":"12345678765","messageId":"0111017dc1384ede-364355c2-5014-4940-a863-a811402771c1-000000","destination":["destination@gmail.com"],"headersTruncated":false,"headers":[{"name":"Date","value":"Thu, 16 Dec 2021 03:10:32 +0000"},{"name":"From","value":"redact"},{"name":"Reply-To","value":"redact"},{"name":"To","value":"destination@gmail.com"},{"name":"Message-ID","value":"<240748958.52874.1639624232756@ip-10-0-99-60.us-west-1.compute.internal>"},{"name":"Subject","value":"subject line"},{"name":"MIME-Version","value":"1.0"},{"name":"Content-Type","value":"text/html; charset=UTF-8"},{"name":"Content-Transfer-Encoding","value":"quoted-printable"}],"commonHeaders":{"from":["redact"],"replyTo":["redact"],"date":"Thu, 16 Dec 2021 03:10:32 +0000","to":["destination@gmail.com"],"messageId":"0111017dc1384ede-364355c2-5014-4940-a863-a811402771c1-000000","subject":"subject line"},"tags":{"ses:operation":["SendTemplatedEmail"],"ses:configuration-set":["topic_name"],"ses:source-ip":["redact"],"ses:from-domain":["b.com"],"ses:caller-identity":["caller_id"]}},"open":{"timestamp":"2021-12-16T05:09:02.441Z","userAgent":"Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)","ipAddress":"0.0.0.219"}}\n', 'Timestamp': '2021-12-16T05:09:02.489Z', 'SignatureVersion': '1', 'Signature': 'VUVBiM+AiCrfdjhZROCI2C3CnYiHD0fa/l8JK5adqnwTXauCZ83Ee/TFZXTXlXk9kweErI5n7ogbHDfe7nvTCjUuQ89I7WM1otU1xW7jkgxInSRTB4QrZl9FFhRUXQ5YiAlYJzhx3gB8+lD46hcQ2vGpRZ8IMPIpo7cnmryeBJxDHJg6ulQL+KWllrJVe8FHWjB5PeCxBHSl3+KWdmjVpakkF45pOpURXhuhVLtgUIP81AUM1510WtJhgKGvc1k1upUrLGHfWnsWe/qRCq+FJ4TdPvbokyGX/TahaSiBQYfgW9GhhRDWTjz5ebYdV9DZeIaJ7zPm0ep+2BYuHhYt4Q==', 'SigningCertUrl': 'https://sns.us-west-1.amazonaws.com/SimpleNotificationService-7ff5318490ec183fbaddaa2a969abfda.pem', 'UnsubscribeUrl': 'https://sns.us-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-west-1:12345678765:topic_name:c765a5cf-06cf-44d8-afdc-28b63033c949', 'MessageAttributes': {}}}

Anyone have any clue what I'm doing wrong to cause this?

  • Any updates on this? i'm having exactly the same problem! one email sent to aws ses. Somehow, we're getting multiple open notifications with different message ids!

2 Answers
0

I don't see the receipt node in the notification. receipt.recipients contains the envelope recipients (RCPT TO) for the message, which may differ from the message recipients (To:, CC: headers in the DATA). Some sending MTAs (i.e. Gmail) batch all recipients for a single domain in a single SMTP transaction (subject to an internal RCPT TO limit) and some MTAs (i.e. Yahoo) send a message for every recipient. The only way you'll know is by comparing the envelope recipients (receipt.recipients[]) with the message recipient headers (To:, CC:).

See https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-notifications-contents.html#receiving-email-notifications-contents-receipt-object

answered 2 years ago
0

Can you help me, how can I check logs using message ID? Thanks!

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions