https://rcstar.net/2011/133/novyj-manual-po-nastrojke-imap-php.jsp
Новый мануал по настройке Imap php