diff options
-rw-r--r-- | app/views/public_body_change_requests/new.html.erb | 2 | ||||
-rw-r--r-- | config/initializers/alaveteli.rb | 2 | ||||
-rw-r--r-- | lib/mail_handler/backends/mail_backend.rb | 2 | ||||
-rw-r--r-- | spec/lib/mail_handler/mail_handler_spec.rb | 10 |
4 files changed, 13 insertions, 3 deletions
diff --git a/app/views/public_body_change_requests/new.html.erb b/app/views/public_body_change_requests/new.html.erb index b52d583be..9abe03732 100644 --- a/app/views/public_body_change_requests/new.html.erb +++ b/app/views/public_body_change_requests/new.html.erb @@ -12,7 +12,7 @@ <p> <label class="form_label" for="user_email"> - <%= ("Your email:") %> + <%= _("Your email:") %> </label> <%= f.text_field :user_email %> </p> diff --git a/config/initializers/alaveteli.rb b/config/initializers/alaveteli.rb index f4def4c2a..cda163a9b 100644 --- a/config/initializers/alaveteli.rb +++ b/config/initializers/alaveteli.rb @@ -11,7 +11,7 @@ load "debug_helpers.rb" load "util.rb" # Application version -ALAVETELI_VERSION = '0.21.0.30' +ALAVETELI_VERSION = '0.21.0.32' # Add new inflection rules using the following format # (all these examples are active by default): diff --git a/lib/mail_handler/backends/mail_backend.rb b/lib/mail_handler/backends/mail_backend.rb index 2f1052a0c..5a7e0ef65 100644 --- a/lib/mail_handler/backends/mail_backend.rb +++ b/lib/mail_handler/backends/mail_backend.rb @@ -124,7 +124,7 @@ module MailHandler envelope_to = mail['envelope-to'] ? [mail['envelope-to'].value.to_s] : [] ((mail.to || []) + (mail.cc || []) + - (envelope_to || [])).uniq + (envelope_to || [])).compact.uniq end def empty_return_path?(mail) diff --git a/spec/lib/mail_handler/mail_handler_spec.rb b/spec/lib/mail_handler/mail_handler_spec.rb index 7f0070a8a..27a7a3db4 100644 --- a/spec/lib/mail_handler/mail_handler_spec.rb +++ b/spec/lib/mail_handler/mail_handler_spec.rb @@ -158,6 +158,16 @@ describe 'when asked for all the addresses a mail has been sent to' do mail = MailHandler.mail_from_raw_email(mail_data) MailHandler.get_all_addresses(mail).should == ["request-5555-xxxxxxxx@whatdotheyknow.com"] end + + it 'should not return invalid addresses' do + mail_data = load_file_fixture('autoresponse-header.email') + mail_data.gsub!('To: FOI Person <EMAIL_TO>', + 'To: <request-5555-xxxxxxxx>') + mail = MailHandler.mail_from_raw_email(mail_data) + MailHandler.get_all_addresses(mail).should == [] + end + + end describe 'when asked for auto_submitted' do |