Fix: prevent IMAPBadResponse exception from sending the authorization mail (#7154)
This commit is contained in:
@@ -7,9 +7,10 @@ class Inboxes::FetchImapEmailsJob < ApplicationJob
|
|||||||
return unless should_fetch_email?(channel)
|
return unless should_fetch_email?(channel)
|
||||||
|
|
||||||
process_email_for_channel(channel)
|
process_email_for_channel(channel)
|
||||||
rescue *ExceptionList::IMAP_EXCEPTIONS
|
rescue *ExceptionList::IMAP_EXCEPTIONS => e
|
||||||
|
Rails.logger.error e
|
||||||
channel.authorization_error!
|
channel.authorization_error!
|
||||||
rescue EOFError, OpenSSL::SSL::SSLError => e
|
rescue EOFError, OpenSSL::SSL::SSLError, Net::IMAP::NoResponseError => e
|
||||||
Rails.logger.error e
|
Rails.logger.error e
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
ChatwootExceptionTracker.new(e, account: channel.account).capture_exception
|
ChatwootExceptionTracker.new(e, account: channel.account).capture_exception
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ module ExceptionList
|
|||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
IMAP_EXCEPTIONS = [
|
IMAP_EXCEPTIONS = [
|
||||||
Errno::ECONNREFUSED, Net::OpenTimeout, Net::IMAP::NoResponseError,
|
Errno::ECONNREFUSED, Net::OpenTimeout,
|
||||||
Errno::ECONNRESET, Errno::ENETUNREACH, Net::IMAP::ByeResponseError,
|
Errno::ECONNRESET, Errno::ENETUNREACH, Net::IMAP::ByeResponseError,
|
||||||
SocketError
|
SocketError
|
||||||
].freeze
|
].freeze
|
||||||
|
|||||||
Reference in New Issue
Block a user