+ return array($nom, strtolower($regs[2]));
+ } else if (preg_match("/^([^ ]+@[^ ]+) \((.*)\)$/", $text, $regs)) {
+ # From: mark@cbosgd.ATT.COM (Mark Horton)
+ return array($regs[2], strtolower($regs[1]));
+ } else if (preg_match("/^<?([^< ]+@[^> ]+)>?$/", $text, $regs)) {
+ # From: <mark@cbosgd.ATT.COM>
+ return array($regs[1], strtolower($regs[1]));
+ } else {
+ # From: mark@cbosgd.ATT.COM
+ return array($text, strtolower($text));
+ }
+ }
+
+ static public function formatFrom($text, $subject = '')
+ {
+ list($name, $email) = self::extractMail($text);
+ if ($subject) {
+ $subject = '?subject=' . banana_htmlentities(_b_('Re: ') . $subject, ENT_QUOTES);