aws-lambda-ses-forwarder icon indicating copy to clipboard operation
aws-lambda-ses-forwarder copied to clipboard

Forward different domains to different buckets

Open Suncatcher opened this issue 5 years ago • 4 comments

Can we do that? E.g. messages sent to [email protected] were saved to bucket domain1 and messages sent to [email protected] were saved to domain2.

Suncatcher avatar Oct 13 '18 08:10 Suncatcher

This request is currently not about this tool. If you want read messages from different bucket, create two different Lambda functions.

jakubboucek avatar Oct 14 '18 10:10 jakubboucek

Just thought it's purely a configuration issue, because bucket is specified in default config and so it should be possible to forward messages as well. It would be handy to store different messages in corresponding buckets.

Suncatcher avatar Oct 14 '18 10:10 Suncatcher

Still no possibility?

We have bucket in config:

var defaultConfig = {
fromEmail: "[email protected]",
emailBucket: "buckbuck",

Can we make it conditional?

Suncatcher avatar Jan 31 '19 06:01 Suncatcher

You could possibly make a custom index.js to put into your lambda that pulls in the ses-forwarder via require and in your exports.handler add code that examines the function(event, context, callback) contents to determine the source of the event and then conditionally select a config from a list to pass to the LambdaForwarder.handler.

https://github.com/arithmetric/aws-lambda-ses-forwarder/blob/master/example/index.js

dragon788 avatar Aug 14 '20 20:08 dragon788