arithmetric / aws-lambda-ses-forwarder

Serverless email forwarding using AWS Lambda and SES
MIT License
1.7k stars 451 forks source link

parseEvent() received invalid SES message: #55

Open jlbrazee opened 7 years ago

jlbrazee commented 7 years ago

Getting this error in CloudWatch logs. Best I can tell it's because data.event.Records[0].eventVersion is coming through as "2.0" and index.js requires that it's "1.0". Do I need to change my AWS setup somewhere to force 1.0, or do I change index.js to allow this through?

Thanks!

scjcoder commented 7 years ago

I'm getting this same error too in CloudWatch logs and cannot get past it to use this package. Although, @jlbrazee the line you mention [data.event.Records[0].eventVersion !== '1.0') ] i read this to mean does NOT equal 1.0 which if it says 2.0 in logs (mine does too) then this should be valid and not the error issue.

Hoping someone here can help get us past this? Is this a permissions thing on the S3 bucket?

jlbrazee commented 7 years ago

You're reading the conditional correctly, but it's "if NOT equal to 1.0, then throw an error."

Incidentally, I changed this code to allow 2.0 to go through and got a whole lot more errors, so that wasn't the solution. :)

scjcoder commented 7 years ago

thanks for the clarification!

jakubboucek commented 7 years ago

Hi you both, I am still getting eventVersion 1.0 and same info is in documentation.

Can you please put here more info about your case? Especially:

I am need help to find out the cause why you have another event version and what differens are between 1.0 vs 2.0

jakubboucek commented 7 years ago

Hi, are you sure you are invoke Lambda by the action in SES rule, not by S3 event trigger? Your symtoms seems like S3 event.

CaseyRo commented 7 years ago

I'd like to add to @jakubboucek that indeed this was my issue as well, I set up the lambda action to be triggered, based on S3. AND as action in the SES rule, where just the SES rule was enough.