mail
mail copied to clipboard
`Mail::AddressList.new` fails to parse RFC822 A.1.5
Mail::AddressList.new fails to parse the example given in RFC822 A.1.5:
Mail::AddressList.new(<<~ADDRESS_LIST.chomp)
Gourmets: Pompous Person <WhoZiWhatZit@Cordon-Bleu>,
[email protected], Galloping Gourmet@
ANT.Down-Under (Australian National Television),
Cheapie@Discount-Liquors;,
Cruisers: Port@Portugal, Jones@SEA;,
[email protected]
ADDRESS_LIST
# Mail::AddressList can not parse |Gourmets: Pompous Person <WhoZiWhatZit@Cordon-Bleu>, (Mail::Field::IncompleteParseError)
# [email protected], Galloping Gourmet@
# ANT.Down-Under (Australian National Television),
# Cheapie@Discount-Liquors;,
# Cruisers: Port@Portugal, Jones@SEA;,
# [email protected]|: Only able to parse up to "Gourmets: Pompous Person <WhoZiWhatZit@Cordon-Bleu>,"
Have also run into this issue and it seems to occur when attempting to parse addresses with spaces in the name:
expect(email).to deliver_from("John's 1 Doe's [email protected]")
# Mail::AddressList can not parse |John's 1 Doe's [email protected]|: Only
able to parse up to "John's 1 Doe's [email protected]"
I think the example John's 1 Doe's [email protected] is invalid.
Spaces are not allowed in the local-part unless it is quoted.
It should be "John's 1 Doe's 1-unique-token-identifier"@domain.com