mikel/mail — Issue #315: Parsing of email address error
Author: liufengyun
Created: 2011-12-16 07:47:03+00:00
State: open

I'm using rails 3.1 to receive emails, which depends on mail to parse incoming email. I encountered an error when receiving following email:

From: "xxxx"
To: Support@xxxx Support
Subject: Hello
Date: Fri, 9 Dec 2011 20:23:07 -0800 (PST)

hello, world

Normally, when I parse the raw email using `mail = Mail.new(raw)`, the output of `mail.to` should be an Array, but parsing of the email above output `ActiveSupport::Multibyte::Chars`, which I think it's wrong.

I've found that the problem has something to do with the `To` field. If the `To` field is following, it works without problem:

`To: "Support@xxx Support" `

If there's no `@`, following input works as well:

`To: Support xxx Support `