arithmetric / aws-lambda-ses-forwarder

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

SPAM checking/detecting/filtering #99 #121

Open peterhough opened 4 years ago

peterhough commented 4 years ago

Implemented Tharit's code from https://github.com/arithmetric/aws-lambda-ses-forwarder/issues/99 Included tests and config option.

peterhough commented 4 years ago

Having slept on this - an improvement could be that the config allows you to specify which spam checks to fail on e.g. Spam & Virus only.

Also, is throwing an error the right action? People might have CloudWatch Alarms for errors.

Guidance appreciated.

arithmetric commented 4 years ago

@peterhough, thanks for this contribution. It looks good, and I will give it a try.

I like your idea to allow configuration of the spam checks that block the message. The verdicts list with all of the checks is a good default if no configuration is given.

Also I agree that if a spam message is blocked, it would be better not to trigger the same type of error thrown for unexpected failures. To silently discard messages that do not match a forwarded address, the transformRecipients function uses return data.callback(); to call the Lambda's callback function to signal completion of the script.

ajhodges commented 3 years ago

Just wondering about the status of this PR. @peterhough did you have any thoughts on that feedback? I'd personally love to get this merged so I'm willing to take over the PR if you've run out of bandwidth.

peterhough commented 3 years ago

Hi @ajhodges

Thanks for the nudge; the feedback all makes sense to me. Those tweaks just need to be implemented and tested.

At the moment I'm on a limited development environment so if you're happy to pick this up I'm more than happy for you to pick this up.

Cheers

cbschuld commented 2 years ago

@peterhough thx for this update; I ended up taking Joe's great work here and updated it to be TypeScript and set it up to be released via the AWS CDK if you are interested (https://github.com/cbschuld/aws-lambda-ses-forwarder-cdk).