Simulation of Bounce, Complaint and Reject of SES

Simulation of Bounce, Complaint and Reject of SES

Takahiro Iwasa
(岩佐 孝浩)
Takahiro Iwasa (岩佐 孝浩)
1 min read
SES

SES users must keep the rates of Bounce, Complaint and Reject under a specific threshold; otherwise you would face the penalty from AWS in the worst case. Simulation of them helps us design how to respond.

Prerequisites

Please make sure that an email address has already been registered in your SES and its Email Feedback Forwarding is turned on.

Bounce Simulation

Run the following command to simulate bounce.

aws ses send-email --from <YOUR_EMAIL> --to [email protected] --subject test --text test

You should receive the following email sent from the address specified by --from option.

Complaint Simulation

Run the following command to simulate complaint.

aws ses send-email --from <YOUR_EMAIL> --to [email protected] --subject test --text test

You should receive the following email sent from the address specified by --from option.

Reject Simulation

Run the following command to send an email containing an EICAR test file attachment.

FROM=<YOUR_EMAIL>
MESSAGE='{"Data": "From: $FROM\nTo: $FROM\nSubject: test\nMIME-Version: 1.0\nContent-type: Multipart/Mixed; boundary=\"NextPart\"\n\n--NextPart\nContent-Type: text/plain\n\ntest\n\n--NextPart\nContent-Type: text/plain;\nContent-Disposition: attachment; filename=\"sample.txt\"\n\nX5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*\n\n--NextPart--"}'
MESSAGE=$(echo $MESSAGE | sed "s/\$FROM/$FROM/g")
aws ses send-raw-email --cli-binary-format raw-in-base64-out --raw-message "$MESSAGE"

You should receive the following email sent from the address specified by FROM variable.

Takahiro Iwasa
(岩佐 孝浩)

Takahiro Iwasa (岩佐 孝浩)

Software Developer at iret, Inc.
Architecting and developing cloud native applications mainly with AWS. Japan AWS Top Engineers 2020-2023