-
Notifications
You must be signed in to change notification settings - Fork 66
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
failing test for from header parser containing an additional @ #180
base: master
Are you sure you want to change the base?
failing test for from header parser containing an additional @ #180
Conversation
1af85bb
to
1865ef6
Compare
Hi @kant01ne That would be an invalid From header. To be valid, the name should be in quotes. test "parses utf-8 encoded from" do
message =
parse_email("""
From: "me@examp..." <[email protected]>
""")
assert message.headers["from"] == {"me@examp...", "[email protected]"}
end |
test/mail/parsers/rfc_2822_test.exs
Outdated
From: me@examp... <[email protected]> | ||
""") | ||
|
||
assert message.headers["from"] == {"me@examp...", "<[email protected]>"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: the expected result would not have the angular brackets.
Interesting. The original was an UTF8 encoded from a google comment. Could it be the source of the issue ?
|
That gets decoded as |
1865ef6
to
efd6ba1
Compare
Arf, forgive me, the previous value comes from some tests I've done. I've updated the comment and I've updated the UTF8 encoded value in the tests to
|
Hi @kant01ne, It turns out that we are decoding quoted words too early. RFC 2047 §6.2 specifically states that you cannot decode a header and then guarantee it parses to RFC822
I’ll work on a fix. Thanks for reporting this. |
Hello,
Here is a failing test when the sender name contains an
@
: