summaryrefslogtreecommitdiff
path: root/program/lib
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2006-08-25 11:51:11 +0000
committerthomascube <thomas@roundcube.net>2006-08-25 11:51:11 +0000
commitf7bfec96be8bf095ffc0af64a761f3866d5947b9 (patch)
tree93f5a01b75cb241f71ce625bbcba85a0fda52e23 /program/lib
parent5f56a5bfa9ecdddd8c69884a6ac25b758c2b89f3 (diff)
Finalized new message parsing. Attention: changes in database schema
Diffstat (limited to 'program/lib')
-rw-r--r--program/lib/imap.inc14
1 files changed, 8 insertions, 6 deletions
diff --git a/program/lib/imap.inc b/program/lib/imap.inc
index 2c07f3409..b2e1d43c0 100644
--- a/program/lib/imap.inc
+++ b/program/lib/imap.inc
@@ -46,6 +46,7 @@
- Casting date parts in iil_StrToTime() to avoid mktime() warnings
- Also acceppt LIST responses in iil_C_ListSubscribed()
- Sanity check of $message_set in iil_C_FetchHeaders(), iil_C_FetchHeaderIndex(), iil_C_FetchThreadHeaders()
+ - Implemented UID FETCH in iil_C_FetchHeaders()
- Removed some debuggers (echo ...)
********************************************************/
@@ -1195,7 +1196,7 @@ function iil_IndexThreads(&$tree){
return $t_index;
}
-function iil_C_FetchHeaders(&$conn, $mailbox, $message_set){
+function iil_C_FetchHeaders(&$conn, $mailbox, $message_set, $uidfetch=false){
global $IMAP_USE_INTERNAL_DATE;
$c=0;
@@ -1231,7 +1232,8 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set){
/* FETCH date,from,subject headers */
$key="fh".($c++);
- $request=$key." FETCH $message_set (BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID REFERENCE)])\r\n";
+ $prefix=$uidfetch?" UID":"";
+ $request=$key.$prefix." FETCH $message_set (BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID REFERENCE)])\r\n";
if (!fputs($fp, $request)) return false;
do{
@@ -1309,7 +1311,7 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set){
Sample reply line: "* 3 FETCH (UID 2417 RFC822.SIZE 2730 FLAGS (\Seen \Deleted))"
*/
$command_key="fh".($c++);
- $request= $command_key." FETCH $message_set (UID RFC822.SIZE FLAGS INTERNALDATE)\r\n";
+ $request= $command_key.$prefix." FETCH $message_set (UID RFC822.SIZE FLAGS INTERNALDATE)\r\n";
if (!fputs($fp, $request)) return false;
do{
$line=chop(iil_ReadLine($fp, 200));
@@ -1401,10 +1403,10 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set){
}
-function iil_C_FetchHeader(&$conn, $mailbox, $id){
+function iil_C_FetchHeader(&$conn, $mailbox, $id, $uidfetch=false){
$fp = $conn->fp;
- $a=iil_C_FetchHeaders($conn, $mailbox, $id);
- if (is_array($a)) return $a[$id];
+ $a=iil_C_FetchHeaders($conn, $mailbox, $id, $uidfetch);
+ if (is_array($a)) return array_shift($a);
else return false;
}