mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FIX: ensure inactive users can't email in
This commit is contained in:
parent
b3198d7a6a
commit
3e923c7a41
2 changed files with 34 additions and 1 deletions
|
@ -20,6 +20,7 @@ module Email
|
|||
class InvalidPost < ProcessingError; end
|
||||
class ReplyUserNotFoundError < ProcessingError; end
|
||||
class ReplyUserNotMatchingError < ProcessingError; end
|
||||
class InactiveUserError < ProcessingError; end
|
||||
|
||||
attr_reader :body, :email_log
|
||||
|
||||
|
@ -58,8 +59,8 @@ module Email
|
|||
user_email = from.address
|
||||
user_name = from.display_name
|
||||
|
||||
# TODO: deal with suspended/inactive users
|
||||
user = User.find_by_email(user_email)
|
||||
raise InactiveUserError if user.present? && !user.active && !user.staged
|
||||
|
||||
# TODO: take advantage of all the "TO"s
|
||||
dest_info = dest_infos[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue