在 config/application.rb 中添加以下代码,允许 parameter_sanitizer 将 inbound_email 参数中的附件参数传递:
config.action_mailbox.ingress = :mailgun
Rails.application.config.action_controller.per_form_csrf_tokens = true
Rails.application.config.action_controller.forgery_protection_origin_check = true
Rails.application.config.action_controller.parameter_sanitizer.permit(:inbound_email, keys: [:attachments])