From: Go MAEDA Date: Sun, 26 Mar 2023 05:20:29 +0000 (+0000) Subject: Add LockedTopic exception to MailHandler (#38273). X-Git-Tag: 5.1.0~200 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=260ba2e04a02945f24068fe3402cf0b838b74d63;p=redmine.git Add LockedTopic exception to MailHandler (#38273). Patch by Felix Schäfer. git-svn-id: https://svn.redmine.org/redmine/trunk@22159 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 738feb30e..8a4084769 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -24,6 +24,7 @@ class MailHandler < ActionMailer::Base class UnauthorizedAction < StandardError; end class NotAllowedInProject < UnauthorizedAction; end class InsufficientPermissions < UnauthorizedAction; end + class LockedTopic < UnauthorizedAction; end class MissingInformation < StandardError; end class MissingContainer < StandardError; end @@ -301,7 +302,7 @@ class MailHandler < ActionMailer::Base add_attachments(reply) reply else - logger&.info "MailHandler: ignoring reply from [#{email.from.first}] to a locked topic" + raise LockedTopic, "ignoring reply to a locked message [#{message.id} #{message.subject}]" end end