]> source.dussan.org Git - redmine.git/commitdiff
Add LockedTopic exception to MailHandler (#38273).
authorGo MAEDA <maeda@farend.jp>
Sun, 26 Mar 2023 05:20:29 +0000 (05:20 +0000)
committerGo MAEDA <maeda@farend.jp>
Sun, 26 Mar 2023 05:20:29 +0000 (05:20 +0000)
Patch by Felix Schäfer.

git-svn-id: https://svn.redmine.org/redmine/trunk@22159 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/mail_handler.rb

index 738feb30e3b7faeb5a7388f708f2c75906cbdb7a..8a4084769072814e8d279136a63985a6e49fca51 100644 (file)
@@ -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