| | |
| | | +-----------------------------------------------------------------------+ |
| | | | program/include/rcube_imap_generic.php | |
| | | | | |
| | | | This file is part of the RoundCube Webmail client | |
| | | | Copyright (C) 2005-2010, RoundCube Dev. - Switzerland | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2005-2010, Roundcube Dev. - Switzerland | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | | PURPOSE: | |
| | |
| | | |
| | | function close() |
| | | { |
| | | if ($this->putLine("I LOGOUT")) { |
| | | if ($this->logged && $this->putLine("I LOGOUT")) { |
| | | if (!feof($this->fp)) |
| | | fgets($this->fp, 1024); |
| | | } |
| | |
| | | $message_set = $this->compressMessageSet($message_set); |
| | | |
| | | if ($add) |
| | | $add = ' '.strtoupper(trim($add)); |
| | | $add = ' '.trim($add); |
| | | |
| | | /* FETCH uid, size, flags and headers */ |
| | | $key = 'FH12'; |
| | |
| | | $request .= "(UID RFC822.SIZE FLAGS INTERNALDATE "; |
| | | if ($bodystr) |
| | | $request .= "BODYSTRUCTURE "; |
| | | $request .= "BODY.PEEK[HEADER.FIELDS "; |
| | | $request .= "(DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC "; |
| | | $request .= "CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID "; |
| | | $request .= "REFERENCES DISPOSITION-NOTIFICATION-TO X-PRIORITY "; |
| | | $request .= "X-DRAFT-INFO".$add.")])"; |
| | | $request .= "BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE "; |
| | | $request .= "LIST-POST DISPOSITION-NOTIFICATION-TO".$add.")])"; |
| | | |
| | | if (!$this->putLine($request)) { |
| | | return false; |
| | |
| | | break; |
| | | |
| | | if (preg_match('/^\* ([0-9]+) FETCH/', $line, $m)) { |
| | | $id = $m[1]; |
| | | $id = intval($m[1]); |
| | | |
| | | $result[$id] = new rcube_mail_header; |
| | | $result[$id]->id = $id; |
| | |
| | | if ($parts_count>=6) { |
| | | for ($i=0; $i<$parts_count; $i=$i+2) { |
| | | if ($a[$i] == 'UID') |
| | | $result[$id]->uid = $a[$i+1]; |
| | | $result[$id]->uid = intval($a[$i+1]); |
| | | else if ($a[$i] == 'RFC822.SIZE') |
| | | $result[$id]->size = $a[$i+1]; |
| | | $result[$id]->size = intval($a[$i+1]); |
| | | else if ($a[$i] == 'INTERNALDATE') |
| | | $time_str = $a[$i+1]; |
| | | else if ($a[$i] == 'FLAGS') |