diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/incoming_message.rb | 7 | ||||
-rw-r--r-- | app/views/request/_correspondence.rhtml | 9 |
2 files changed, 12 insertions, 4 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 16ae38b92..edc395ff4 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -1308,7 +1308,12 @@ class IncomingMessage < ActiveRecord::Base if !prefix.nil? && prefix.downcase.match(/^(postmaster|mailer-daemon|auto_reply|donotreply|no.reply)$/) return false end - + if !self.mail['return-path'].nil? && self.mail['return-path'].addr == "<>" + return false + end + if !self.mail['auto-submitted'].nil? && !self.mail['auto-submitted'].keys.empty? + return false + end return true end diff --git a/app/views/request/_correspondence.rhtml b/app/views/request/_correspondence.rhtml index 4e46347b8..9500591ea 100644 --- a/app/views/request/_correspondence.rhtml +++ b/app/views/request/_correspondence.rhtml @@ -25,8 +25,11 @@ if not incoming_message.nil? <%= link_to "Admin", admin_url("request/show_raw_email/" + incoming_message.raw_email_id.to_s) %> | <% end %> <%= link_to _("Link to this"), incoming_message_url(incoming_message) %> | - <%= link_to _("Reply to this message"), show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) + "#followup" %> - + <% if incoming_message.valid_to_reply_to? %> + <%= link_to _("Reply to this message"), show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) + "#followup" %> + <% else %> + <%= link_to _("Send follow up to the main FOI contact"), show_response_no_followup_url(:id => outgoing_message.info_request.id, :incoming_message_id => nil) + "#followup" %> + <% end %> </p> </div> <% @@ -55,7 +58,7 @@ elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type) --> <%= link_to _("Link to this"), outgoing_message_url(outgoing_message) %> | - <%= link_to _("Send follow up"), show_response_no_followup_url(:id => outgoing_message.info_request.id, :incoming_message_id => nil) + "#followup" %> + <%= link_to _("Send follow up to the main FOI contact"), show_response_no_followup_url(:id => outgoing_message.info_request.id, :incoming_message_id => nil) + "#followup" %> </p> </div> <% elsif [ 'resent', 'followup_resent' ].include?(info_request_event.event_type) %> |