PHP class for dumping email messages to a MySQL database with IMAP