arithmetric / aws-lambda-ses-forwarder

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

Added optional email cleanup on S3 at end of process #73

Open nbcraft opened 6 years ago

jakubboucek commented 6 years ago

Looks good. But probably unnecessary, because you can set on bucket LifeCycle Management to expire object. For example: you can set to delete received ecah email after 1 day.

nbcraft commented 6 years ago

Yeah I saw that after developing the feature.. 😞 But one argument for it though is that it will delete only if the rest of the process went through, preventing a cleanup by the bucket LifeCycle Management when something went wrong and an email wasn't properly forwarded. It's up to you guys 😉 EDIT: Also Travis crashed because I force pushed (I've seen that in the past), start it again if you please.

jakubboucek commented 6 years ago

Back to our discussion: you are right, but my experience is:

Set LifeCycle to 1 week at least. It is good for keep stack cleaned, but still ready to debug when some some is forwarded, but looks corrupted. When you want to erase is manually after success redirect, is appropriate to turn on versioning to able recovery deleted messages for unexpected fails and then must it clear it again by LifeCycle - OK, but it looks (for me) as the same concept, but more complex.

But you have right, deleting of bucket objects can be useful for some users.

Thanks you for contribution 👍

nbcraft commented 6 years ago

Updated PR from recommendations.

astrocycles commented 6 years ago

Hi, I'm interested to ad a lifecycle to 1 week, but i don't know how to write this piece of code and where. could you please help ? many thanks ps : great forward tool btw ! I'm using it everyday