Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colon symbol in address name #144

Closed
aliismayilov opened this issue Dec 30, 2013 · 2 comments
Closed

Colon symbol in address name #144

aliismayilov opened this issue Dec 30, 2013 · 2 comments

Comments

@aliismayilov
Copy link

let!(:mail) { IssueNotifierMailer.digest }

it { expect(mail).to deliver_from("HE:tech <tech@example.com>") }

Our company has a colon in its name. Sending from HE:tech <tech@example.com> does not create any problems. But when I try to test it with expect(mail).to deliver_from("HE:tech <tech@example.com>") I receive following error:

Failure/Error: it { expect(mail).to deliver_from("HE:tech <tech@example.com>") }
Mail::Field::ParseError:
  Mail::AddressListsParser can not parse |HE:tech <tech@example.com>|
  Reason was: Expected one of
  , (, ,, ; at line 1, column 29 (byte 29) after :tech <tech@example.com>
@rodrigopinto
Copy link

@aliismayilov It isn't an issue. I took a look and it's raised by mail gem. Mail gem implementation follows a RFC. So, I put below the reason of not accept colon on any email header body.

2.2. Header Fields

   Header fields are lines composed of a field name, followed by a colon
   (":"), followed by a field body, and terminated by CRLF.  A field
   name MUST be composed of printable US-ASCII characters (i.e.,
   characters that have values between 33 and 126, inclusive), except
   colon.  A field body may be composed of any US-ASCII characters,
   except for CR and LF.  However, a field body may contain CRLF when
   used in header "folding" and  "unfolding" as described in section
   2.2.3.  All field bodies MUST conform to the syntax described in
   sections 3 and 4 of this standard.

@sirkosi
Copy link
Contributor

sirkosi commented May 3, 2016

All non-standard characters need to be in quotes according to RFC822.
The email mentioned should be something like "HE:tech" <tech@example.com>

I'm closing this issue, thanks.

@sirkosi sirkosi closed this as completed May 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants