Vacation/Out of office emails still processed as new replies

AI-generated summary

The discussion addresses a bug where vacation and out-of-office emails are incorrectly processed as new replies. purldator confirms the issue persists, citing an example from FeverBee. codinghorror suggests the root cause is often a misconfigured mail client, though zogstrip notes the specific email lacks auto-generated headers.

elijah proposes adding the X-Auto-Response-Suppress: All header to outgoing Discourse emails, similar to how GitHub and Zendesk handle it. They provided two implementation options: a direct code change in lib/email/message_builder.rb or a configuration update to email_custom_headers. codinghorror verified the header’s validity via ServerFault. zogstrip accepted the solution but requested a pull request with tests before merging. However, they ultimately pushed the fix immediately, thanking elijah for the suggestion and providing the commit link.

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.

1 Like

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

3 Likes

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

https://github.com/discourse/discourse/commit/ca4c939e9a2d6c202ab84841d255f00570f02f45

2 Likes

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.

1 Like

Sure, PRs are welcome :wink:

1 Like

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 @@
   disable_digest_emails:
     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}'
   reply_by_email_enabled:
     default: false
3 Likes

That looks legit:

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

https://github.com/discourse/discourse/commit/b08ab829b80794edb9fdb987d394c84a4ba3417e

4 Likes