fix for broken drafts. Patch from Ryan O'Neill
[squirrelmail.git] / functions / imap_messages.php
index 551f3ff92d587ecc6d838e1c721369b84979cbe6..345221425e4823226b728df32e8ea32de9df7e68 100755 (executable)
@@ -298,6 +298,18 @@ function sqimap_get_message_header ($imap_stream, $id, $mailbox) {
     return $header;
 }
 
+/****************************************************************************
+ **  Wrapper function that reformats the entity header information.
+ ****************************************************************************/
+function sqimap_get_ent_header ($imap_stream, $id, $mailbox, $ent) {
+    $read = sqimap_run_command ($imap_stream, "FETCH $id:$id BODY[$ent.HEADER]", true, $response, $message);
+    $header = sqimap_get_header($imap_stream, $read); 
+    $header->id = $id;
+    $header->mailbox = $mailbox;
+    return $header;
+}
+
+
 /****************************************************************************
  **  Wrapper function that returns entity headers for use by decodeMime
  ****************************************************************************/