+ /* if lookup function */
+ if ($lookup) {
+ $aAddr = call_user_func_array($lookup,array($addr));
+ if (isset($aAddr['email'])) {
+ $at = strpos($aAddr['email'], '@');
+ $addr_structure->mailbox = substr($aAddr['email'], 0, $at);
+ $addr_structure->host = substr($aAddr['email'], $at+1);
+ if (isset($aAddr['name'])) {
+ $addr_structure->personal = $aAddr['name'];
+ }
+ }
+ }
+ if (!$addr_structure->mailbox) {
+ $addr_structure->mailbox = trim($addr);
+ if ($host) {
+ $addr_structure->host = $host;
+ }