FEATURE: phase 1 of supporting multiple email addresses

This commit is contained in:
Leo McArdle
2017-04-26 19:47:36 +01:00
committed by Guo Xiang Tan
parent 739794f0cb
commit d0b027d88d
35 changed files with 337 additions and 80 deletions

View File

@ -73,7 +73,7 @@ class Admin::EmailController < Admin::AdminController
params.require(:from)
params.require(:to)
# These strings aren't localized; they are sent to an anonymous SMTP user.
if !User.exists?(email: Email.downcase(params[:from])) && !SiteSetting.enable_staged_users
if !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?" }
elsif Email::Receiver.check_address(Email.downcase(params[:to])).nil?
render json: { reject: true, reason: "Mail to this address is not accepted. Check the address and try to send again?" }