Simulation of Bounce, Complaint and Reject of SES

Simulation of Bounce, Complaint and Reject of SES

Takahiro Iwasa
Takahiro Iwasa
2 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.

Conclusion

When you use SES, please take care about the rates of Bounce, Complaint and Reject.

I hope you will find this post useful.

Takahiro Iwasa

Takahiro Iwasa

Software Developer at KAKEHASHI Inc.
Involved in the requirements definition, design, and development of cloud-native applications using AWS. Now, building a new prescription data collection platform at KAKEHASHI Inc. Japan AWS Top Engineers 2020-2023.