$hdr->date = time();
$i++;
}
+ /** X-PRIORITY **/
+ else if (strtolower(substr($read[$i], 0, 11)) == "x-priority:") {
+ $hdr->priority = trim(substr($read[$i], 11));
+ $i++;
+ }
else {
$i++;
}
global $checkall;
global $color, $msgs, $msort;
global $sent_folder, $draft_folder;
+ global $default_use_priority;
global $message_highlight_list;
global $index_order;
echo "A\n";
$stuff = true;
}
- if (ereg('(5)',substr($msg['PRIORITY'],0,1))) {
- echo "<font color=$color[8]>v</font>\n";
- $stuff = true;
- }
if ($msg['TYPE0'] == 'multipart') {
echo "+\n";
$stuff = true;
}
- if (ereg('(1|2)',substr($msg['PRIORITY'],0,1))) {
- echo "<font color=$color[1]>!</font>\n";
- $stuff = true;
+ if ($default_use_priority) {
+ if (ereg('(1|2)',substr($msg['PRIORITY'],0,1))) {
+ echo "<font color=$color[1]>!</font>\n";
+ $stuff = true;
+ }
+ if (ereg('(5)',substr($msg['PRIORITY'],0,1))) {
+ echo "<font color=$color[8]>?</font>\n";
+ $stuff = true;
+ }
}
if (isset($msg['FLAG_DELETED']) && $msg['FLAG_DELETED']) {
echo "<font color=\"$color[1]\">D</font>\n";
var $cc = array(), $bcc = array(), $reply_to = '', $subject = '';
var $id = 0, $mailbox = '', $description = '', $filename = '';
var $entity_id = 0, $message_id = 0, $name = '';
+ // var $priority = "";
}
class message {
return $err_num;
}
- function sendMessage($t, $c, $b, $subject, $body, $reply_id) {
+ function sendMessage($t, $c, $b, $subject, $body, $reply_id, $prio = 3) {
global $useSendmail, $msg_id, $is_reply, $mailbox, $onetimepad;
global $data_dir, $username, $domain, $key, $version, $sent_folder, $imapServerAddress, $imapPort;
+ global $default_use_priority;
global $more_headers;
$more_headers = Array();
$more_headers['References'] = $hdr->message_id;
}
}
+ if ($default_use_priority) {
+ $more_headers = array_merge($more_headers, createPriorityHeaders($prio));
+ }
// In order to remove the problem of users not able to create
// messages with "." on a blank line, RFC821 has made provision
return $length;
}
-
-?>
\ No newline at end of file
+
+ function createPriorityHeaders($prio) {
+ $prio_headers = Array();
+ $prio_headers["X-Priority"] = $prio;
+
+ switch($prio) {
+ case 1: $prio_headers["Importance"] = "High";
+ $prio_headers["X-MSMail-Priority"] = "High";
+ break;
+
+ case 3: $prio_headers["Importance"] = "Normal";
+ $prio_headers["X-MSMail-Priority"] = "Normal";
+ break;
+
+ case 5:
+ $prio_headers["Importance"] = "Low";
+ $prio_headers["X-MSMail-Priority"] = "Low";
+ break;
+ }
+ return $prio_headers;
+ }
+?>
$editor_size, $attachments, $subject, $newmail,
$use_javascript_addr_book, $send_to_bcc, $reply_id, $mailbox,
$from_htmladdr_search, $location_of_buttons, $attachment_dir,
- $username, $data_dir, $identity, $draft_id, $delete_draft;
+ $username, $data_dir, $identity, $draft_id, $delete_draft,
+ $mailprio;
$subject = decodeHeader($subject);
$reply_subj = decodeHeader($reply_subj);
}
function showComposeButtonRow() {
- global $use_javascript_addr_book, $save_as_draft;
+ global $use_javascript_addr_book, $save_as_draft,
+ $default_use_priority, $mailprio;
echo " <TR><td>\n </td><td>\n";
if ($use_javascript_addr_book) {
if ($save_as_draft) {
echo "<input type=\"submit\" name =\"draft\" value=\"Save Draft\">\n";
}
+ if ($default_use_priority) {
+ if(!isset($mailprio)) {
+ $mailprio = "3";
+ }
+ echo "\n\t". _("Priority") .":<select name=\"mailprio\">".
+ "\n\t\t<option value=1".($mailprio=="1"?" selected":"").">". _("High") ."</option>".
+ "\n\t\t<option value=3".($mailprio=="3"?" selected":"").">". _("Normal") ."</option>".
+ "\n\t\t<option value=5".($mailprio=="5"?" selected":"").">". _("Low")."</option>".
+ "\n\t</select>";
+ }
do_hook("compose_button_row");
// True if FAILURE
function saveAttachedFiles() {
global $HTTP_POST_FILES, $attachment_dir, $attachments;
-
+
$localfilename = GenerateRandomString(32, '', 7);
while (file_exists($attachment_dir . $localfilename))
$localfilename = GenerateRandomString(32, '', 7);
do_hook("compose_send");
- if (! sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $reply_id)) {
+ if (!sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $reply_id, $mailprio)) {
showInputForm();
exit();
}
}
}
}
+
+ if($default_use_priority) {
+ switch(substr($message->header->priority,0,1)) {
+ case "1" : $priority_string = _("High");
+ break;
+ case "3" : $priority_string = _("Normal");
+ break;
+ case "5" : $priority_string = _("Low");
+ break;
+ }
+ }
/** make sure everything will display in HTML format **/
$from_name = decodeHeader(htmlspecialchars($message->header->from));
$subject = decodeHeader(htmlspecialchars($message->header->subject));
' </TD>' . "\n" .
' </TR>' . "\n";
}
+ if ($default_use_priority) {
+ if (isset($priority_string)) {
+ echo " <TR>\n" .
+ " <TD BGCOLOR=\"$color[0]\" ALIGN=RIGHT VALIGN=TOP>\n" .
+ " "._("Priority").": \n".
+ " </TD><TD BGCOLOR=\"$color[0]\" VALIGN=TOP colspan=2>\n" .
+ " <B>$priority_string</B> \n" .
+ " </TD>" . "\n" .
+ " </TR>" . "\n";
+ }
+ }
do_hook("read_body_header");
echo '</TABLE>' .
' </TD></TR>' .