Since most of the ingress controllers receive raw MIME data in POST body,
it is impossible to guaratee that these are in UTF-8 as email comes in all
possible encodings.
This patch disables force transcoding to UTF-8 by ActionController params
processing for params that contain RAW MIME email bodies.
Fix#46297
Prior to this commit, when adding attachments to an inbound email
through the conductor, the log would warn of an unpermitted parameter
with the message:
> Unpermitted parameter: :attachments. Context: { }
Also, if an application had the setting:
config.action_controller.action_on_unpermitted_parameters = :raise
it would raise an error, because the attachments are not a permitted
parameter.
This commit also sets `action_on_unpermitted_parameters` to `:raise`
for the action mailbox test suite, so that tests are run in most
restrictive setting available, to prevent future unpermitted parameters
from being passed by conductor actions.
Co-authored-by: Dana Henke <danapalazzo1@gmail.com>
This is imperfect in situations when a separation
between regular files (such as uploads) and emails
is necessary (for the purposes of regulatory compliance,
proper compartmentalization, etc.)
Solution: allow configuring ActionMailbox's storage service
Sendgrid, like Mailgun, only passes BCC recipients as a parameter in the original JSON payload.
This PR adds code to prepend the recipients from the Sendgrid payload to the raw_email under the X-Original-To header.
References #38738.
Mandrill's Inbound API checks to see if a URL exists before it creates
the webhook. It sends a HEAD request, to which we now return a 200 OK
response to indicate that the route exists.
Now we can generate inbound API calls with ease on Mandrill, without
having to shuffle around tokens in production.
Fixes#37609.
* Add a way to deliver inbound emails by source
Great for testing when you get an eml file and can just paste it in.
* Test updates
* Fix tests
* Fix spacing
Expose the Mailgun SMTP recipient to Action Mailbox as X-Original-To, like Postfix.
Allows handling BCCed recipients who aren't listed in To/CC fields.
Allow passing a block to the create_inbound_email_from_mail and
receive_inbound_email_from_mail test helper methods.
When you wanted to test a multipart email -- for example, an email that
has both a plaintext part and an HTML part -- there wasn't a way to
easily build one without a pre-made fixture. By allowing you to pass a
block to these methods, we unlock the power of Mail.new to easily
create a variety of emails, from multi-part emails, to emails with
attachments, and beyond.