aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2011-09-05 11:15:00 +0100
committerRobin Houston <robin.houston@gmail.com>2011-09-05 11:15:00 +0100
commit1a1c14a4fad937c620bd2217d4a0ec2c092e0d33 (patch)
tree7c413f59320a1abfc2e76f94d629a043af7bdbaf
parente0b2a515ade57c56a09fc43ff4639d993b43daab (diff)
Suppress out-of-office responses from MS Exchange
Add an explicit "X-Auto-Response-Suppress: OOF" header to outgoing request messages, because MS Exchange does not seem to honour the RFC3834 "Auto-Submitted: auto-generated" header we are already using.
-rw-r--r--app/models/request_mailer.rb24
1 files changed, 16 insertions, 8 deletions
diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb
index e244aaac9..f46ce33c5 100644
--- a/app/models/request_mailer.rb
+++ b/app/models/request_mailer.rb
@@ -61,7 +61,8 @@ class RequestMailer < ApplicationMailer
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
@subject = "New response to your FOI request - " + info_request.title
@body = { :incoming_message => incoming_message, :info_request => info_request, :url => url }
@@ -79,7 +80,8 @@ class RequestMailer < ApplicationMailer
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = user.name_and_email
@subject = "Delayed response to your FOI request - " + info_request.title
@body = { :info_request => info_request, :url => url }
@@ -97,7 +99,8 @@ class RequestMailer < ApplicationMailer
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = user.name_and_email
@subject = "You're long overdue a response to your FOI request - " + info_request.title
@body = { :info_request => info_request, :url => url }
@@ -116,7 +119,8 @@ class RequestMailer < ApplicationMailer
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
@subject = "Was the response you got to your FOI request any good?"
@body = { :incoming_message => incoming_message, :info_request => info_request, :url => url }
@@ -126,7 +130,8 @@ class RequestMailer < ApplicationMailer
def old_unclassified_updated(info_request)
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
@subject = "Someone has updated the status of your request"
url = main_url(request_url(info_request))
@@ -146,7 +151,8 @@ class RequestMailer < ApplicationMailer
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
@subject = "Clarify your FOI request - " + info_request.title
@body = { :incoming_message => incoming_message, :info_request => info_request, :url => url }
@@ -156,7 +162,8 @@ class RequestMailer < ApplicationMailer
def comment_on_alert(info_request, comment)
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
@subject = "Somebody added a note to your FOI request - " + info_request.title
@body = { :comment => comment, :info_request => info_request, :url => main_url(comment_url(comment)) }
@@ -164,7 +171,8 @@ class RequestMailer < ApplicationMailer
def comment_on_alert_plural(info_request, count, earliest_unalerted_comment)
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
- 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834
+ 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
@subject = "Some notes have been added to your FOI request - " + info_request.title
@body = { :count => count, :info_request => info_request, :url => main_url(comment_url(earliest_unalerted_comment)) }