diff --git a/lib/email/message_builder.rb b/lib/email/message_builder.rb index 4be0c89a4ce..3a2a6b17568 100644 --- a/lib/email/message_builder.rb +++ b/lib/email/message_builder.rb @@ -139,6 +139,9 @@ module Email 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] + # please, don't send us automatic responses... + result['X-Auto-Response-Suppress'] = 'All' + if allow_reply_by_email? result['X-Discourse-Reply-Key'] = reply_key result['Reply-To'] = reply_by_email_address diff --git a/spec/components/email/message_builder_spec.rb b/spec/components/email/message_builder_spec.rb index 6b4c9f9a908..eec704c6054 100644 --- a/spec/components/email/message_builder_spec.rb +++ b/spec/components/email/message_builder_spec.rb @@ -26,6 +26,10 @@ describe Email::MessageBuilder do expect(builder.build_args[:charset]).to eq("UTF-8") 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 "without allow_reply_by_email" do