From ceae11f47577fd944c9f7d86bd94dcf47e7f7b26 Mon Sep 17 00:00:00 2001 From: phutnick Date: Tue, 4 Sep 2001 00:41:42 +0000 Subject: [PATCH] Added Pontus Ullgren's message priority code. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1482 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/smtp.php | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/functions/smtp.php b/functions/smtp.php index 2be15ca8..f171693e 100644 --- a/functions/smtp.php +++ b/functions/smtp.php @@ -564,7 +564,7 @@ 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; $more_headers = Array(); @@ -585,6 +585,7 @@ $more_headers['References'] = $hdr->message_id; } } + $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 @@ -617,5 +618,25 @@ return $length; } - + + 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; + } ?> -- 2.25.1