mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:41:25 +08:00
FEATURE: phase 1 of supporting multiple email addresses
This commit is contained in:

committed by
Guo Xiang Tan

parent
739794f0cb
commit
d0b027d88d
@ -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?" }
|
||||
|
Reference in New Issue
Block a user