Added Pontus Ullgren's message priority code.
authorphutnick <phutnick@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 4 Sep 2001 00:41:42 +0000 (00:41 +0000)
committerphutnick <phutnick@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 4 Sep 2001 00:41:42 +0000 (00:41 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1482 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/smtp.php

index 2be15ca..f171693 100644 (file)
       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();
             $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
         
       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;
+   }
 ?>