Closed romarioliveira25 closed 4 years ago
@romarioliveira25 Hi, thanks for providing a detailed error report - I will try to take a closer look at this in my free time.
For the time being, you may be interested in this PR which (hopefully !) will mean SES integration will be included in Rails 6.1 - I am just waiting for the Rails devs to approve/provide further feedback on the PR: https://github.com/rails/rails/pull/39364
Will try to get back to you this weekend on your issues with the standalone gem.
Perfect! Thank's for your time. And I found your gem at the rails PR haha
@romarioliveira25 I finally managed to find some time to look at this.
I was able to recreate the error:
[ActiveJob] [ActionMailbox::RoutingJob] [531cb2d2-d35d-484f-8d53-de7b2b937b4a] Error performing ActionMailbox::RoutingJob (Job ID: 531cb2d2-d35d-484f-8d53-de7b2b937b4a) from Async(action_mailbox_routing) in 39.07ms: ActionMailbox::Router::RoutingError (ActionMailbox::Router::RoutingError):
You just need to add some extra ActionMailbox configuration:
# app/mailboxes/application_mailbox.rb
class ApplicationMailbox < ActionMailbox::Base
routing /.*/ => :defaults
end
# app/mailboxes/defaults_mailbox.rb
class DefaultsMailbox < ApplicationMailbox
def process
puts mail
end
end
You'll need to adjust to suit your needs but you need to define at least one route so Rails/ActionMailbox will know where to route the incoming mail to.
I've created a demo repository for you here: https://github.com/bobf/action_mailbox_amazon_ingress_demo
You'll need to edit config/application.rb
to set the ARN for the SNS topic but otherwise it should work out of the box - I tested using Ngrok and had no issues.
See this documentation for further reference: https://api.rubyonrails.org/classes/ActionMailbox/Base.html
Let me know how it goes !
Hi again @bobf, one more time, thanks for your support.
I'm really wasn't create a default routing (although I'm not sure that issue is related with that)
About the SNS topic, I did the config as mentioned at the docs shared by you at the repo.
So, while I was waiting for your response, I have tested the griddler gem, but with that I checked one limitation to use AWS SES for receive email purposes related to the large payload, because I need receive emails with attachments and it exceeds the limit of 256KB in AWS SNS Notification.
AWS docs: https://docs.aws.amazon.com/sns/latest/dg/sns-large-payload-raw-message-delivery.html
First of all, thanks for your contribution with this gem, was a greate initiave after discontinuing native support.
So, after make all setup on AWS SES (Verifying domain and Email receive rule sets) and SNS (Creating topics and related subscriptions), I have experieced the following error.
The
POST
request is fired from AWS and the tablesaction_mailbox_inbound_emails
,active_storage_blobs
,active_storage_attachments
are filled, but on performingActionMailbox::RoutingJob
the error occurs.Can provide any help to solve this?