chore: Stop processing auto-response emails (#9606)

Stop processing auto-response emails
https://www.notion.so/chatwoot/Avoid-Auto-Replies-sorcerer-s-apprentice-mode-55ffb09efbd7451994f1ff852de4c168?pvs=4
This commit is contained in:
Sojan Jose
2024-06-13 14:19:11 -07:00
committed by GitHub
parent 08516e6c43
commit 7968e98529
9 changed files with 1344 additions and 34 deletions

View File

@@ -58,9 +58,15 @@ RSpec.describe Imap::ImapMailbox do
let(:inbound_mail) { create_inbound_email_from_mail(from: 'invalidemail', to: 'imap@gmail.com', subject: 'Hello!') }
it 'does not create a new conversation' do
allow(Rails.logger).to receive(:error)
class_instance.process(inbound_mail.mail, channel)
expect(Rails.logger).to have_received(:error).with("Email from: invalidemail : inbox #{inbox.id} is invalid")
expect { class_instance.process(inbound_mail.mail, channel) }.not_to raise_error
end
end
context 'when an auto reply email' do
let(:auto_reply_mail) { create_inbound_email_from_fixture('auto_reply.eml') }
it 'does not create a new conversation' do
expect { class_instance.process(auto_reply_mail.mail, channel) }.not_to change(Conversation, :count)
end
end