From fc3348ac73e1e09387c379c9041a95580591463f Mon Sep 17 00:00:00 2001 From: lkehresman Date: Wed, 15 Mar 2000 13:37:26 +0000 Subject: [PATCH] added saving attachments again, and removed a "click here" screen after composing a message. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@308 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_general.php | 17 +++++------------ functions/smtp.php | 4 ++-- src/compose.php | 22 +++++++++++++++++----- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/functions/imap_general.php b/functions/imap_general.php index c97bf43d..3e825829 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -240,9 +240,6 @@ $from_addr = getPref($data_dir, $username, "email_address"); if ($from_addr == "") $from_addr = "$username@$domain"; - $to_list = getLineOfAddrs($to); - $cc_list = getLineOfAddrs($cc); - $bcc_list = getLineOfAddrs($bcc); if ($from == "") $from = "<$from_addr>"; @@ -250,26 +247,22 @@ $from = $from . " <$from_addr>"; $message = "Date: ".date("D, j M Y H:i:s ", mktime()) . timezone() . "\r\n"; - $message .= "Subject: $subject\r\n"; - $message .= "From: $from\r\n"; - $message .= "To: $to_list\r\n"; + $message .= "Subject: ". $subject."\r\n"; + $message .= "From: ".$from."\r\n"; + $message .= "To: ".$to."\r\n"; if ($cc_list) { - $message .= "Cc: $cc_list\r\n"; // Who the CCs are + $message .= "Cc: ".$cc."\r\n"; // Who the CCs are } $message .= "Content-Type: text/plain; charset=ISO-8859-1\r\n"; $message .= "Content-Transfer-Encoding: 8bit\r\n"; $message .= "\r\n"; - $message .= "$body\r\n"; + $message .= stripslashes($body) . "\r\n"; $message .= "\r\n"; $size = count_chars($message); fputs ($imap_stream, "a001 APPEND $sent_folder (\\Seen) \{$size}\r\n"); fputs ($imap_stream, "$message"); - echo "a001 APPEND $sent_folder (\\Seen) \{$size}
"; $read_ary = sqimap_read_data ($imap_stream, "a001", true, $result, $message); - for ($i = 0; $i < count($read_ary); $i++) { - echo $read_ary[$i] . "
"; - } } ?> diff --git a/functions/smtp.php b/functions/smtp.php index 68f4048f..2e0e6099 100644 --- a/functions/smtp.php +++ b/functions/smtp.php @@ -364,8 +364,8 @@ sendSMTP($t, $c, $b, $subject, $body); } -// $imap_stream = sqimap_login($username, $key, $imapServerAddress, 1); -// sqimap_append ($imap_stream, $sent_folder, $body, $t, $c, $b, $subject, $data_dir, $username, $domain, $version); + $imap_stream = sqimap_login($username, $key, $imapServerAddress, 1); + sqimap_append ($imap_stream, $sent_folder, $body, $t, $c, $b, $subject, $data_dir, $username, $domain, $version); } ?> diff --git a/src/compose.php b/src/compose.php index 83c7bb54..adcac3e5 100644 --- a/src/compose.php +++ b/src/compose.php @@ -26,10 +26,6 @@ include("../src/load_prefs.php"); - echo "\n"; - $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0); - displayPageHeader($color, "None"); - // This function is used when not sending or adding attachments function newMail () { global $forward_id, $imapConnection, $msg, $ent_num, $body_ary, $body, @@ -279,11 +275,19 @@ if(isset($send)) { if (checkInput()) { sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body); - showSentForm(); + header ("Location: right_main.php"); } else { + echo "\n"; + $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0); + displayPageHeader($color, "None"); + showInputForm(); } } else if (isset($attach)) { + echo "\n"; + $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0); + displayPageHeader($color, "None"); + $localfilename = md5("$attachfile, $attachfile_name, $REMOTE_IP, $REMOTE_PORT, $UNIQUE_ID, and everything else that may add entropy"); $localfilename = $localfilename; @@ -308,6 +312,10 @@ showInputForm(); } else if (isset($do_delete)) { + echo "\n"; + $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0); + displayPageHeader($color, "None"); + while (list($key, $localname) = each($delete)) { array_splice ($attachments, $key, 1); unlink ($attachment_dir.$localname); @@ -316,6 +324,10 @@ showInputForm(); } else { + echo "\n"; + $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0); + displayPageHeader($color, "None"); + $newmail = true; newMail(); showInputForm(); -- 2.25.1