Skip to content

denkungsart/actionmailbox-amazon-ses-ingress

Repository files navigation

ActionMailboxAmazonSesIngress

Provides Amazon SES/S3/SNS integration with Rails ActionMailbox.

Installation

Add following line to your application's Gemfile:

gem 'actionmailbox_amazon_ses_ingress', github: "denkungsart/actionmailbox-amazon-ses-ingress"

Configuration

Amazon SES/S3/SNS

Configure the SES to deliver incoming emails to an S3 bucket and notify an SNS topic.

If your website is hosted at https://www.example.com then configure an SNS subscription to publish the SES notification to this HTTPS endpoint:

https://example.com/rails/action_mailbox/amazon_ses/inbound_emails

Rails

Configure ActionMailbox to accept emails from Amazon SES:

# config/environments/production.rb
config.action_mailbox.ingress = :amazon_ses

Configure SNS topics and S3 credentials:

# config/mailbox.yml
production:
  amazon_ses:
    subscribed_topics:
    - <%= ENV["SNS_TOPIC_ARN_1"] %>
    - <%= ENV["SNS_TOPIC_ARN_2"] %>
    s3:
      access_key_id: <%= ENV["AWS_ACCESS_KEY_ID"] %>
      secret_access_key: <%= ENV["AWS_SECRET_ACCESS_KEY"] %>

Credits

This gem was made possible by the contributions of Bob Farrell, Chris Ortman and Marco Borromeo to this pull request.