class ActionMailbox::Ingresses::Postmark::InboundEmailsController
content in JSON payload“*. Action Mailbox needs the raw email content to work.
NOTE: When configuring your Postmark inbound webhook, be sure to check the box labeled *”Include raw email
Postmark inbound webhook with the following fully-qualified URL:
previously generated. If your application lived at https://example.com
, you would configure your
to /rails/action_mailbox/postmark/inbound_emails
with the username actionmailbox
and the password you
3. Configure Postmark to forward inbound emails
Alternatively, provide the password in the RAILS_INBOUND_EMAIL_PASSWORD
environment variable.
ingress_password: …
action_mailbox:action_mailbox.ingress_password
, where Action Mailbox will automatically find it:
Use rails credentials:edit
to add the password to your application’s encrypted credentials under
2. Generate a strong password that Action Mailbox can use to authenticate requests to the Postmark ingress.
config.action_mailbox.ingress = :postmark
# config/environments/production.rb
1. Tell Action Mailbox to accept emails from Postmark:
== Usage
the Active Storage service, or the Active Job backend is misconfigured or unavailable
- 500 Server Error
if the ingress password is not configured, or if one of the Active Record database,
- 422 Unprocessable Entity
if the request is missing the required RawEmail
parameter
- 404 Not Found
if Action Mailbox is not configured to accept inbound emails from Postmark
- 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:
the Postmark ingress can learn its password. You should only use the Postmark ingress over HTTPS.
Note that basic authentication is insecure over unencrypted HTTP. An attacker that intercepts cleartext requests to
password is read from the application’s encrypted credentials or an environment variable. See the Usage section below.
Authenticates requests using HTTP basic access authentication. The username is always actionmailbox
, and the
Ingests inbound emails from Postmark. Requires a RawEmail
parameter containing a full RFC 822 message.
def create
def create ActionMailbox::InboundEmail.create_and_extract_message_id! params.require("RawEmail") rescue ActionController::ParameterMissing => error logger.error <<~MESSAGE #{error.message} When configuring your Postmark inbound webhook, be sure to check the box labeled "Include raw email content in JSON payload". MESSAGE head :unprocessable_entity end