Calendar rg=0
[squirrelmail.git] / src / retrievalerror.php
index 1b4ed72331d29b5c5e6483cb708232f162e6f74e..57fc68413fb9c1c95200ccd6d9c72a0f9a0e23d4 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/imap.php');
-require_once('../functions/smtp.php');
-require_once('../functions/page_header.php');
-require_once('../src/load_prefs.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
 
-$destination = 'retrievalerror@squirrelmail.org';
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'include/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/smtp.php');
+require_once(SM_PATH . 'functions/page_header.php');
+require_once(SM_PATH . 'include/load_prefs.php');
 
+$destination = 'retrievalerror@squirrelmail.org';
 $attachments = array();
 
+/* globals */
+
+$key = $_COOKIE['key'];
+$username = $_SESSION['username'];
+$onetimepad = $_SESSION['onetimepad'];
+
+$mailbox = $_GET['mailbox'];
+$passed_id = $_GET['passed_id'];
+$startMessage = $_GET['startMessage'];
+$show_more = $_GET['show_more'];
+$response = $_GET['response'];
+$message = $_GET['message'];
+$topline = $_GET['topline'];
+
+if(isset($_GET['where'])) {
+    $where = $_GET['where'];
+}
+if(isset($_GET['what'])) {
+    $what = $_GET['what'];
+}
+
+/* end globals */
+
 function ClearAttachments() {
     global $attachments, $attachment_dir, $username;
 
@@ -56,7 +82,7 @@ while (file_exists($full_localfilename)) {
 }
 
 /* Write Attachment to file */
-$fp = fopen ($full_localfilename, 'w');
+$fp = fopen ($full_localfilename, 'wb');
 fputs ($fp, $thebastard);
 fclose ($fp);
 
@@ -88,7 +114,7 @@ if ($imap_stream) {
 
 $body .= "\nFETCH line for gathering the whole message: $topline2\n";
 
-sendMessage($destination, '', '', 'submitted message', $body, 0);
+sendMessage($destination, '', '', 'submitted message', $body, False, 0);
 
 displayPageHeader($color, $mailbox);