- This block has been added in order to avoid the problem
- caused by the * OK [PARSE] Missing parameter answer
- Please, replace it with a better parsing if you know how.
- */
- $read = fgets ($imap_stream, $bufsize);
+ * This block has been added in order to avoid the problem
+ * caused by the * OK [PARSE] Missing parameter answer
+ * Please, replace it with a better parsing if you know how.
+ * This block has been updated by
+ * Seth E. Randall <sethr@missoulafcu.org>. Once we see
+ * one OK [PARSE line, we just go through and keep
+ * tossing them out until we get something different.
+ */
+ while ( preg_match('/^\* OK \[PARSE.*/', $read, $regs ) ) {
+ $read = fgets($imap_stream, $bufsize);
+ }