** Returns some general header information -- FROM, DATE, and SUBJECT
******************************************************************************/
class small_header {
- var $from, $subject, $date, $to;
+ var $from, $subject, $date, $to, $priority;
}
function sqimap_get_small_header ($imap_stream, $id, $sent) {
- fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date To From Subject)]\r\n");
+ fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date To From Subject X-Priority)]\r\n");
$read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
$subject = _("(no subject)");
$from = _("Unknown Sender");
+ $priority = "0";
$g = 0;
for ($i = 0; $i < count($read); $i++) {
if (eregi ("^to:", $read[$i])) {
if (eregi ("^from:", $read[$i])) {
$from = sqimap_find_displayable_name(substr($read[$i], 5));
}
+ if (eregi ("^x-priority:", $read[$i])) {
+ $priority = trim(substr($read[$i], 11));
+ }
if (eregi ("^date:", $read[$i])) {
$date = substr($read[$i], 5);
} else if (eregi ("^subject:", $read[$i])) {
$header->date = $date;
$header->subject = $subject;
$header->to = $to;
-
+ $header->priority = $priority;
return $header;
}
**
**/
- $mailbox_info = true;
+ $mailbox_display_php = true;
function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage) {
global $color, $msgs, $msort;
echo " <td width=30% bgcolor=$hlt_color>$italic$bold$flag$senderName$flag_end$bold_end$italic_end</td>\n";
echo " <td nowrap width=1% bgcolor=$hlt_color><center>$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end</center></td>\n";
if ($msg["FLAG_ANSWERED"] == true) echo " <td bgcolor=$hlt_color width=1%><b><small>A</small></b></td>";
+ elseif ($msg["PRIORITY"] == 1) echo " <td bgcolor=$hlt_color width=1%><b><small>!</small></b></td>";
else echo " <td bgcolor=$hlt_color width=1%> </td>";
echo " <td bgcolor=$hlt_color width=%>$bold<a href=\"read_body.php?mailbox=$urlMailbox&passed_id=".$msg["ID"]."&startMessage=$startMessage&show_more=0\">$flag$subject$flag_end</a>$bold_end</td>\n";
$date[$q] = $hdr->date;
$subject[$q] = $hdr->subject;
$to[$q] = $hdr->to;
+ $priority[$q] = $hdr->priority;
$flags[$q] = sqimap_get_flags ($imapConnection, $q+1);
}
$messages[$j]["FROM"] = decodeHeader($from[$j]);
$messages[$j]["SUBJECT"] = decodeHeader($subject[$j]);
$messages[$j]["TO"] = decodeHeader($to[$j]);
+ $messages[$j]["PRIORITY"] = $priority[$j];
$num = 0;
while ($num < count($flags[$j])) {
next($msort);
$k++;
} while (isset ($key) && ($k < $i));
+ echo $key;
printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage);
} else {
$i = $startMessage;