Vacation/Out of office emails still processed as new replies

(mountain) #1

Continuing the discussion from Out of office replies to Digests are still being processed as new topics:

This is still happening. See this reply @ FeverBee.

(Jeff Atwood) #2

Sure @zogstrip can have a look. It’s usually a wildly misconfigured mail client.

(Régis Hanol) #3

Since that email has no header indicating it was auto-generated, that’s unfortunately the best I can do

(Eli the Bearded) #4

I don’t think it would hurt to add

X-Auto-Response-Suppress: All

to the headers of outgoing mail. Github and zendesk both seem to do that.

(Régis Hanol) #5

Sure, PRs are welcome :wink:

(Eli the Bearded) #6

Do you take patches?

--- lib/email/message_builder.rb.old    2016-08-01 15:58:26.397393755 -0700
+++ lib/email/message_builder.rb        2016-08-01 16:00:24.295659384 -0700
@@ -139,6 +139,9 @@
       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]
+      # auto-replies just need extra work later to ignore
+      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

Alternatively it looks like the code would accept just a config change:

--- config/site_settings.yml.old        2016-08-01 16:02:30.394083505 -0700
+++ config/site_settings.yml    2016-08-01 16:03:00.474661911 -0700
@@ -556,7 +556,7 @@
     default: false
     client: true
-  email_custom_headers: 'Auto-Submitted: auto-generated'
+  email_custom_headers: 'Auto-Submitted: auto-generated | X-Auto-Response-Suppress: All'
   email_subject: '[%{site_name}] %{optional_pm}%{optional_cat}%{topic_title}'
     default: false

(Jeff Atwood) #7

That looks legit:

(Régis Hanol) #8

We’d rather take pull request with tests. Anyway, I pushed the fix. Thanks for suggesting that :thumbsup:

(Régis Hanol) #9