This commit is contained in:
Evgeni Golov 2023-03-18 00:01:43 -04:00 committed by GitHub
commit 7174e53d7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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?",