mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-13 17:38:19 +01:00
full list support for new horde mail based client
This commit is contained in:
parent
32e033df6f
commit
e4abe0fba0
@ -1209,11 +1209,11 @@ class mail_bo
|
||||
$headerObject['DATE'] = $_headerObject->getEnvelope()->__get('date');
|
||||
$headerObject['INTERNALDATE'] = $_headerObject->getImapDate();
|
||||
$headerObject['SUBJECT'] = $_headerObject->getEnvelope()->__get('subject');
|
||||
$headerObject['FROM'] = $_headerObject->getEnvelope()->__get('from');
|
||||
$headerObject['TO'] = $_headerObject->getEnvelope()->__get('to');
|
||||
$headerObject['CC'] = $_headerObject->getEnvelope()->__get('cc');
|
||||
$headerObject['FROM'] = $_headerObject->getEnvelope()->__get('from')->__get('addresses');
|
||||
$headerObject['TO'] = $_headerObject->getEnvelope()->__get('to')->__get('addresses');
|
||||
$headerObject['CC'] = $_headerObject->getEnvelope()->__get('cc')->__get('addresses');
|
||||
$headerObject['FLAGS'] = $_headerObject->getFlags();
|
||||
error_log(__METHOD__.__LINE__.array2string($headerObject));
|
||||
//error_log(__METHOD__.__LINE__.array2string($headerObject));
|
||||
|
||||
//if($count == 0) error_log(__METHOD__.array2string($headerObject));
|
||||
if (empty($headerObject['UID'])) continue;
|
||||
@ -1238,27 +1238,12 @@ error_log(__METHOD__.__LINE__.array2string($headerObject));
|
||||
if (is_array($headerObject['FLAGS'])) {
|
||||
$retValue['header'][$sortOrder[$uid]] = array_merge($retValue['header'][$sortOrder[$uid]],self::prepareFlagsArray($headerObject));
|
||||
}
|
||||
if(is_array($headerObject['FROM']) && is_array($headerObject['FROM'][0])) {
|
||||
if($headerObject['FROM'][0]['HOST_NAME'] != 'NIL') {
|
||||
$retValue['header'][$sortOrder[$uid]]['sender_address'] = self::decode_header($headerObject['FROM'][0]['EMAIL'],true);
|
||||
} else {
|
||||
$retValue['header'][$sortOrder[$uid]]['sender_address'] = self::decode_header($headerObject['FROM'][0]['MAILBOX_NAME'],true);
|
||||
}
|
||||
if($headerObject['FROM'][0]['PERSONAL_NAME'] != 'NIL') {
|
||||
$retValue['header'][$sortOrder[$uid]]['sender_name'] = self::decode_header($headerObject['FROM'][0]['PERSONAL_NAME']);
|
||||
}
|
||||
|
||||
if(is_array($headerObject['FROM']) && $headerObject['FROM'][0]) {
|
||||
$retValue['header'][$sortOrder[$uid]]['sender_address'] = self::decode_header($headerObject['FROM'][0]);
|
||||
}
|
||||
|
||||
if(is_array($headerObject['TO']) && is_array($headerObject['TO'][0])) {
|
||||
if($headerObject['TO'][0]['HOST_NAME'] != 'NIL') {
|
||||
$retValue['header'][$sortOrder[$uid]]['to_address'] = self::decode_header($headerObject['TO'][0]['EMAIL'],true);
|
||||
} else {
|
||||
$retValue['header'][$sortOrder[$uid]]['to_address'] = self::decode_header($headerObject['TO'][0]['MAILBOX_NAME'],true);
|
||||
}
|
||||
if($headerObject['TO'][0]['PERSONAL_NAME'] != 'NIL') {
|
||||
$retValue['header'][$sortOrder[$uid]]['to_name'] = self::decode_header($headerObject['TO'][0]['PERSONAL_NAME']);
|
||||
}
|
||||
if(is_array($headerObject['TO']) && $headerObject['TO'][0]) {
|
||||
$retValue['header'][$sortOrder[$uid]]['to_address'] = self::decode_header($headerObject['TO'][0]);
|
||||
if (count($headerObject['TO'])>1)
|
||||
{
|
||||
$ki=0;
|
||||
@ -1266,23 +1251,13 @@ error_log(__METHOD__.__LINE__.array2string($headerObject));
|
||||
{
|
||||
if ($k==0) continue;
|
||||
//error_log(__METHOD__.__LINE__."-> $k:".array2string($add));
|
||||
if($add['HOST_NAME'] != 'NIL')
|
||||
{
|
||||
$retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]['address'] = self::decode_header($add['EMAIL'],true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]['address'] = self::decode_header($add['MAILBOX_NAME'],true);
|
||||
}
|
||||
if($headerObject['TO'][$k]['PERSONAL_NAME'] != 'NIL')
|
||||
{
|
||||
$retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]['name'] = self::decode_header($add['PERSONAL_NAME']);
|
||||
}
|
||||
$retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]['address'] = self::decode_header($add);
|
||||
//error_log(__METHOD__.__LINE__.array2string($retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]));
|
||||
$ki++;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error_log(__METHOD__.__LINE__.array2string($retValue['header'][$sortOrder[$uid]]));
|
||||
|
||||
$count++;
|
||||
}
|
||||
|
@ -1460,55 +1460,14 @@ unset($query['actions']);
|
||||
// sent or draft or template folder -> to address
|
||||
if (in_array("toaddress", $cols))
|
||||
{
|
||||
if(!empty($header['to_name'])) {
|
||||
list($mailbox, $host) = explode('@',$header['to_address']);
|
||||
$senderAddress = imap_rfc822_write_address($mailbox,
|
||||
$host,
|
||||
$header['to_name']);
|
||||
} else {
|
||||
$senderAddress = $header['to_address'];
|
||||
}
|
||||
|
||||
// sent or drafts or template folder means foldertype > 0, use to address instead of from
|
||||
$header2add = $header['to_address'];//mail_bo::htmlentities($header['to_address'],$this->charset);
|
||||
$header['to_address'] = $header2add;
|
||||
if (!empty($header['to_name'])) {
|
||||
$header2name = $header['to_name'];//mail_bo::htmlentities($header['to_name'],$this->charset);
|
||||
$header['to_name'] = $header2name;
|
||||
|
||||
$sender_name = $header['to_name'];
|
||||
$full_address = $header['to_name'].' <'.$header['to_address'].'>';
|
||||
} else {
|
||||
$sender_name = $header['to_address'];
|
||||
$full_address = $header['to_address'];
|
||||
}
|
||||
$data["toaddress"] = $full_address;
|
||||
$data["toaddress"] = $header['to_address'];//mail_bo::htmlentities($header['to_address'],$this->charset);
|
||||
}
|
||||
|
||||
//fromaddress
|
||||
if (in_array("fromaddress", $cols))
|
||||
{
|
||||
$header2add = $header['sender_address'];//mail_bo::htmlentities($header['sender_address'],$this->charset);
|
||||
$header['sender_address'] = $header2add;
|
||||
if (!empty($header['sender_name'])) {
|
||||
$header2name = $header['sender_name'];//mail_bo::htmlentities($header['sender_name'],$this->charset);
|
||||
$header['sender_name'] = $header2name;
|
||||
|
||||
$sender_name = $header['sender_name'];
|
||||
$full_address = $header['sender_name'].' <'.$header['sender_address'].'>';
|
||||
} else {
|
||||
$sender_name = $header['sender_address'];
|
||||
$full_address = $header['sender_address'];
|
||||
}
|
||||
if(!empty($header['sender_name'])) {
|
||||
list($mailbox, $host) = explode('@',$header['sender_address']);
|
||||
$senderAddress = imap_rfc822_write_address($mailbox,
|
||||
$host,
|
||||
$header['sender_name']);
|
||||
} else {
|
||||
$senderAddress = $header['sender_address'];
|
||||
}
|
||||
$data["fromaddress"] = $full_address;
|
||||
$data["fromaddress"] = $header['sender_address'];//mail_bo::htmlentities($header['sender_address'],$this->charset);
|
||||
}
|
||||
if (in_array("date", $cols))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user