| | |
| | | if ($bodystr) |
| | | $request .= "BODYSTRUCTURE "; |
| | | $request .= "BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE "; |
| | | $request .= "LIST-POST DISPOSITION-NOTIFICATION-TO".$add.")])"; |
| | | $request .= "CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO".$add.")])"; |
| | | |
| | | if (!$this->putLine($request)) { |
| | | $this->setError(self::ERROR_COMMAND, "Unable to send command: $request"); |
| | |
| | | while ($this->tokenizeResponse($response, 1) == '*') { |
| | | $cmd = strtoupper($this->tokenizeResponse($response, 1)); |
| | | // * LIST (<options>) <delimiter> <mailbox> |
| | | if (!$lstatus || $cmd == 'LIST' || $cmd == 'LSUB') { |
| | | if ($cmd == 'LIST' || $cmd == 'LSUB') { |
| | | list($opts, $delim, $mailbox) = $this->tokenizeResponse($response, 3); |
| | | |
| | | // Add to result array |
| | |
| | | list($name, $value) = $this->tokenizeResponse($status, 2); |
| | | $folders[$mailbox][$name] = $value; |
| | | } |
| | | } |
| | | // other untagged response line, skip it |
| | | else { |
| | | $response = ltrim($response); |
| | | if (($position = strpos($response, "\n")) !== false) |
| | | $response = substr($response, $position+1); |
| | | else |
| | | $response = ''; |
| | | } |
| | | } |
| | | |
| | |
| | | break; |
| | | } |
| | | |
| | | // excluded chars: SP, CTL, (, ), {, ", ], % |
| | | if (preg_match('/^([\x21\x23\x24\x26\x27\x2A-\x5C\x5E-\x7A\x7C-\x7E]+)/', $str, $m)) { |
| | | // excluded chars: SP, CTL, ) |
| | | if (preg_match('/^([^\x00-\x20\x29\x7F]+)/', $str, $m)) { |
| | | $result[] = $m[1] == 'NIL' ? NULL : $m[1]; |
| | | $str = substr($str, strlen($m[1])); |
| | | } |