rails/actionmailbox
Dorian Marié ebf916af2e Fixes development Action Mailbox new mail form
I wanted to add a test for sending an attachment that is an empty string
and a file but got this error:

NoMethodError: undefined method `original_filename' for "#<Rack::Test::UploadedFile:0x000000010840d388>":String

Related: #44702

Fixes #45088

-----

Started POST "/rails/conductor/action_mailbox/inbound_emails" for ::1 at 2022-05-14 07:34:19 +0200
Processing by Rails::Conductor::ActionMailbox::InboundEmailsController#create as HTML
  Parameters: {"authenticity_token"=>"[FILTERED]", "mail"=>{"from"=>"", "to"=>"", "cc"=>"", "bcc"=>"", "x_original_to"=>"", "in_reply_to"=>"", "subject"=>"", "body"=>"", "attachments"=>[""]}, "commit"=>"Deliver inbound email"}
Completed 500 Internal Server Error in 7ms (ActiveRecord: 0.0ms | Allocations: 2600)

NoMethodError (undefined method `original_filename' for "":String

            mail.add_file(filename: attachment.original_filename, content: attachment.read)
                                              ^^^^^^^^^^^^^^^^^^):

actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:26:in `block (2 levels) in new_mail'
actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:25:in `each'
actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:25:in `block in new_mail'
<internal:kernel>:90:in `tap'
actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:23:in `new_mail'
actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:17:in `create'

Co-Authored-By: Patrício dos Santos <hello@psantos.dev>
2022-05-15 22:59:48 +02:00
..
app Fixes development Action Mailbox new mail form 2022-05-15 22:59:48 +02:00
bin Import Action Mailbox 2018-12-25 21:32:35 -05:00
config Implement ActionMailbox incinerate in conductor 2021-06-24 15:35:56 -03:00
db/migrate Allow changing text and blob size without giving the limit option 2019-01-29 06:49:32 +09:00
lib Merge pull request #44693 from ghousemohamed/fix-docs-related-gem-versions 2022-03-15 16:28:07 -04:00
test Fixes development Action Mailbox new mail form 2022-05-15 22:59:48 +02:00
.gitignore Remove redundant .gitignore entries 2020-02-07 14:05:23 -06:00
actionmailbox.gemspec Temporarily add net-gems as dependencies of frameworks that use mail 2022-01-05 17:42:40 +00:00
CHANGELOG.md Start Rails 7.1 development 2021-12-07 15:52:30 +00:00
MIT-LICENSE Bump license years to 2022 [ci-skip] 2022-01-01 15:22:15 +09:00
Rakefile add new frameworks to tasks/release.rb 2019-01-08 10:36:33 -08:00
README.md Remove the Amazon SES ingress 2019-04-14 12:15:54 -04:00

Action Mailbox

Action Mailbox routes incoming emails to controller-like mailboxes for processing in Rails. It ships with ingresses for Mailgun, Mandrill, Postmark, and SendGrid. You can also handle inbound mails directly via the built-in Exim, Postfix, and Qmail ingresses.

The inbound emails are turned into InboundEmail records using Active Record and feature lifecycle tracking, storage of the original email on cloud storage via Active Storage, and responsible data handling with on-by-default incineration.

These inbound emails are routed asynchronously using Active Job to one or several dedicated mailboxes, which are capable of interacting directly with the rest of your domain model.

You can read more about Action Mailbox in the Action Mailbox Basics guide.

License

Action Mailbox is released under the MIT License.