Include the email subject line in rejection messages

This change has a tradeoff.
It increases our backscatter vulnerability - the subject could have spammy content - but it's extremely valuable to the user to know exactly which message was rejected.
If you sent two at the same time, and only one was rejected, you would have no way of knowing which worked and which to resend without going to the website (which is what email-in is trying to avoid, kinda).
This commit is contained in:
riking
2014-07-17 10:04:02 -07:00
parent 1682f5d584
commit c8d322d1be
4 changed files with 15 additions and 21 deletions

View File

@@ -44,14 +44,7 @@ describe Jobs::PollMailbox do
describe "processing email" do
let!(:receiver) { mock }
let!(:email_string) { <<MAIL
From: user@example.com
To: reply+32@discourse.example.net
Subject: Hi
Email As a String
MAIL
}
let!(:email_string) { fixture_file("emails/valid_incoming.eml") }
let!(:email) { mock }
before do
@@ -82,7 +75,7 @@ MAIL
sender_object = mock
RejectionMailer.expects(:send_rejection).with(
message.from, message.body, message.to, :email_reject_trust_level
message.from, message.body, message.subject, message.to, :email_reject_trust_level
).returns(client_message)
Email::Sender.expects(:new).with(client_message, :email_reject_trust_level).returns(sender_object)
sender_object.expects(:send)