sending messages takes you back to previous mailbox
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 5 May 2000 15:30:48 +0000 (15:30 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 5 May 2000 15:30:48 +0000 (15:30 +0000)
, saves "Answered" flag

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@498 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/page_header.php
functions/smtp.php
src/compose.php

index e53e696..57ba30b 100644 (file)
@@ -56,7 +56,8 @@
       echo "   </TR></TABLE>\n";
       echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2><TR>";
       echo "      <TD ALIGN=left WIDTH=70%>";
-      echo "         <A HREF=\"compose.php\">" . _("Compose") . "</A>&nbsp&nbsp";
+      $urlMailbox = $mailbox;
+      echo "         <A HREF=\"compose.php?mailbox=$urlMailbox\">" . _("Compose") . "</A>&nbsp&nbsp";
       echo "         <A HREF=\"addressbook.php\">" . _("Addresses") . "</A>&nbsp&nbsp";
       echo "         <A HREF=\"folders.php\">" . _("Folders") . "</A>&nbsp&nbsp";
       echo "         <A HREF=\"options.php\">" . _("Options") . "</A>&nbsp&nbsp";
index 049b8da..5fa020d 100644 (file)
       return $err_num;
    }
 
-   function sendMessage($t, $c, $b, $subject, $body) {
-      global $useSendmail, $msg_id, $is_reply;
+   function sendMessage($t, $c, $b, $subject, $body, $reply_id) {
+      global $useSendmail, $msg_id, $is_reply, $mailbox;
       global $data_dir, $username, $domain, $key, $version, $sent_folder, $imapServerAddress, $imapPort;
 
+      $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 1);
+      if ($reply_id) {
+         sqimap_mailbox_select ($imap_stream, $mailbox);
+         sqimap_messages_flag ($imap_stream, $reply_id, $reply_id, "Answered");
+      }
+      
       if ($useSendmail==true) {  
          $length = sendSendmail($t, $c, $b, $subject, $body);
       } else {
          $length = sendSMTP($t, $c, $b, $subject, $body);
       }
 
-      $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 1);
       if (sqimap_mailbox_exists ($imap_stream, $sent_folder)) {
          sqimap_append ($imap_stream, $sent_folder, $length);
          write822Header ($imap_stream, $t, $c, $b, $subject);
index 8a67bac..8d67a23 100644 (file)
       global $send_to, $send_to_cc, $reply_subj, $forward_subj, $body,
          $passed_body, $color, $use_signature, $signature, $editor_size,
          $attachments, $subject, $newmail, $use_javascript_addr_book,
-         $send_to_bcc;
+         $send_to_bcc, $reply_id, $mailbox;
 
       $subject = decodeHeader($subject);
       $reply_subj = decodeHeader($reply_subj);
       }
 
       echo "\n<FORM name=compose action=\"compose.php\" METHOD=POST ENCTYPE=\"multipart/form-data\">\n";
+      if ($reply_id) {
+         echo "<input type=hidden name=reply_id value=$reply_id>\n";
+      }                 
+               echo "<input type=hidden name=mailbox value=$mailbox>\n";
       echo "<TABLE COLS=2 WIDTH=50 ALIGN=center CELLSPACING=0 BORDER=0>\n";
       echo "   <TR>\n";
       echo "      <TD WIDTH=50 BGCOLOR=\"$color[4]\" ALIGN=RIGHT>\n";
 
    if(isset($send)) {
       if (checkInput(false)) {
-         sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body);
-         header ("Location: right_main.php");
+         $urlMailbox = urlencode ($mailbox);
+         sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $reply_id);
+         header ("Location: right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=1");
       } else {
          echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
          $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);