FIX: Never mark emails sent to mailing list mirror as auto-generated
This commit is contained in:
parent
abde97c5c0
commit
d7cd7e4dc7
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue