FIX: Never mark emails sent to mailing list mirror as auto-generated

This commit is contained in:
Gerhard Schlager 2018-01-03 15:29:06 +01:00
parent abde97c5c0
commit d7cd7e4dc7
2 changed files with 3 additions and 2 deletions

View File

@ -105,10 +105,10 @@ module Email
raise NoBodyDetectedError if body.blank? && attachments.empty? 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) @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 raise AutoGeneratedEmailError
end end
end end

View File

@ -808,6 +808,7 @@ describe Email::Receiver do
it "should allow creating topic even when email is autogenerated" do it "should allow creating topic even when email is autogenerated" do
expect { process(:mailinglist) }.to change { Topic.count } expect { process(:mailinglist) }.to change { Topic.count }
expect(IncomingEmail.last.is_auto_generated).to eq(false)
end end
it "should allow replying without reply key" do it "should allow replying without reply key" do