2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-10 12:04:21 +08:00

FIX: Don't create staged users when processing forwarded email fails

This commit is contained in:
Gerhard Schlager 2019-05-09 23:47:32 +02:00
parent ccc1e85bf4
commit 4a1755b780
3 changed files with 45 additions and 2 deletions

View file

@ -802,13 +802,13 @@ module Email
return false if email.blank? || !email["@"]
embedded_user = find_or_create_user(email, display_name)
raw = try_to_encode(embedded.decoded, "UTF-8").presence || embedded.to_s
title = embedded.subject.presence || subject
case destination[:type]
when :group
group = destination[:obj]
embedded_user = find_or_create_user(email, display_name)
post = create_topic(user: embedded_user,
raw: raw,
title: title,
@ -825,6 +825,7 @@ module Email
return false if user.staged? && !category.email_in_allow_strangers
return false if !user.has_trust_level?(SiteSetting.email_in_min_trust)
embedded_user = find_or_create_user(email, display_name)
post = create_topic(user: embedded_user,
raw: raw,
title: title,