class ActionMailbox::Ingresses::Amazon::InboundEmailsController

https://example.com/rails/action_mailbox/amazon/inbound_emails.
If your application lived at https://example.com, you would specify the fully-qualified URL
to deliver emails to your application via POST requests to /rails/action_mailbox/amazon/inbound_emails.
3. {Configure SES}[https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-notifications.html]

config.action_mailbox.ingress = :amazon
# config/environments/production.rb
2. Tell Action Mailbox to accept emails from SES:
gem “aws-sdk-sns”, “>= 1.9.0”, require: false
# Gemfile
1. Install the aws-sdk-sns gem:
== Usage
the Active Job backend is misconfigured or unavailable
- 500 Server Error if one of the Active Record database, the Active Storage service, or
- 422 Unprocessable Entity if the request is missing the required content parameter
- 404 Not Found if Action Mailbox is not configured to accept inbound emails from SES
- 401 Unauthorized if the request’s signature could not be validated
- 204 No Content if an inbound email is successfully recorded and enqueued for routing to the appropriate mailbox
Returns:
Requires the full RFC 822 message in the content parameter. Authenticates requests by validating their signatures.
Ingests inbound emails from Amazon’s Simple Email Service (SES).

def self.prepare

def self.prepare
  self.verifier ||= begin
    require "aws-sdk-sns"
    Aws::SNS::MessageVerifier.new
  end
end

def authenticate

def authenticate
  head :unauthorized unless verifier.authentic?(request.body)
end

def create

def create
  ActionMailbox::InboundEmail.create_and_extract_message_id! params.require(:content)
end