Description:
------------
when mail() is passing the headers to get the sender's email address and the headers are similar to the following:
To: blah
From: user@domain.tld
AnotherHeader: value
it retrieves " user@domain.tld" as the senders email, instead of "user@domain.tld". this is a problem when sending email to yahoo, as the MAIL FROM smtp command that mail() generates looks like the following:
MAIL FROM:< user@domain.tld>
instead of
MAIL FROM:<user@domain.tld>
or
MAIL FROM: <user@domain.tld>
and yahoo rejects.
Reproduce code:
---------------
mail('test@yahoo.com','test subject','test body','From: user@myserver.tld');
Expected result:
----------------
yahoo rejects with the following
501 Syntax error in parameters or arguments
Actual result:
--------------
n/a