mail
mail copied to clipboard
(invalid) addresses with > breaks parser
I got an email with an invalid To field.
Notice the > at the end of the address.
(Example is stripped down to the relevant parts):
From: Example <[email protected]>
To: [email protected]>
Subject: =?UTF-8?Q?Test_Mail?=
Test Mail=0D
=0D
Getting:
Mail.new(..).to # => "[email protected]>"
expected:
Mail.new(..).to # => ["[email protected]>"]
Thunderbird automatically strips the invalid > so this would be a bonus.
One more example with multiple addresses:
Date: Fri, 12 May 2017 17:49:04 +0200
From: Example <[email protected]>
To: [email protected]>, [email protected]
Subject: =?UTF-8?Q?Test_Mail?=
Test Mail=0D
=0D
Getting
Mail.new(..).to # => "[email protected]>, [email protected]"
expected:
Mail.new(..).to # => ["[email protected]>", "[email protected]"]
As those emails really exist (the sender used the 'goneo Webmail', a german mail-hosting company) a fix within the gem which helps other ppl, too, would be much appreciated.
Please let me know if this would be a possible option.