Use rcmail::imap_connect() to establish IMAP connections; always initialize rcube_imap object in mail steps
| | |
| | | $out .= '<select id="action_mailbox' .$id. '" name="_action_mailbox[]" style="display:' |
| | | .(!isset($action) || $action['type']=='fileinto' ? 'inline' : 'none'). '">'; |
| | | |
| | | $this->rc->imap_init(true); |
| | | $this->rc->imap_connect(); |
| | | |
| | | $a_folders = $this->rc->imap->list_mailboxes(); |
| | | $delimiter = $this->rc->imap->get_hierarchy_delimiter(); |
| | |
| | | // if the use_subscriptions preference changes, flush the folder cache |
| | | if (($use_subscriptions && !isset($_POST['_use_subscriptions'])) || |
| | | (!$use_subscriptions && isset($_POST['_use_subscriptions']))) { |
| | | $rcmail->imap_init(true); |
| | | $rcmail->imap_connect(); |
| | | $rcmail->imap->clear_cache('mailboxes'); |
| | | } |
| | | } |
| | |
| | | | program/include/rcmail.php | |
| | | | | |
| | | | This file is part of the RoundCube Webmail client | |
| | | | Copyright (C) 2008-2009, RoundCube Dev. - Switzerland | |
| | | | Copyright (C) 2008-2010, RoundCube Dev. - Switzerland | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | | PURPOSE: | |
| | |
| | | */ |
| | | public function imap_init($connect = false) |
| | | { |
| | | // already initialized |
| | | if (is_object($this->imap)) |
| | | return; |
| | | |
| | | $this->imap = new rcube_imap($this->db); |
| | | $this->imap->debug_level = $this->config->get('debug_level'); |
| | | $this->imap->skip_deleted = $this->config->get('skip_deleted'); |
| | |
| | | $hook = $this->plugins->exec_hook('imap_init', array('fetch_headers' => $this->imap->fetch_add_headers)); |
| | | if ($hook['fetch_headers']) |
| | | $this->imap->fetch_add_headers = $hook['fetch_headers']; |
| | | |
| | | if ($connect) |
| | | |
| | | // support this parameter for backward compatibility but log warning |
| | | if ($connect) { |
| | | $this->imap_connect(); |
| | | raise_error(array('code' => 800, 'type' => 'imap', 'file' => __FILE__, |
| | | 'message' => "rcube::imap_init(true) is deprecated, use rcube::imap_connect() instead"), true, false); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | if (!$this->authenticate_session()) |
| | | return; |
| | | |
| | | $this->imap_init(true); |
| | | $this->imap_connect(); |
| | | } |
| | | |
| | | if ($config['logout_purge'] && !empty($config['trash_mbox'])) { |
| | |
| | | | program/steps/mail/func.inc | |
| | | | | |
| | | | This file is part of the RoundCube Webmail client | |
| | | | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland | |
| | | | Copyright (C) 2005-2010, RoundCube Dev. - Switzerland | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | | PURPOSE: | |
| | |
| | | // actions that do not require imap connection |
| | | $NOIMAP_ACTIONS = array('spell', 'addcontact', 'autocomplete', 'upload', 'display-attachment', 'remove-attachment'); |
| | | |
| | | // always instantiate imap object (but not yet connect to server) |
| | | $RCMAIL->imap_init(); |
| | | |
| | | // log in to imap server |
| | | if (!in_array($RCMAIL->action, $NOIMAP_ACTIONS) && !$RCMAIL->imap_connect()) { |
| | | $RCMAIL->kill_session(); |
| | |
| | | |
| | | // Configure special folders |
| | | if (!isset($no_override['default_imap_folders'])) { |
| | | $RCMAIL->imap_init(true); |
| | | $RCMAIL->imap_connect(); |
| | | $select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true, |
| | | 'maxlength' => 30, 'exceptions' => array('INBOX'))); |
| | | |
| | |
| | | // WARNING: folder names in UI are encoded with RCMAIL_CHARSET |
| | | |
| | | // init IMAP connection |
| | | $RCMAIL->imap_init(true); |
| | | $RCMAIL->imap_connect(); |
| | | |
| | | // subscribe to one or more mailboxes |
| | | if ($RCMAIL->action=='subscribe') |