mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 13:24:33 +08:00
FEATURE: add support for bounce emails
We now optionally add a Variable Email Return Path to every email we send. This allows us to cleanly handle email bounces, which in turn will improve deliverability.
This commit is contained in:
@ -77,6 +77,28 @@ describe Email::Sender do
|
||||
email_sender.send
|
||||
end
|
||||
|
||||
context "adds return_path correctly when no plus addressing" do
|
||||
before do
|
||||
SiteSetting.bounce_email = 'bounce@test.com'
|
||||
end
|
||||
|
||||
When { email_sender.send }
|
||||
Then {
|
||||
expect(message.header[:return_path].to_s).to eq("bounce+#{EmailLog.last.bounce_key}@test.com")
|
||||
}
|
||||
end
|
||||
|
||||
context "adds return_path correctly with plus addressing" do
|
||||
before do
|
||||
SiteSetting.bounce_email = 'bounce+meta@test.com'
|
||||
end
|
||||
|
||||
When { email_sender.send }
|
||||
Then {
|
||||
expect(message.header[:return_path].to_s).to eq("bounce+meta-#{EmailLog.last.bounce_key}@test.com")
|
||||
}
|
||||
end
|
||||
|
||||
context "adds a List-ID header to identify the forum" do
|
||||
before do
|
||||
category = Fabricate(:category, name: 'Name With Space')
|
||||
|
Reference in New Issue
Block a user