PHP. Руководство по PHP. 2005
imap_thread
imap_thread
Description
array imap_thread (resource stream_id [, int options])imap_thread() returns an associative array containing
a tree of messages threaded by REFERENCES, or FALSE
on error.
Every message in the current mailbox will be represented by three entries
in the resulting array:
$thread["XX.num"] - current message number
$thread["XX.next"]
$thread["XX.branch"]
imap_subscribe
imap_timeout
Отвечу на любые вопросы. С уважением, Дмитрий Владимирович.