From bfb3fe634d8719336a40f1105d322ae2e9c2d0ad Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 3 Dec 2012 17:40:58 +0000 Subject: Delegate getting the from address of an incoming mail to the mail handler. --- app/models/info_request.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 0a06b84a2..3355b9443 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -434,11 +434,11 @@ public elsif self.allow_new_responses_from == 'anybody' allow = true elsif self.allow_new_responses_from == 'authority_only' - if email.from_addrs.nil? || email.from_addrs.size == 0 + sender_email = MailHandler.get_from_address(email) + if sender_email.nil? allow = false reason = _('Only the authority can reply to this request, but there is no "From" address to check against') else - sender_email = email.from_addrs[0].spec sender_domain = PublicBody.extract_domain_from_email(sender_email) reason = _("Only the authority can reply to this request, and I don't recognise the address this reply was sent from") allow = false -- cgit v1.2.3