3 * StatusNet, the distributed open-source microblogging tool
5 * IMAP plugin to allow StatusNet to grab incoming emails and handle them as new user posts
9 * LICENCE: This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Affero General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Affero General Public License for more details.
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * @author Craig Andrews <candrews@integralblue.com
25 * @copyright 2009 StatusNet, Inc.
26 * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
28 * @link http://status.net/
31 if (!defined('STATUSNET')) {
36 * IMAP plugin to allow StatusNet to grab incoming emails and handle them as new user posts
40 * @author Craig Andrews <candrews@integralblue.com
41 * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
42 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
43 * @link http://status.net/
45 class ImapPlugin extends Plugin
50 public $poll_frequency = 60;
52 function initialize(){
53 if(!isset($this->mailbox)){
54 // TRANS: Exception thrown when configuration of the IMAP plugin is incorrect.
55 throw new Exception(_m('A mailbox must be specified.'));
57 if(!isset($this->user)){
58 // TRANS: Exception thrown when configuration of the IMAP plugin is incorrect.
59 throw new Exception(_m('A user must be specified.'));
61 if(!isset($this->password)){
62 // TRANS: Exception thrown when configuration of the IMAP plugin is incorrect.
63 throw new Exception(_m('A password must be specified.'));
65 if(!isset($this->poll_frequency)){
66 // TRANS: Exception thrown when configuration of the IMAP plugin is incorrect.
67 // TRANS: poll_frequency is a setting that should not be translated.
68 throw new Exception(_m('A poll_frequency must be specified.'));
74 function onStartQueueDaemonIoManagers(&$classes)
76 $classes[] = new ImapManager($this);
79 function onPluginVersion(array &$versions)
81 $versions[] = array('name' => 'IMAP',
82 'version' => GNUSOCIAL_VERSION,
83 'author' => 'Craig Andrews',
84 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/IMAP',
86 // TRANS: Plugin description.
87 _m('The IMAP plugin allows for StatusNet to check a POP or IMAP mailbox for incoming mail containing user posts.'));