mikel/mail — Issue #354: Error parsing To field with an empty-string name
Author: blakem
Created: 2012-02-14 20:00:09+00:00
State: open

We ran into a parsing issue with an address that has an empty-string name. I believe both of these tests should pass, but the second one fails:

it "should parse without a name" do
to = Mail::ToField.new('', 'utf-8')
to.encoded.should eq "To: test@example.com\r\n"
end

it "should parse an empty name" do
to = Mail::ToField.new('"" ', 'utf-8')
to.encoded.should eq "To: test@example.com\r\n"
end

It fails with:

Failure/Error: to = Mail::ToField.new('"" ', 'utf-8')
Mail::Field::ParseError:
AddressListsParser can not parse |"" |
Reason was: Expected one of
, \ at line 1, column 2 (byte 2) after "

Any suggestions on where I should start to debug this?