mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: don't allow blocked user to send emails in
This commit is contained in:
parent
5120dcfb3d
commit
cad7fc1062
6 changed files with 28 additions and 3 deletions
|
@ -13,6 +13,7 @@ module Email
|
|||
class AutoGeneratedEmailError < ProcessingError; end
|
||||
class NoBodyDetectedError < ProcessingError; end
|
||||
class InactiveUserError < ProcessingError; end
|
||||
class BlockedUserError < ProcessingError; end
|
||||
class BadDestinationAddress < ProcessingError; end
|
||||
class StrangersNotAllowedError < ProcessingError; end
|
||||
class InsufficientTrustLevelError < ProcessingError; end
|
||||
|
@ -53,8 +54,9 @@ module Email
|
|||
body = select_body || ""
|
||||
|
||||
raise AutoGeneratedEmailError if is_auto_generated?
|
||||
raise NoBodyDetectedError if body.blank? && !@mail.has_attachments?
|
||||
raise InactiveUserError if !user.active && !user.staged
|
||||
raise NoBodyDetectedError if body.blank? && !@mail.has_attachments?
|
||||
raise InactiveUserError if !user.active && !user.staged
|
||||
raise BlockedUserError if user.blocked
|
||||
|
||||
if action = subscription_action_for(body, subject)
|
||||
message = SubscriptionMailer.send(action, user)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue