Fix emails with single quote in local address not getting parsed correctly (eg. test.o'test@example.com)

This commit is contained in:
Hadi Nategh 2016-05-19 15:46:08 +02:00
parent b14b3dcddc
commit 1517c5f323

View File

@ -6913,8 +6913,12 @@ class Mail
foreach($ret as $i => $adr)
{
//mailaddresses enclosed in single quotes like 'me@you.com' show up as 'me as mailbox and you.com' as host
if ($adr->mailbox && stripos($adr->mailbox,"'")!==false) $adr->mailbox = str_replace("'","",$adr->mailbox);
if ($adr->host && stripos($adr->host,"'")!==false) $adr->host = str_replace("'","",$adr->host);
if ($adr->mailbox && stripos($adr->mailbox,"'")== 0 &&
$adr->host && stripos($adr->host,"'")== (strlen($adr->host) -1))
{
$adr->mailbox = str_replace("'","",$adr->mailbox);
$adr->host = str_replace("'","",$adr->host);
}
// no mailbox or host part as 'Xr\xc3\xa4hlyz, User <mailboxpart1.mailboxpart2@yourhost.com>' is parsed as 2 addresses separated by ','
//#'Xr\xc3\xa4hlyz, User <mailboxpart1.mailboxpart2@yourhost.com>'
//#Horde_Mail_Rfc822_List Object([_data:protected] => Array(