added 'X-Auto-Response-Suppress' email header (props to elijah)

This commit is contained in:
Régis Hanol 2016-08-03 11:02:07 +02:00
parent 1ae625ec2e
commit b08ab829b8
2 changed files with 7 additions and 0 deletions

View File

@ -139,6 +139,9 @@ module Email
result['X-Discourse-Post-Id'] = @opts[:post_id].to_s if @opts[:post_id] result['X-Discourse-Post-Id'] = @opts[:post_id].to_s if @opts[:post_id]
result['X-Discourse-Topic-Id'] = @opts[:topic_id].to_s if @opts[:topic_id] result['X-Discourse-Topic-Id'] = @opts[:topic_id].to_s if @opts[:topic_id]
# please, don't send us automatic responses...
result['X-Auto-Response-Suppress'] = 'All'
if allow_reply_by_email? if allow_reply_by_email?
result['X-Discourse-Reply-Key'] = reply_key result['X-Discourse-Reply-Key'] = reply_key
result['Reply-To'] = reply_by_email_address result['Reply-To'] = reply_by_email_address

View File

@ -26,6 +26,10 @@ describe Email::MessageBuilder do
expect(builder.build_args[:charset]).to eq("UTF-8") expect(builder.build_args[:charset]).to eq("UTF-8")
end end
it "ask politely not to receive automated responses" do
expect(header_args['X-Auto-Response-Suppress']).to eq("All")
end
context "reply by email" do context "reply by email" do
context "without allow_reply_by_email" do context "without allow_reply_by_email" do