git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@344
7612ce4b-ef26-0410-bec9-
ea0150e637f0
** Saves a message to a given folder -- used for saving sent messages
******************************************************************************/
function sqimap_append ($imap_stream, $sent_folder, $length) {
** Saves a message to a given folder -- used for saving sent messages
******************************************************************************/
function sqimap_append ($imap_stream, $sent_folder, $length) {
- fputs ($imap_stream, "a001 APPEND $sent_folder (\\Seen) \{$length}\n");
+ fputs ($imap_stream, "a001 APPEND \"$sent_folder\" (\\Seen) \{$length}\r\n");
$tmp = fgets ($imap_stream, 1024);
$tmp = fgets ($imap_stream, 1024);
}
function sqimap_append_done ($imap_stream) {
fputs ($imap_stream, "\r\n");
}
function sqimap_append_done ($imap_stream) {
fputs ($imap_stream, "\r\n");
+ $tmp = fgets ($imap_stream, 1024);
+ echo $tmp;
$filetype = "application/octet-stream";
$header = "--".mimeBoundary()."\r\n";
$filetype = "application/octet-stream";
$header = "--".mimeBoundary()."\r\n";
- $header .= "Content-Type: $filetype\n";
+ $header .= "Content-Type: $filetype\r\n";
$header .= "Content-Disposition: attachment; filename=\"$remotename\"\r\n";
$header .= "Content-Transfer-Encoding: base64\r\n\r\n";
fputs ($fp, $header);
$header .= "Content-Disposition: attachment; filename=\"$remotename\"\r\n";
$header .= "Content-Transfer-Encoding: base64\r\n\r\n";
fputs ($fp, $header);
/* Make an RFC822 Received: line */
$header = "Received: from $REMOTE_ADDR by $SERVER_NAME with HTTP; ";
/* Make an RFC822 Received: line */
$header = "Received: from $REMOTE_ADDR by $SERVER_NAME with HTTP; ";
+ $header .= "$date\r\n";
/* Insert the rest of the header fields */
$header .= "Message-ID: $message_id\r\n";
/* Insert the rest of the header fields */
$header .= "Message-ID: $message_id\r\n";
$header .= "X-Mailer: SquirrelMail (version $version)\r\n"; // Identify SquirrelMail
// Do the MIME-stuff
$header .= "X-Mailer: SquirrelMail (version $version)\r\n"; // Identify SquirrelMail
// Do the MIME-stuff
- $header .= "MIME-Version: 1.0\n";
+ $header .= "MIME-Version: 1.0\r\n";
if (isMultipart()) {
$header .= "Content-Type: multipart/mixed; boundary=\"";
if (isMultipart()) {
$header .= "Content-Type: multipart/mixed; boundary=\"";
writeBody ($imap_stream, $body);
sqimap_append_done ($imap_stream);
writeBody ($imap_stream, $body);
sqimap_append_done ($imap_stream);
// Delete the files uploaded for attaching (if any).
deleteAttachments();
// Delete the files uploaded for attaching (if any).
deleteAttachments();