Skip to content
Snippets Groups Projects
Commit 882311bb authored by Jared Hancock's avatar Jared Hancock
Browse files

Search for system emails in To and Delivered-To

Previously, the Delivered-To header was only used if the To header was not
found
parent c55ca507
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.
Please register or to comment