workaround when multiple at encountered
This commit is contained in:
parent
5083abb835
commit
cad1ca9978
1 changed files with 17 additions and 2 deletions
|
@ -87,8 +87,8 @@ fn obs_domain_list_rest(input: &str) -> IResult<&str, Vec<String>> {
|
|||
/// so I force obsolete for now...
|
||||
pub fn addr_spec(input: &str) -> IResult<&str, AddrSpec> {
|
||||
map(
|
||||
tuple((obs_local_part, tag("@"), obs_domain)),
|
||||
|(local_part, _, domain)|
|
||||
tuple((obs_local_part, tag("@"), obs_domain, many0(pair(tag("@"), obs_domain)))),
|
||||
|(local_part, _, domain, _)|
|
||||
AddrSpec { local_part, domain },
|
||||
)(input)
|
||||
}
|
||||
|
@ -315,4 +315,19 @@ mod tests {
|
|||
}))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn test_enron4() {
|
||||
assert_eq!(
|
||||
mailbox(r#"<"mark_kopinski/intl/acim/americancentury"@americancentury.com@enron.com>"#),
|
||||
Ok(("", MailboxRef {
|
||||
name: None,
|
||||
addrspec: AddrSpec {
|
||||
local_part: "mark_kopinski/intl/acim/americancentury".into(),
|
||||
domain: "americancentury.com".into(),
|
||||
}
|
||||
}))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue