3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2017
35 * Class CRM_Mailing_MailStore_Pop3
37 class CRM_Mailing_MailStore_Pop3
extends CRM_Mailing_MailStore
{
40 * Connect to the supplied POP3 server and make sure the two mail dirs exist
44 * @param string $username
45 * Authentication username.
46 * @param string $password
47 * Authentication password.
49 * Whether to use POP3 or POP3S.
51 * @return \CRM_Mailing_MailStore_Pop3
53 public function __construct($host, $username, $password, $ssl = TRUE) {
55 print "connecting to $host and authenticating as $username\n";
58 $options = array('ssl' => $ssl);
59 $this->_transport
= new ezcMailPop3Transport($host, NULL, $options);
60 $this->_transport
->authenticate($username, $password);
62 $this->_ignored
= $this->maildir(implode(DIRECTORY_SEPARATOR
, array(
68 $this->_processed
= $this->maildir(implode(DIRECTORY_SEPARATOR
, array(
77 * Fetch the specified message to the local ignore folder.
80 * Number of the message to fetch.
82 public function markIgnored($nr) {
84 print "fetching message $nr and putting it in the ignored mailbox\n";
86 $set = new ezcMailStorageSet($this->_transport
->fetchByMessageNr($nr), $this->_ignored
);
87 $parser = new ezcMailParser();
88 $parser->parseMail($set);
89 $this->_transport
->delete($nr);
93 * Fetch the specified message to the local processed folder.
96 * Number of the message to fetch.
98 public function markProcessed($nr) {
100 print "fetching message $nr and putting it in the processed mailbox\n";
102 $set = new ezcMailStorageSet($this->_transport
->fetchByMessageNr($nr), $this->_processed
);
103 $parser = new ezcMailParser();
104 $parser->parseMail($set);
105 $this->_transport
->delete($nr);