diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 2ba77016f3..5622156dec 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -1641,7 +1641,7 @@ class mail_compose } $this->sessionData['body'] = mail_ui::resolve_inline_images($this->sessionData['body'], $_folder, $_uid, $_partID,'plain'); } - + if(($attachments = $mail_bo->getMessageAttachments($_uid,$_partID))) { foreach($attachments as $attachment) { $cid = $attachment['cid']; @@ -3291,7 +3291,15 @@ class mail_compose foreach($contacts as $contact) { foreach(array($contact['email'],$contact['email_home']) as $email) { // avoid wrong addresses, if an rfc822 encoded address is in addressbook - $email = preg_replace("/(^.*<)([a-zA-Z0-9_\-]+@[a-zA-Z0-9_\-\.]+)(.*)/",'$2',$email); + //$email = preg_replace("/(^.*<)([a-zA-Z0-9_\-]+@[a-zA-Z0-9_\-\.]+)(.*)/",'$2',$email); + $rfcAddr = emailadmin_imapbase::parseAddressList($email); + $_rfcAddr=$rfcAddr->first(); + if (!$_rfcAddr->valid) + { + break; // skip address if we encounter an error here + } + $email = $_rfcAddr->mailbox.'@'.$_rfcAddr->host; + if (method_exists($GLOBALS['egw']->contacts,'search')) { $contact['n_fn']='';