aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/action_mailbox/callbacks.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/action_mailbox/callbacks.rb b/lib/action_mailbox/callbacks.rb
index 33caaafd2a..e8bf2ffd55 100644
--- a/lib/action_mailbox/callbacks.rb
+++ b/lib/action_mailbox/callbacks.rb
@@ -5,8 +5,19 @@ module ActionMailbox
extend ActiveSupport::Concern
include ActiveSupport::Callbacks
+ TERMINATOR = ->(target, chain) do
+ terminate = true
+
+ catch(:abort) do
+ chain.call
+ terminate = target.inbound_email.bounced?
+ end
+
+ terminate
+ end
+
included do
- define_callbacks :process
+ define_callbacks :process, terminator: TERMINATOR
end
module ClassMethods