Monitoring SES delivery - amazon-web-services

I have implemented SES in one of my application. Currently the I have implemented is that using SDK I wait for the success/failure response and take action based on the response. Now, I want to make is async so the process does not have to wait for the response and if any failure happen I should be able to see it and resend the email.
I have following questions.
I checked the CloudTrial does not support SendEmail or SendRawEmail then where can I see the status of an email whether its sent or not?
I read that SES makes the first attempt to send an email within few milliseconds. Does it retries if the first attempt was a failure or the SES was out of service?
Is there a better way of achieving what I want to achieve?
Can I see the SES queue anywhere?
Thanks

You can sign up to receive Bounces, Complaints and Delivery notifications via SNS. That's all you can do. You can't see the SES queue or get any other visibility into SES besides what the SNS notifications give you.

Amazon will make several attempts to deliver your e-mails to the recipients.
The big thing is that they will not give you the bounce notification until 12-24 hours later in my experience. This is due to them retrying to send the mail a few times, waiting for mail hosts to be available, etc.
If you use SES you should use their SNS system to check for bounces, complaints, and delivery notifications. That way you can handle the failed deliveries in a graceful manner.
Amazon's Doc here gives you some insight into how it works
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-email-with-ses.html

Related

How do I see a history of all SES emails sent with their contents? Mysterious emails were sent

My organization's AWS account got an alert that we sent over 10,000 emails last week, many of which were marked as spam.
The catch is: No emails were supposed to be sent, we don't know who did it, and thus we're suspecting that it was a malicious actor.
How can we see a history of all emails sent and log all future SES emails? Specifically, can we see the contents of those emails? Is there a way we can determine who/which user sent those emails?
I'd like to emphasize that I need to see all emails sent by SES, regardless of region or any other parameters.
Any other tips or tricks?
This tutorial seems like overkill:
https://aws.amazon.com/premiumsupport/knowledge-center/ses-email-sending-history/
How can we see a history of all emails sent and log all future SES emails?
yes using CloudWatch Metrics you can easily find all the metrics associated with ses, for future try using a notification system using cloudwatch and sns when something happens
Docs https://docs.aws.amazon.com/ses/latest/dg/monitor-sending-activity-console.html
Is there a way we can determine who/which user sent those emails?
Yes use cloud trail events
can we see the contents of those emails?
I am afraid No, you can't, you might need to build custom solution like creating an event, and then processing contents with lambda.

Amazon SES using Message Id

Im using AWS Lambda for sending emails by Amazon SES.
Each time that the request send_email succeeds I got the message id like confirmation.
But now, I want to use somehow this messageId. For example to know if this message concretelly get delivered or bounced.
CloudWatch offers me metrics, with the number of delivered or bounced messages but I want to look throught each one.
¿Is there any statement that allows to know the state of a message by id?
Due to the asynchronous nature of SMTP and how mails are being routed, you can't have this information immediately when sending an e-mail (via SES or otherwise).
However, AWS provides a feedback system which notifies an SNS topic when a message is delivered, bounced, or a complaint was received.
While the documentation is very detailed, the general idea is that you subscribe your own lambda(s) to the configured SNS topic(s) and you can then handle these events as you see fit (i.e. persist data on DynamoDB, call your unsubscribe API and so on).

SES: API to get delivery status of mails as json response

I want to get the delivery status of the mails sent through Amazon SES by hitting an API and saving the response in my database. I know of Amazon SNS and sending notification through email, but could not find a solution for this. Is there a solution to this?
There is no polling mechanism in SES for delivery status.
The SNS delivery/status notifications that SES provides, which you have indicated you are familiar with, is the standard mechanism for this.
Enable these and then subscribe an SQS queue, or a Lambda function, or even an HTTPS endpoint from your app, to the designated SNS topic. It should be relatively simple using any of these mechanisms to code a solution to store the reports in the database as they are provided to you by SES.

How to configure the AWS SNS notification email subject

We are using AWS SNS to send out email for Alarms .We receive the email with subject Newsletter/Marketing which we are trying to avoid.
Is there any way where we can configure the subject for SNS notification email in AWS console??
We receive the email with [the] subject [prefixed with] Newsletter/Marketing which we are trying to avoid
This does not sound like anything CloudWatch or SNS would be adding.
This sounds like something your email service or server is adding, after the mesage is received, in a misguided effort to be "helpful."
Examine the headers of the incoming mesage -- you may see evidence of this tampering. Or Send the email to a mailbox on a different mail service, such as Gmail (which I assume you are not using, since my CloudWatch alarms do not show this), and examine what you see in the message.

How can I see a report of my AWS Bounced emails?

I have an application that automatically sends thousands of emails per hour using Amazon Web Service's Simple Email System (SES).
How/where can I view a report of email bounces?
EDIT:
Below #Neil shows how I can setup SNS to email me about bounced emails. But is there any way I can see a report of Bounced emails in the past? Going forward is there a way I can see a bounce report/table instead of getting an email notification every time an email bounces?
It has been long time wanted but there's no built-in feature for now.
I suggest you push on this thread so Amazon gives more info about the roadmap to integrate this feature
You can configure AWS to email you via SNS. See here
You can configure SES to send bounces (and complaints, and even deliveries) to an SNS endpoint.
From SNS, you can configure different subscribers: email, http(s), or a couple other options. The interesting option is Lambda. Create a Lambda end point, and then write a simple function that inserts the information you want to track into DynamoDB.
This might cost you a few cents/month, but you have control over what you're recording and how to access it.