Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Receive SES message content with Lambda?

I have a Java Lambda (RequestStreamHandler) that receives SES messages, but I'm having a tough time figuring-out where the "content" is.

The record's eventSource is aws:ses, there is no "content" attribute per the documentation. The simple text message

I've tried with & without SNS as the delivery, no difference.

I've also added an S3 rule to the Rule Set that is identical to the Lambda rule and S3 is receiving the entire message with content.

Thanks

like image 725
Mike Summers Avatar asked Mar 10 '18 22:03

Mike Summers


1 Answers

I believe I have this figured-out, if any of the following is incorrect please let me know.

  1. SES Events sent directly to a Lambda via a Rule Set do not contain the original email content.
  2. Using a Rule Set to place the email on a SNS topic, and the Lambda subscribing to the topic, results in (assuming the message is 150kb or less)
    • A SNS Event with a message tag
    • The message tag is escaped json which is a SNS Event with a content tag
    • The content tag is a raw RFC 2045 message

It is counter-intuitive that a Lambda cannot access the email content directly from a SES Event, but that appears to be the case.

like image 120
Mike Summers Avatar answered Sep 22 '22 18:09

Mike Summers