+ $attachments[$localfilename] = $HTTP_POST_FILES['attachfile']['name'];
+ }
+ }
+
+ // Workaround for RedHat PHP 4.0.4pl1-3
+ // Also for Konq problems?
+ if (isset($mailbox)) $mailbox = trim($mailbox);
+ if (isset($send_to)) $send_to = trim($send_to);
+ if (isset($send_to_cc)) $send_to_cc = trim($send_to_cc);
+ if (isset($send_to_bcc)) $send_to_bcc = trim($send_to_bcc);
+ if (isset($subject)) $subject = trim($subject);
+ if (isset($body)) $body = trim($body);
+ if (isset($attachfile)) $attachfile = trim($attachfile);
+ // End of workaround
+
+ if (!isset($mailbox) || $mailbox == "" || ($mailbox == "None"))
+ $mailbox = "INBOX";
+
+ if(isset($send)) {
+ if (isset($HTTP_POST_FILES['attachfile']) &&
+ $HTTP_POST_FILES['attachfile']['tmp_name'] &&
+ $HTTP_POST_FILES['attachfile']['tmp_name'] != 'none')
+ $AttachFailure = saveAttachedFiles();
+ if (checkInput(false) && !isset($AttachFailure)) {
+ $urlMailbox = urlencode (trim($mailbox));
+ if (! isset($reply_id))
+ $reply_id = 0;
+ 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 {
+ //$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+ displayPageHeader($color, $mailbox);
+
+ if ($AttachFailure)
+ plain_error_message(_("Could not move/copy file. File not attached"), $color);
+
+ checkInput(true);
+
+ showInputForm();
+ //sqimap_logout($imapConnection);
+ }
+ } else if (isset($html_addr_search_done)) {
+ is_logged_in();
+ displayPageHeader($color, $mailbox);
+
+ for ($i=0; $i < count($send_to_search); $i++) {
+ if ($send_to)
+ $send_to .= ", ";
+ $send_to .= $send_to_search[$i];