diff --git a/lib/email/receiver.rb b/lib/email/receiver.rb index 1cf9754b259..2f577faa6d0 100644 --- a/lib/email/receiver.rb +++ b/lib/email/receiver.rb @@ -105,10 +105,10 @@ module Email raise NoBodyDetectedError if body.blank? && attachments.empty? - if is_auto_generated? + if is_auto_generated? && !sent_to_mailinglist_mirror? @incoming_email.update_columns(is_auto_generated: true) - if SiteSetting.block_auto_generated_emails? && !sent_to_mailinglist_mirror? + if SiteSetting.block_auto_generated_emails? raise AutoGeneratedEmailError end end diff --git a/spec/components/email/receiver_spec.rb b/spec/components/email/receiver_spec.rb index d9da0a04351..5409212ebad 100644 --- a/spec/components/email/receiver_spec.rb +++ b/spec/components/email/receiver_spec.rb @@ -808,6 +808,7 @@ describe Email::Receiver do it "should allow creating topic even when email is autogenerated" do expect { process(:mailinglist) }.to change { Topic.count } + expect(IncomingEmail.last.is_auto_generated).to eq(false) end it "should allow replying without reply key" do