Skip to content

Commit

Permalink
Correctly parse addresses that begin with a comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
bpot committed May 13, 2013
1 parent ab2af8c commit 1505198
Show file tree
Hide file tree
Showing 8 changed files with 15,982 additions and 15,804 deletions.
2 changes: 1 addition & 1 deletion lib/mail/parsers/address_lists_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def parse(s)
# Ignore address end events if they don't have
# a matching address start event.
next if address_s.nil?
if address.local.nil? && local_dot_atom_pre_comment_e && local_dot_atom_e
if address.local.nil? && local_dot_atom_pre_comment_e && local_dot_atom_s && local_dot_atom_e
if address.domain
address.local = s[local_dot_atom_s..local_dot_atom_e] if address
else
Expand Down
6 changes: 3 additions & 3 deletions lib/mail/parsers/ragel/common.rl
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
# local_part:
domain_text = (DQUOTE (FWS? qcontent)+ FWS? DQUOTE) | atext+;
local_dot_atom_text = ("."* domain_text "."*)+;
local_dot_atom = (CFWS?
local_dot_atom_text %local_dot_atom_pre_comment_e
CFWS?);
local_dot_atom = CFWS?
(local_dot_atom_text >local_dot_atom_s %local_dot_atom_pre_comment_e)
CFWS?;
obs_local_part = word ("." word)*;
local_part = (local_dot_atom >local_dot_atom_s %local_dot_atom_e |
(quoted_string %local_quoted_string_e) |
Expand Down
Loading

0 comments on commit 1505198

Please sign in to comment.