diff options
Diffstat (limited to 'app/controllers/action_mailroom')
-rw-r--r-- | app/controllers/action_mailroom/inbound_emails_controller.rb | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/app/controllers/action_mailroom/inbound_emails_controller.rb b/app/controllers/action_mailroom/inbound_emails_controller.rb index b8fa6cde49..0723bd39c3 100644 --- a/app/controllers/action_mailroom/inbound_emails_controller.rb +++ b/app/controllers/action_mailroom/inbound_emails_controller.rb @@ -2,38 +2,15 @@ # TODO: Spam/malware catching? # TODO: Specific bounces for SMTP good citizenship: 200/404/400 class ActionMailroom::InboundEmailsController < ActionController::Base - layout "action_mailroom" - skip_forgery_protection - before_action :ensure_development_env, except: :create before_action :require_rfc822_message, only: :create - def index - @inbound_emails = ActionMailroom::InboundEmail.order(created_at: :desc) - end - - def new - end - - def show - @inbound_email = ActionMailroom::InboundEmail.find(params[:id]) - end - def create ActionMailroom::InboundEmail.create_from_raw_email!(params[:message]) - - respond_to do |format| - format.html { redirect_to main_app.rails_new_inbound_email_url } - format.any { head :created } - end + head :created end private - # TODO: Should probably separate the admin interface and do more to ensure that it isn't exposed to the web - def ensure_development_env - head :forbidden unless Rails.env.development? - end - def require_rfc822_message head :unsupported_media_type unless params.require(:message).content_type == 'message/rfc822' end |