_debug) { print "connecting to $host and authenticating as $username\n"; } $options = ['ssl' => $ssl]; $this->_transport = new ezcMailPop3Transport($host, NULL, $options); $this->_transport->authenticate($username, $password); $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, [ 'CiviMail.ignored', date('Y'), date('m'), date('d'), ])); $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, [ 'CiviMail.processed', date('Y'), date('m'), date('d'), ])); } /** * Fetch the specified message to the local ignore folder. * * @param int $nr * Number of the message to fetch. */ public function markIgnored($nr) { if ($this->_debug) { print "fetching message $nr and putting it in the ignored mailbox\n"; } $set = new ezcMailStorageSet($this->_transport->fetchByMessageNr($nr), $this->_ignored); $parser = new ezcMailParser(); $parser->parseMail($set); $this->_transport->delete($nr); } /** * Fetch the specified message to the local processed folder. * * @param int $nr * Number of the message to fetch. */ public function markProcessed($nr) { if ($this->_debug) { print "fetching message $nr and putting it in the processed mailbox\n"; } $set = new ezcMailStorageSet($this->_transport->fetchByMessageNr($nr), $this->_processed); $parser = new ezcMailParser(); $parser->parseMail($set); $this->_transport->delete($nr); } }