From 6e36729b44673a0e77f03e100d094ebf020e8e32 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 28 Mar 2011 15:16:10 +0100 Subject: Monkeypatching TMail parser to fix case where multiple addresses in the to: field of an incoming email have unquoted display parts - with this patch, each address is returned by the TMail to() function, without it only the last one is returned. --- spec/lib/tmail_extensions_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/lib') diff --git a/spec/lib/tmail_extensions_spec.rb b/spec/lib/tmail_extensions_spec.rb index d1a56f2e2..41e8c8f4e 100644 --- a/spec/lib/tmail_extensions_spec.rb +++ b/spec/lib/tmail_extensions_spec.rb @@ -22,5 +22,11 @@ describe "when using TMail" do incoming_message.get_body_for_html_display() end + it 'should parse multiple to addresses with unqoted display names' do + example_file = File.join(Spec::Runner.configuration.fixture_path, 'multiple-unquoted-display-names.email') + mail = TMail::Mail.parse(File.read(example_file)) + mail.to.should == ["request-66666-caa77777@whatdotheyknow.com", "foi@example.com"] + end + end -- cgit v1.2.3