2
0
Fork 0
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:
Régis Hanol 2015-12-21 17:54:02 +01:00
parent b3198d7a6a
commit 3e923c7a41
2 changed files with 34 additions and 1 deletions

View file

@ -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]