- if ($sent == true) {
- if (eregi ("^to:", $read[$i])) {
- $from = sqimap_find_displayable_name(substr($read[$i], 3));
- }
- } else {
- if (eregi ("^from:", $read[$i])) {
- $from = sqimap_find_displayable_name(substr($read[$i], 5));
- }
- }
-
- if (eregi ("^date:", $read[$i])) {
- $date = substr($read[$i], 5);
- } else if (eregi ("^subject:", $read[$i])) {
- $subject = htmlspecialchars(eregi_replace ("^subject: ", "", $read[$i]));
- if (strlen($subject) == 0)
+ if (eregi ("^to:(.*)$", $read[$i], $regs)) {
+ //$to = sqimap_find_displayable_name(substr($read[$i], 3));
+ $to = $regs[1];
+ } else if (eregi ("^from:(.*)$", $read[$i], $regs)) {
+ //$from = sqimap_find_displayable_name(substr($read[$i], 5));
+ $from = $regs[1];
+ } else if (eregi ("^x-priority:(.*)$", $read[$i], $regs)) {
+ $priority = trim($regs[1]);
+ } else if (eregi ("^message-id:(.*)$", $read[$i], $regs)) {
+ $messageid = trim($regs[1]);
+ } else if (eregi ("^cc:(.*)$", $read[$i], $regs)) {
+ $cc = $regs[1];
+ } else if (eregi ("^date:(.*)$", $read[$i], $regs)) {
+ $date = $regs[1];
+ } else if (eregi ("^subject:(.*)$", $read[$i], $regs)) {
+ $subject = htmlspecialchars(trim($regs[1]));
+ if ($subject == "")