aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/admin_request_controller.rb9
-rw-r--r--app/models/request_mailer.rb6
-rw-r--r--lib/tmail_extensions.rb8
-rw-r--r--todo.txt7
4 files changed, 21 insertions, 9 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb
index b8b9fb56a..eb164a872 100644
--- a/app/controllers/admin_request_controller.rb
+++ b/app/controllers/admin_request_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: admin_request_controller.rb,v 1.39 2009-09-07 16:35:05 francis Exp $
+# $Id: admin_request_controller.rb,v 1.40 2009-09-08 04:12:08 francis Exp $
class AdminRequestController < AdminController
def index
@@ -247,7 +247,12 @@ class AdminRequestController < AdminController
# 2. Match the email address in the message without matching the hash
@info_requests = []
- for address in (@raw_email.incoming_message.mail.to || []) + (@raw_email.incoming_message.mail.cc || [])
+ addresses =
+ (@raw_email.incoming_message.mail.to || []) +
+ (@raw_email.incoming_message.mail.cc || []) +
+ (@raw_email.incoming_message.mail.envelope_to || [])
+ addresses.uniq!
+ for address in addresses
@info_requests += InfoRequest.guess_by_incoming_email(address)
end
end
diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb
index 30b73d7dd..f4a7b6448 100644
--- a/app/models/request_mailer.rb
+++ b/app/models/request_mailer.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: request_mailer.rb,v 1.83 2009-09-02 09:39:34 francis Exp $
+# $Id: request_mailer.rb,v 1.84 2009-09-08 04:12:09 francis Exp $
class RequestMailer < ApplicationMailer
@@ -239,7 +239,9 @@ class RequestMailer < ApplicationMailer
# Member function, called on the new class made in self.receive above
def receive(email, raw_email)
# Find which info requests the email is for
- reply_info_requests = []
+ # We deliberately don't use Envelope-to here, so ones that are BCC
+ # drop into the holding pen for checking.
+ reply_info_requests = [] # XXX should be set?
for address in (email.to || []) + (email.cc || [])
reply_info_request = InfoRequest.find_by_incoming_email(address)
reply_info_requests.push(reply_info_request) if reply_info_request
diff --git a/lib/tmail_extensions.rb b/lib/tmail_extensions.rb
index e49e74859..ef882e850 100644
--- a/lib/tmail_extensions.rb
+++ b/lib/tmail_extensions.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: tmail_extensions.rb,v 1.5 2009-07-01 11:07:20 francis Exp $
+# $Id: tmail_extensions.rb,v 1.6 2009-09-08 04:12:09 francis Exp $
# Monkeypatch!
@@ -29,6 +29,12 @@ module TMail
end
end
+ # Generalisation of To:, Cc:
+ def envelope_to(default = nil)
+ # XXX assumes only one envelope-to, and no parsing needed
+ val = self.header_string('envelope-to')
+ return val ? [val,] : []
+ end
end
class Address
diff --git a/todo.txt b/todo.txt
index ca95cb712..cee1ec874 100644
--- a/todo.txt
+++ b/todo.txt
@@ -11,11 +11,10 @@ Things to make bots not crawl:
Next (things that will reduce admin time mainly)
====
-Factor out "defunct/not_apply" from request_email into own field so defunct
-authorities can still have followups to existing requests. Probably into tags.
-* When you do follow up to authority that is defunct/not_apply explain this
+defunct/not_apply stuff
+* When you do reply / follow up to authority that is defunct/not_apply mention it
http://www.whatdotheyknow.com/request/14960/response/39838#followup
-* Fix up text when you send follow up and it no longer exists
+* Fix up text when you send follow up and the authority no longer exists
http://www.whatdotheyknow.com/request/14960/response#followup
Have proper house rules / site terms and conditions page.