public static function getAuthorEmail($name)
{
try {
$users = $GLOBALS['VC']->getUsers($GLOBALS['chora_conf']['cvsusers']);
if (isset($users[$name])) {
return $users[$name]['mail'];
}
} catch (Horde_Vcs_Exception $e) {
}
try {
$parser = new Horde_Mail_Rfc822();
$res = $parser->parseAddressList($name);
if ($tmp = $res[0]) {
return $tmp->bare_address;
}
} catch (Horde_Mail_Exception $e) {
try {
if (preg_match('|<(\\S+)>|', $name, $matches)) {
return self::getAuthorEmail($matches[1]);
}
} catch (Horde_Mail_Exception $e) {
}
}
return $name;
}