X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fmailbox.php;h=45d9021ae6268fc56692bdbdd70227ffd8969926;hb=f8dc8d6180df3851ed15bcd39373fcf1760f3290;hp=056abb2f670fb11f33f391414c6e3272daa8052c;hpb=7c9499e1836d574fc0b398e45d912f6c2d032aac;p=squirrelmail.git
diff --git a/functions/mailbox.php b/functions/mailbox.php
index 056abb2f..45d9021a 100644
--- a/functions/mailbox.php
+++ b/functions/mailbox.php
@@ -49,7 +49,7 @@
function getMessageHeaders($imapConnection, $start, $end, &$from, &$subject, &$date) {
$rel_start = $start;
if (($start > $end) || ($start < 1)) {
- echo "Error in message header fetching. Start message: $start, End message: $end
";
+ echo _("Error in message header fetching. Start message: "). $start, _("End message: "). "$end
";
exit;
}
@@ -227,6 +227,7 @@
function expungeBox($imapConnection, $mailbox) {
selectMailbox($imapConnection, $mailbox, $num);
fputs($imapConnection, "1 EXPUNGE\n");
+ imapReadData($imapConnection, "1", true, $response, $message);
}
function getFolderNameMinusINBOX($mailbox, $del) {
@@ -240,10 +241,11 @@
}
/** This function gets all the information about a message. Including Header and body **/
- function fetchMessage($imapConnection, $id) {
+ function fetchMessage($imapConnection, $id, $mailbox) {
+ $message["INFO"]["ID"] = $id;
+ $message["INFO"]["MAILBOX"] = $mailbox;
$message["HEADER"] = fetchHeader($imapConnection, $id);
$message["ENTITIES"] = fetchBody($imapConnection, $message["HEADER"]["BOUNDARY"], $id, $message["HEADER"]["TYPE0"], $message["HEADER"]["TYPE1"]);
-
return $message;
}
@@ -263,7 +265,7 @@
}
/** ENCODING TYPE **/
- else if (substr($read[$i], 0, 26) == "Content-Transfer-Encoding:") {
+ else if (substr(strtolower($read[$i]), 0, 26) == "content-transfer-encoding:") {
$header["ENCODING"] = strtolower(trim(substr($read[$i], 26)));
}
@@ -439,7 +441,7 @@
$encoding = "us-ascii";
$i = 0;
while (trim($read[$i]) != "") {
- if (substr($read[$i], 0, 26) == "Content-Transfer-Encoding:") {
+ if (substr(strtolower($read[$i]), 0, 26) == "content-transfer-encoding:") {
$encoding = strtolower(trim(substr($read[$i], 26)));
} else if (substr($read[$i], 0, 13) == "Content-Type:") {
@@ -464,6 +466,7 @@
$i++;
$read[$i] = trim($read[$i]);
}
+ $i--;
/** Detect the boundary of a multipart message **/
if (strpos(strtolower(trim($line)), "boundary=")) {
@@ -520,79 +523,4 @@
$read = $entity;
}
- function parsePlainTextMessage($line) {
- $line = "^^$line";
-
- if ((strpos(strtolower($line), "") == false) &&
- (strpos(strtolower($line), "