From 1f1790d2bb93549dc690c266c6f51c4b6d41674d Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 19 Mar 2015 13:20:05 +0000 Subject: [PATCH] Make sure distributionlist is resolved in mail compose after submit action --- mail/inc/class.mail_compose.inc.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 9ec414a3cc..722f25bee8 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -1289,7 +1289,14 @@ class mail_compose $etpl->setElementAttribute('folder','autocomplete_params',array('mailaccount'=>$content['mailaccount'])); // join again mailaccount and identity $content['mailaccount'] .= ':'.$content['mailidentity']; - + + // Resolve distribution list before send content to client + foreach(array('to', 'cc', 'bcc', 'replyto') as $f) + { + if (is_array($content[$f])) $content[$f]= self::resolveEmailAddressList ($content[$f]); + } + + $content['to'] = self::resolveEmailAddressList($content['to']); //error_log(__METHOD__.__LINE__.array2string($content)); $etpl->exec('mail.mail_compose.compose',$content,$sel_options,$readonlys,$preserv,2); } @@ -2562,7 +2569,7 @@ class mail_compose if (!empty($addr)) $_emailAddressList[]=$addr; } } - return $_emailAddressList; + return array_values($_emailAddressList); } /**