arithmetric / aws-lambda-ses-forwarder

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

SignatureDoesNotMatch error #53

Closed strycker closed 7 years ago

strycker commented 7 years ago

I am attempting to use this function, and it appears to be executing when I send an email to my verified address, as it is logging an error. However, I'm not sure how to fix this.

SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.

Where do I enter the signature in my settings or config? Presumably this is something I need to do in Lambda, or SES, or in IAM, or where? I do not see any config in this particular script.

strycker commented 7 years ago

I do not have my SES settings using a prefix, so I have that config parameter as the empty string in this js script. Should I be using a prefix of some kind related to my DKIM DNS records?

strycker commented 7 years ago

Or is something not set up properly in my S3 bucket? I am getting the received emails saved there, but maybe this script can't read it?

I'm trying to follow https://github.com/aws/aws-sdk-js/issues/86 but I recently refreshed my keys, and my S3 bucket has all of the read/write permissions set, so I'm not sure if there is more to configure.

strycker commented 7 years ago

I was using the incorrect path format for my S3 bucket...

I had previously tried the following: emailBucket: ".s3-us-west-2.amazonaws.com", emailBucket: "s3-us-west-2.amazonaws.com/", emailBucket: "http://s3.amazonaws.com/",

but finally this worked: emailBucket: "",

Upon using this, I instead got an "AccessDenied" error. Turns out I also hadn't properly configured the IAM role policy for LambdaSesForwarder "Basic Execution Role". I hadn't entered the S3 bucket name in the script. I fixed this, and now it works.