Part 1 of switch to use of SM_PATH with require_once.
[squirrelmail.git] / src / retrievalerror.php
index edce30cf9bd181d48fd40416798e815ab92fa8bc..2bfc9c865fa03390cc017799e9f4d9107d91e1eb 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 . 'src/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 . 'src/load_prefs.php');
 
+$destination = 'retrievalerror@squirrelmail.org';
 $attachments = array();
 
 function ClearAttachments() {
@@ -56,7 +59,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,15 +91,15 @@ 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);
 
-$par = 'mailbox='.urlencode($mailbox)."&passed_id=$passed_id";
+$par = 'mailbox='.urlencode($mailbox)."&passed_id=$passed_id";
 if (isset($where) && isset($what)) {
-    $par .= '&where='.urlencode($where).'&what='.urlencode($what);
+    $par .= '&where='.urlencode($where).'&what='.urlencode($what);
 } else {
-    $par .= "&startMessage=$startMessage&show_more=0";
+    $par .= "&startMessage=$startMessage&show_more=0";
 }
 
 echo '<BR>The message has been submitted to the developers knowledgebase!<BR>' .
@@ -104,4 +107,4 @@ echo '<BR>The message has been submitted to the developers knowledgebase!<BR>' .
      'Please submit every message only once<BR>' .
      "<A HREF=\"../src/read_body.php?$par\">View the message</A><BR>";
 
-?>
\ No newline at end of file
+?>