diff --git a/app/controllers/admin/email_controller.rb b/app/controllers/admin/email_controller.rb index b165827f4d..257c58061b 100644 --- a/app/controllers/admin/email_controller.rb +++ b/app/controllers/admin/email_controller.rb @@ -117,10 +117,9 @@ class Admin::EmailController < Admin::AdminController end def smtp_should_reject - params.require(:from) params.require(:to) # These strings aren't localized; they are sent to an anonymous SMTP user. - if !User.with_email(Email.downcase(params[:from])).exists? && !SiteSetting.enable_staged_users + if params[:from].present? && !User.with_email(Email.downcase(params[:from])).exists? && !SiteSetting.enable_staged_users render json: { reject: true, reason: "Mail from your address is not accepted. Do you have an account here?",