aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/action_mailroom/inbound_emails_controller.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2018-09-27 17:39:13 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2018-09-27 17:39:13 -0700
commite1486aa3535005175ae9859daba44b1e1d67f1d1 (patch)
treed1623ac451b3662531f81ad439a4832dfa144665 /app/controllers/action_mailroom/inbound_emails_controller.rb
parentab92058bbdb3240dca2fbf51d86a720ee7bce1ca (diff)
downloadrails-e1486aa3535005175ae9859daba44b1e1d67f1d1.tar.gz
rails-e1486aa3535005175ae9859daba44b1e1d67f1d1.tar.bz2
rails-e1486aa3535005175ae9859daba44b1e1d67f1d1.zip
Flesh out conductor interface
Diffstat (limited to 'app/controllers/action_mailroom/inbound_emails_controller.rb')
-rw-r--r--app/controllers/action_mailroom/inbound_emails_controller.rb25
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