imap = new ezcMailImapTransport( ezcConfigurationManager::getInstance()->getSetting( "mail", "imap", "host" ), ezcConfigurationManager::getInstance()->getSetting( "mail", "imap", "port" ) ); $this->imap->authenticate( ezcConfigurationManager::getInstance()->getSetting( "mail", "imap", "user" ), ezcConfigurationManager::getInstance()->getSetting( "mail", "imap", "pass" ) ); $this->imap->selectMailbox( ezcConfigurationManager::getInstance()->getSetting( "mail", "imap", "mailbox" ) ); } public function run() { $session = ezcPersistentSessionInstance::get(); // Fetch and delete $rawMessages = $this->imap->fetchAll( true ); $parser = new ezcMailParser(); foreach ( $parser->parseMail( $rawMessages, "ezcM2fMail" ) as $mail ) { $session->save( $mail ); } } } $cronJob = new ezcM2fCron(); $cronJob->run(); ?>