mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: don't use 'Return-Path' header to determine whether the email was auto generated
This commit is contained in:
parent
ce8c2d34d7
commit
27aaed0aa5
3 changed files with 0 additions and 12 deletions
|
@ -92,7 +92,6 @@ module Email
|
|||
end
|
||||
|
||||
def is_auto_generated?
|
||||
@mail.return_path.blank? ||
|
||||
@mail[:precedence].to_s[/list|junk|bulk|auto_reply/] ||
|
||||
@mail.header.to_s[/auto-(submitted|replied|generated)/]
|
||||
end
|
||||
|
|
|
@ -29,10 +29,6 @@ describe Email::Receiver do
|
|||
expect { Email::Receiver.new(email(:missing_message_id)) }.to raise_error(Email::Receiver::NoMessageIdError)
|
||||
end
|
||||
|
||||
it "raises an AutoGeneratedEmailError when the mail has no return path" do
|
||||
expect { process(:no_return_path) }.to raise_error(Email::Receiver::AutoGeneratedEmailError)
|
||||
end
|
||||
|
||||
it "raises an AutoGeneratedEmailError when the mail is auto generated" do
|
||||
expect { process(:auto_generated_precedence) }.to raise_error(Email::Receiver::AutoGeneratedEmailError)
|
||||
expect { process(:auto_generated_header) }.to raise_error(Email::Receiver::AutoGeneratedEmailError)
|
||||
|
|
7
spec/fixtures/emails/no_return_path.eml
vendored
7
spec/fixtures/emails/no_return_path.eml
vendored
|
@ -1,7 +0,0 @@
|
|||
From: Foo Bar <foo@bar.com>
|
||||
Date: Fri, 15 Jan 2016 00:12:43 +0100
|
||||
Message-ID: <1@foo.bar.mail>
|
||||
Precedence: list
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain
|
||||
Content-Transfer-Encoding: 7bit
|
Loading…
Reference in a new issue