Skip to content
Snippets Groups Projects
Commit f7a7ea2f authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #535 from greezybacon/issue/search-to-and-delivered-to


Search for system emails in To and Delivered-To

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 4a67fa3b 882311bb
No related branches found
No related tags found
No related merge requests found
......@@ -172,11 +172,15 @@ class Mail_Parse {
function getToAddressList(){
// Delivered-to incase it was a BBC mail.
if (!($header = $this->struct->headers['to']))
if (!($header = $this->struct->headers['delivered-to']))
return null;
$addrs = array();
if ($header = $this->struct->headers['to'])
$addrs = Mail_Parse::parseAddressList($header);
return Mail_Parse::parseAddressList($header);
if ($header = $this->struct->headers['delivered-to'])
$addrs = array_merge($addrs,
Mail_Parse::parseAddressList($header));
return $addrs;
}
function getCcAddressList(){
......@@ -394,6 +398,10 @@ class Mail_Parse {
function parseAddressList($address){
if (!$address)
return false;
// Delivered-To may appear more than once in the email headers
if (is_array($address))
$address = implode(', ', $address);
return Mail_RFC822::parseAddressList($address, null, null,false);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment