c8a98781965ed98f67eae3f8a1ceee0d25bc6ff8
6 * Copyright (c) 1999-2003 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * This implements functions that manipulate messages
14 /* Copies specified messages to specified folder */
16 function sqimap_messages_copy ($imap_stream, $start, $end, $mailbox) {
18 $read = sqimap_run_command ($imap_stream, "COPY $start:$end \"$mailbox\"", true, $response, $message, $uid_support);
21 function sqimap_msgs_list_copy ($imap_stream, $id, $mailbox) {
23 $msgs_id = sqimap_message_list_squisher($id);
24 $read = sqimap_run_command ($imap_stream, "COPY $msgs_id \"$mailbox\"", true, $response, $message, $uid_support);
25 $read = sqimap_run_command ($imap_stream, "STORE $msgs_id +FLAGS (\\Deleted)", true, $response, $message, $uid_support);
29 /* Deletes specified messages and moves them to trash if possible */
31 function sqimap_messages_delete ($imap_stream, $start, $end, $mailbox) {
32 global $move_to_trash, $trash_folder, $auto_expunge, $uid_support;
34 if (($move_to_trash == true) && (sqimap_mailbox_exists($imap_stream, $trash_folder) && ($mailbox != $trash_folder))) {
35 sqimap_messages_copy ($imap_stream, $start, $end, $trash_folder);
37 sqimap_messages_flag ($imap_stream, $start, $end, "Deleted", true);
40 function sqimap_msgs_list_delete ($imap_stream, $mailbox, $id) {
41 global $move_to_trash, $trash_folder, $uid_support;
42 $msgs_id = sqimap_message_list_squisher($id);
43 if (($move_to_trash == true) && (sqimap_mailbox_exists($imap_stream, $trash_folder) && ($mailbox != $trash_folder))) {
44 $read = sqimap_run_command ($imap_stream, "COPY $msgs_id \"$trash_folder\"", true, $response, $message, $uid_support);
46 $read = sqimap_run_command ($imap_stream, "STORE $msgs_id +FLAGS (\\Deleted)", true, $response, $message, $uid_support);
50 /* Sets the specified messages with specified flag */
51 function sqimap_messages_flag ($imap_stream, $start, $end, $flag, $handle_errors) {
53 $read = sqimap_run_command ($imap_stream, "STORE $start:$end +FLAGS (\\$flag)", $handle_errors, $response, $message, $uid_support);
56 /* Remove specified flag from specified messages */
57 function sqimap_messages_remove_flag ($imap_stream, $start, $end, $flag, $handle_errors) {
59 $read = sqimap_run_command ($imap_stream, "STORE $start:$end -FLAGS (\\$flag)", $handle_errors, $response, $message, $uid_support);
62 function sqimap_toggle_flag($imap_stream, $id, $flag, $set, $handle_errors) {
64 $msgs_id = sqimap_message_list_squisher($id);
65 $set_string = ($set ?
'+' : '-');
66 $read = sqimap_run_command ($imap_stream, "STORE $msgs_id ".$set_string."FLAGS ($flag)", $handle_errors, $response, $message, $uid_support);
69 function sqimap_get_small_header ($imap_stream, $id, $sent) {
70 $res = sqimap_get_small_header_list($imap_stream, $id, $sent);
75 * Sort the message list and crunch to be as small as possible
76 * (overflow could happen, so make it small if possible)
78 function sqimap_message_list_squisher($messages_array) {
79 if( !is_array( $messages_array ) ) {
80 return $messages_array;
83 sort($messages_array, SORT_NUMERIC
);
85 while ($messages_array) {
86 $start = array_shift($messages_array);
88 while (isset($messages_array[0]) && $messages_array[0] == $end +
1) {
89 $end = array_shift($messages_array);
91 if ($msgs_str != '') {
96 $msgs_str .= ':' . $end;
102 /* returns the references header lines */
103 function get_reference_header ($imap_stream, $message) {
105 $responses = array ();
106 $sid = sqimap_session_id($uid_support);
109 $query = "$sid FETCH $message BODY[HEADER.FIELDS (References)]\r\n";
110 fputs ($imap_stream, $query);
111 $responses = sqimap_read_data_list($imap_stream, $sid, true, $responses, $message);
112 if (!eregi("^\\* ([0-9]+) FETCH", $responses[0][0], $regs)) {
113 $responses = array ();
119 /* get sort order from server and
120 * return it as the $id array for
124 function sqimap_get_sort_order ($imap_stream, $sort, $mbxresponse) {
125 global $default_charset, $thread_sort_messages,
126 $internal_date_sort, $server_sort_array,
127 $sent_folder, $mailbox, $uid_support;
129 if (sqsession_is_registered('server_sort_array')) {
130 sqsession_unregister('server_sort_array');
133 $sid = sqimap_session_id($uid_support);
136 $server_sort_array = array();
137 $sort_test = array();
142 if (isset($mbxresponse['UIDNEXT']) && $mbxresponse['UIDNEXT']) {
143 $uidnext = $mbxresponse['UIDNEXT']-1;
147 $uid_query = "$sid SEARCH UID 1:$uidnext\r\n";
148 fputs($imap_stream, $uid_query);
149 $uids = sqimap_read_data($imap_stream, $sid, true ,$response, $message);
150 if (isset($uids[0])) {
151 if (preg_match("/^\* SEARCH (.+)$/", $uids[0], $regs)) {
152 $server_sort_array = preg_split("/ /", trim($regs[1]));
155 if (!preg_match("/OK/", $response)) {
156 $server_sort_array = 'no';
159 $qty = $mbxresponse['EXISTS'];
160 $server_sort_array = range(1, $qty);
162 sqsession_register($server_sort_array, 'server_sort_array');
163 return $server_sort_array;
166 $sort_on = array (0=> 'DATE',
172 if ($internal_date_sort == true) {
173 $sort_on[0] = 'ARRIVAL';
174 $sort_on[1] = 'ARRIVAL';
176 if ($sent_folder == $mailbox) {
180 if (!empty($sort_on[$sort])) {
181 $sort_query = "$sid SORT ($sort_on[$sort]) ".strtoupper($default_charset)." ALL\r\n";
182 fputs($imap_stream, $sort_query);
183 $sort_test = sqimap_read_data($imap_stream, $sid, true ,$response, $message);
185 if (isset($sort_test[0])) {
186 if (preg_match("/^\* SORT (.+)$/", $sort_test[0], $regs)) {
187 $server_sort_array = preg_split("/ /", trim($regs[1]));
190 if ($sort == 0 ||
$sort == 2 ||
$sort == 4) {
191 $server_sort_array = array_reverse($server_sort_array);
193 if (!preg_match("/OK/", $response)) {
194 $server_sort_array = 'no';
196 sqsession_register($server_sort_array, 'server_sort_array');
197 return $server_sort_array;
201 function sqimap_get_php_sort_order ($imap_stream, $mbxresponse) {
204 if (sqsession_is_registered('php_sort_array')) {
205 sqsession_unregister('php_sort_array');
208 $sid = sqimap_session_id($uid_support);
209 $php_sort_array = array();
212 if (isset($mbxresponse['UIDNEXT']) && $mbxresponse['UIDNEXT']) {
213 $uidnext = $mbxresponse['UIDNEXT']-1;
217 $uid_query = "$sid SEARCH UID 1:$uidnext\r\n";
218 fputs($imap_stream, $uid_query);
219 $uids = sqimap_read_data($imap_stream, $sid, true ,$response, $message);
220 if (isset($uids[0])) {
221 if (preg_match("/^\* SEARCH (.+)$/", $uids[0], $regs)) {
222 $php_sort_array = preg_split("/ /", trim($regs[1]));
225 if (!preg_match("/OK/", $response)) {
226 $php_sort_array = 'no';
229 $qty = $mbxresponse['EXISTS'];
230 $php_sort_array = range(1, $qty);
232 sqsession_register($php_sort_array, 'php_sort_array');
233 return $php_sort_array;
237 /* returns an indent array for printMessageinfo()
238 this represents the amount of indent needed (value)
239 for this message number (key)
242 function get_parent_level ($imap_stream) {
243 global $sort_by_ref, $default_charset, $thread_new;
248 /* loop through the threads and take unwanted characters out
249 of the thread string then chop it up
251 for ($i=0;$i<count($thread_new);$i++
) {
252 $thread_new[$i] = preg_replace("/\s\(/", "(", $thread_new[$i]);
253 $thread_new[$i] = preg_replace("/(\d+)/", "$1|", $thread_new[$i]);
254 $thread_new[$i] = preg_split("/\|/", $thread_new[$i], -1, PREG_SPLIT_NO_EMPTY
);
256 $indent_array = array();
258 $thread_new = array();
260 /* looping through the parts of one message thread */
262 for ($i=0;$i<count($thread_new);$i++
) {
263 /* first grab the parent, it does not indent */
265 if (isset($thread_new[$i][0])) {
266 if (preg_match("/(\d+)/", $thread_new[$i][0], $regs)) {
270 $indent_array[$parent] = 0;
272 /* now the children, checking each thread portion for
273 ),(, and space, adjusting the level and space values
274 to get the indent level
281 for ($k=1;$k<(count($thread_new[$i]))-1;$k++
) {
282 $chars = count_chars($thread_new[$i][$k], 1);
283 if (isset($chars['40'])) { /* testing for ( */
284 $level = $level +
$chars['40'];
286 if (isset($chars['41'])) { /* testing for ) */
287 $level = $level - $chars['41'];
289 /* if we were faking lets stop, this portion
290 of the thread is over
292 if ($level == $cutoff) {
296 if (isset($chars['32'])) { /* testing for space */
297 if (!isset($spaces[$level])) {
300 $spaces[$level] = $spaces[$level] +
$chars['32'];
302 for ($x=0;$x<=$level;$x++
) {
303 if (isset($spaces[$x])) {
304 $spaces_total = $spaces_total +
$spaces[$x];
307 $indent = $level +
$spaces_total;
308 /* must have run into a message that broke the thread
309 so we are adjusting for that portion
312 $indent = $indent +
1;
314 if (preg_match("/(\d+)/", $thread_new[$i][$k], $regs)) {
317 /* the thread must be broken if $indent == 0
318 so indent the message once and start faking it
325 /* dont need abs but if indent was negative
328 $indent_array[$child] = abs($indent);
332 return $indent_array;
336 /* returns an array with each element as a string
337 representing one message thread as returned by
341 function get_thread_sort ($imap_stream) {
342 global $thread_new, $sort_by_ref, $default_charset, $server_sort_array, $uid_support;
343 if (sqsession_is_registered('thread_new')) {
344 sqsession_unregister('thread_new');
346 if (sqsession_is_registered('server_sort_array')) {
347 sqsession_unregister('server_sort_array');
349 $sid = sqimap_session_id($uid_support);
350 $thread_temp = array ();
351 if ($sort_by_ref == 1) {
352 $sort_type = 'REFERENCES';
355 $sort_type = 'ORDEREDSUBJECT';
357 $thread_query = "$sid THREAD $sort_type ".strtoupper($default_charset)." ALL\r\n";
358 fputs($imap_stream, $thread_query);
359 $thread_test = sqimap_read_data($imap_stream, $sid, false, $response, $message);
360 if (isset($thread_test[0])) {
361 if (preg_match("/^\* THREAD (.+)$/", $thread_test[0], $regs)) {
362 $thread_list = trim($regs[1]);
368 if (!preg_match("/OK/", $response)) {
369 $server_sort_array = 'no';
370 return $server_sort_array;
372 if (isset($thread_list)) {
373 $thread_temp = preg_split("//", $thread_list, -1, PREG_SPLIT_NO_EMPTY
);
375 $char_count = count($thread_temp);
377 $thread_new = array();
380 for ($i=0;$i<$char_count;$i++
) {
381 if ($thread_temp[$i] != ')' && $thread_temp[$i] != '(') {
382 $thread_new[$k] = $thread_new[$k] . $thread_temp[$i];
384 elseif ($thread_temp[$i] == '(') {
385 $thread_new[$k] .= $thread_temp[$i];
388 elseif ($thread_temp[$i] == ')') {
390 $thread_new[$k] .= $thread_temp[$i];
391 $counter = $counter - 1;
394 $thread_new[$k] .= $thread_temp[$i];
396 $thread_new[$k] = "";
397 $counter = $counter - 1;
401 sqsession_register($thread_new, 'thread_new');
402 $thread_new = array_reverse($thread_new);
403 $thread_list = implode(" ", $thread_new);
404 $thread_list = str_replace("(", " ", $thread_list);
405 $thread_list = str_replace(")", " ", $thread_list);
406 $thread_list = preg_split("/\s/", $thread_list, -1, PREG_SPLIT_NO_EMPTY
);
407 $server_sort_array = $thread_list;
408 sqsession_register($server_sort_array, 'server_sort_array');
413 function elapsedTime($start) {
414 $stop = gettimeofday();
415 $timepassed = 1000000 * ($stop['sec'] - $start['sec']) +
$stop['usec'] - $start['usec'];
419 function sqimap_get_small_header_list ($imap_stream, $msg_list) {
420 global $squirrelmail_language, $color, $data_dir, $username, $imap_server_type;
421 global $uid_support, $allow_server_sort;
423 /* Get the small headers for each message in $msg_list */
424 $sid = sqimap_session_id($uid_support);
426 $maxmsg = sizeof($msg_list);
428 $msgs_str = sqimap_message_list_squisher($msg_list);
430 $read_list = array();
432 * We need to return the data in the same order as the caller supplied
433 * in $msg_list, but IMAP servers are free to return responses in
434 * whatever order they wish... So we need to re-sort manually
436 for ($i = 0; $i < sizeof($msg_list); $i++
) {
437 $id2index[$msg_list[$i]] = $i;
440 $internaldate = getPref($data_dir, $username, 'internal_date_sort');
442 $query = "$sid FETCH $msgs_str (FLAGS UID RFC822.SIZE INTERNALDATE BODY.PEEK[HEADER.FIELDS (Date To Cc From Subject X-Priority Content-Type)])\r\n";
444 $query = "$sid FETCH $msgs_str (FLAGS UID RFC822.SIZE BODY.PEEK[HEADER.FIELDS (Date To Cc From Subject X-Priority Content-Type)])\r\n";
446 fputs ($imap_stream, $query);
447 $readin_list = sqimap_read_data_list($imap_stream, $sid, false, $response, $message);
449 foreach ($readin_list as $r) {
451 if (!preg_match("/^\\*\s+([0-9]+)\s+FETCH/iAU",$r[0], $regs)) {
452 set_up_language($squirrelmail_language);
453 echo '<br><b><font color=$color[2]>' .
454 _("ERROR : Could not complete request.") .
456 _("Unknown response from IMAP server: ") . ' 1.' .
457 htmlspecialchars($r[0]) . "</font><br>\n";
458 } else if (! isset($id2index[$regs[1]]) ||
!count($id2index[$regs[1]])) {
459 set_up_language($squirrelmail_language);
460 echo '<br><b><font color=$color[2]>' .
461 _("ERROR : Could not complete request.") .
463 _("Unknown message number in reply from server: ") .
464 htmlspecialchars($regs[1]) . "</font><br>\n";
466 $read_list[$id2index[$regs[1]]] = $r;
469 if (!preg_match("/^\\*\s+([0-9]+)\s+FETCH.*UID\s+([0-9]+)\s+/iAU",$r[0], $regs)) {
470 set_up_language($squirrelmail_language);
471 echo '<br><b><font color=$color[2]>' .
472 _("ERROR : Could not complete request.") .
474 _("Unknown response from IMAP server: ") . ' 1.' .
475 htmlspecialchars($r[0]) . "</font><br>\n";
476 } else if (! isset($id2index[$regs[2]]) ||
!count($id2index[$regs[2]])) {
477 set_up_language($squirrelmail_language);
478 echo '<br><b><font color=$color[2]>' .
479 _("ERROR : Could not complete request.") .
481 _("Unknown message number in reply from server: ") .
482 htmlspecialchars($regs[2]) . "</font><br>\n";
484 $read_list[$id2index[$regs[2]]] = $r;
485 $unique_id = $regs[2];
494 "/^X-Priority:(.*)\$/AUi",
497 "/^Subject:(.*)\$/AUi",
498 "/^Content-Type:(.*)\$/AUi"
502 for ($msgi = 0; $msgi < $maxmsg; $msgi++
) {
503 $subject = _("(no subject)");
504 $from = _("Unknown Sender");
507 $cc = $to = $date = $type[0] = $type[1] = $inrepto = '';
508 $flag_seen = $flag_answered = $flag_deleted = $flag_flagged = false;
509 $read = $read_list[$msgi];
512 foreach ($read as $read_part) {
513 //unfold multi-line headers
514 if ($prevline && $prevline{strlen($prevline)-1} == "\n"
515 && ($read_part{0} == ' ' ||
$read_part{0} == "\t")) {
516 $read_part = substr($prevline, 0, -2) . preg_replace('/(\t\s+)/',' ',$read_part);
518 $prevline = $read_part;
519 if ($read_part{0} == '*') {
521 if (preg_match ("/^.+INTERNALDATE\s+\"(.+)\".+/iUA",$read_part, $reg)) {
522 $tmpdate = trim($reg[1]);
523 $tmpdate = str_replace(' ',' ',$tmpdate);
524 $tmpdate = explode(' ',$tmpdate);
525 $date = str_replace('-',' ',$tmpdate[0]) . " " .
530 if (preg_match ("/^.+RFC822.SIZE\s+(\d+).+/iA",$read_part, $reg)) {
533 if (preg_match("/^.+FLAGS\s+\((.*)\).+/iUA", $read_part, $regs)) {
534 $flags = explode(' ',trim($regs[1]));
535 foreach ($flags as $flag) {
536 $flag = strtolower($flag);
537 if ($flag == '\\seen') {
539 } else if ($flag == '\\answered') {
540 $flag_answered = true;
541 } else if ($flag == '\\deleted') {
542 $flag_deleted = true;
543 } else if ($flag == '\\flagged') {
544 $flag_flagged = true;
548 if (preg_match ("/^.+UID\s+(\d+).+/iA",$read_part, $reg)) {
549 $unique_id = $reg[1];
552 $firstchar = strtoupper($read_part{0});
553 if ($firstchar == 'T') {
554 $regpattern = $patterns[0];
556 } else if ($firstchar == 'F') {
557 $regpattern = $patterns[1];
559 } else if ($firstchar == 'X') {
560 $regpattern = $patterns[2];
562 } else if ($firstchar == 'C') {
563 if (strtolower($read_part{1}) == 'c') {
564 $regpattern = $patterns[3];
566 } else if (strtolower($read_part{1}) == 'o') {
567 $regpattern = $patterns[6];
570 } else if ($firstchar == 'D' && !$internaldate ) {
571 $regpattern = $patterns[4];
573 } else if ($firstchar == 'S') {
574 $regpattern = $patterns[5];
576 } else $regpattern = '';
579 if (preg_match ($regpattern, $read_part, $regs)) {
582 $to = trim($regs[1]);
585 $from = trim($regs[1]);
588 $priority = $regs[1];
591 $cc = trim($regs[1]);
597 $subject = trim($regs[1]);
598 if ($subject == "") {
599 $subject = _("(no subject)");
603 $type = strtolower(trim($regs[1]));
604 if ($pos = strpos($type, ";")) {
605 $type = substr($type, 0, $pos);
607 $type = explode("/", $type);
608 if(!is_array($type)) {
611 if (!isset($type[1])) {
625 $date = str_replace(' ', ' ', $date);
626 $tmpdate = explode(' ', trim($date));
628 $tmpdate = $date = array('', '', '', '', '', '');
631 $messages[$msgi]['ID'] = $unique_id;
633 $messages[$msgi]['ID'] = $msg_list[$msgi];
636 $messages[$msgi]['TIME_STAMP'] = getTimeStamp($tmpdate);
637 $messages[$msgi]['DATE_STRING'] = getDateString($messages[$msgi]['TIME_STAMP']);
638 $messages[$msgi]['FROM'] = parseAddress($from);
639 $messages[$msgi]['SUBJECT'] = $subject;
640 // if (handleAsSent($mailbox)) {
641 $messages[$msgi]['TO'] = parseAddress($to);
643 $messages[$msgi]['PRIORITY'] = $priority;
644 $messages[$msgi]['CC'] = parseAddress($cc);
645 $messages[$msgi]['SIZE'] = $size;
646 $messages[$msgi]['TYPE0'] = $type[0];
647 $messages[$msgi]['FLAG_DELETED'] = $flag_deleted;
648 $messages[$msgi]['FLAG_ANSWERED'] = $flag_answered;
649 $messages[$msgi]['FLAG_SEEN'] = $flag_seen;
650 $messages[$msgi]['FLAG_FLAGGED'] = $flag_flagged;
652 /* non server sort stuff */
653 if (!$allow_server_sort) {
654 $from = parseAddress($from);
656 $from = decodeHeader($from[0][1]);
660 $messages[$msgi]['FROM-SORT'] = $from;
661 $subject_sort = strtolower(decodeHeader($subject));
662 if (preg_match("/^(vedr|sv|re|aw):\s*(.*)$/si", $subject_sort, $matches)){
663 $messages[$msgi]['SUBJECT-SORT'] = $matches[2];
665 $messages[$msgi]['SUBJECT-SORT'] = $subject_sort;
673 function sqimap_get_headerfield($imap_stream, $field) {
674 $sid = sqimap_session_id(false);
677 $read_list = array();
679 $query = "$sid FETCH 1:* (UID BODY.PEEK[HEADER.FIELDS ($field)])\r\n";
680 fputs ($imap_stream, $query);
681 $readin_list = sqimap_read_data_list($imap_stream, $sid, false, $response, $message);
684 foreach ($readin_list as $r) {
686 /* first we unfold the header */
687 $r = str_replace(array("\r\n\t","\r\n\s"),array('',''),$r);
689 * now we can make a new header array with each element representing
692 $r = explode("\r\n" , $r);
694 if (!preg_match("/^\\*\s+([0-9]+)\s+FETCH/iAU",$r[0], $regs)) {
695 set_up_language($squirrelmail_language);
696 echo '<br><b><font color=$color[2]>' .
697 _("ERROR : Could not complete request.") .
699 _("Unknown response from IMAP server: ") . ' 1.' .
700 $r[0] . "</font><br>\n";
705 if (!preg_match("/^\\*\s+([0-9]+)\s+FETCH.*UID\s+([0-9]+)\s+/iAU",$r[0], $regs)) {
706 set_up_language($squirrelmail_language);
707 echo '<br><b><font color=$color[2]>' .
708 _("ERROR : Could not complete request.") .
710 _("Unknown response from IMAP server: ") . ' 1.' .
711 $r[0] . "</font><br>\n";
717 $field = substr($field,strlen($field)+
2);
718 $result[] = array($id,$field);
728 * Returns a message array with all the information about a message.
729 * See the documentation folder for more information about this array.
731 function sqimap_get_message ($imap_stream, $id, $mailbox) {
735 $read = sqimap_run_command ($imap_stream, "FETCH $id (FLAGS BODYSTRUCTURE)", true, $response, $message, $uid_support);
737 if (preg_match('/.+FLAGS\s\((.*)\)\s/AUi',$read[0],$regs)) {
738 if (trim($regs[1])) {
739 $flags = preg_split('/ /', $regs[1],-1,'PREG_SPLIT_NI_EMPTY');
743 echo "ERROR Yeah I know, not a very usefull errormessage (id = $id, mailbox = $mailbox sqimap_get_message)";
746 $bodystructure = implode('',$read);
747 $msg = mime_structure($bodystructure,$flags);
748 $read = sqimap_run_command ($imap_stream, "FETCH $id BODY[HEADER]", true, $response, $message, $uid_support);
749 $rfc822_header = new Rfc822Header();
750 $rfc822_header->parseHeader($read);
751 $msg->rfc822_header
= $rfc822_header;
755 /* Wrapper function that reformats the header information. */
756 function sqimap_get_message_header ($imap_stream, $id, $mailbox) {
758 $read = sqimap_run_command ($imap_stream, "FETCH $id BODY[HEADER]", true, $response, $message, $uid_support);
759 $header = sqimap_get_header($imap_stream, $read);
761 $header->mailbox
= $mailbox;
765 /* Wrapper function that reformats the entity header information. */
766 function sqimap_get_ent_header ($imap_stream, $id, $mailbox, $ent) {
768 $read = sqimap_run_command ($imap_stream, "FETCH $id BODY[$ent.HEADER]", true, $response, $message, $uid_support);
769 $header = sqimap_get_header($imap_stream, $read);
771 $header->mailbox
= $mailbox;
775 /* function to get the mime headers */
776 function sqimap_get_mime_ent_header ($imap_stream, $id, $mailbox, $ent) {
778 $read = sqimap_run_command ($imap_stream, "FETCH $id:$id BODY[$ent.MIME]", true, $response, $message, $uid_support);
779 $header = sqimap_get_header($imap_stream, $read);
781 $header->mailbox
= $mailbox;