action_mailbox_amazon_ingress
action_mailbox_amazon_ingress copied to clipboard
Handles s3 action w/ additional kms encryption
Adds the ability to get the message from S3.
Very large emails can actually get omitted from SNS if they are too large over 256KB. There is event a special library in Java for playing with large message.
That being said, "easy" the solution is to store the SES email to an S3 bucket, get an SNS message saying its been stored in a bucket, then download the content from the bucket object.
I've added an "opinionated" version of this here. It also supports decrypting via KMS (happens under the hood).
Open to making edits if it needs massaging.
Hi, @armiiller , I really like the look of this - thanks a lot for submitting the PR.
The only feedback I have here is:
- Your changes have introduced a little bit of breakage in tests (only 2 tests failed, for the RSpec helpers - should hopefully be quite easy to fix)
- Your code could be refactored into smaller, more digestible methods (e.g. the S3
keycould be calculated in its own method) - It would be nice to see at least one test added for the new functionality (let me know if you need a hand with this)
- Please run
make testand ensure that everything passes - at the moment RSpec and Rubocop are both failing. Runningrubocop -Aauto-corrects the majority of issues so just a few remaining issues to resolve.
Overall though I am really happy with the quality of the work you've done here so I would have no problem merging it and putting out a new release if you could attend to the above points.
Thanks @bobf for the details reply - I'll work on adding your recommendations and put a mention to you here when done :)
@armiiller Thanks for the fixes on this. How close do you think you are for being ready to merge ? Take as much time as you need, no rush !
@bobf I saw your PR to the Rails core and am looking forward to it. In the meantime, how does this gem handle downloading emails via S3? I saw that this PR was closed: https://github.com/bobf/action_mailbox_amazon_ingress/pull/12/files
@ACPK Sorry for the slow response - currently this gem does not provide that functionality. It's not something I personally need (I use the gem for a product at work and it doesn't use the S3 pipeline).
I don't have any immediate plans to port that functionality in the gem but, if the Rails PR ends up getting rejected, I will be more incentivised to do it then. Otherwise, PRs are welcome ! The code is all there in the Rails PR so at least there's a functional reference to work from.
@ACPK this gem now has that
I guess the decrypting from KMS can be introduced too.