I'm using these libraries for an email application I'm building.
$storage = new Zend_Mail_Storage_Imap($imap);
if (strpos($storage->getMessage($i),'chocolate') !== FALSE )
{
//Move to chocolate folder here
}
Also, is there a way to put incoming emails from this sender to automatically go into the chocolate folder from now on? ...similar to how you can build labels in gmail and all mail from that sender will automatically go into that folder in the future.