From 80fbdaa2d9c011174035a821435fcdde667f578f Mon Sep 17 00:00:00 2001 From: thomascube Date: Fri, 14 Aug 2009 08:24:09 +0000 Subject: Changed imap_connect hook according to suggestions in #1485956 --- program/include/rcube_imap.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php index b27124582..78d44860f 100644 --- a/program/include/rcube_imap.php +++ b/program/include/rcube_imap.php @@ -36,7 +36,7 @@ require_once('lib/tnef_decoder.inc'); * * @package Mail * @author Thomas Bruederli - * @version 1.40 + * @version 1.5 * @link http://ilohamail.org */ class rcube_imap @@ -107,16 +107,20 @@ class rcube_imap raise_error(array('code' => 403, 'type' => 'imap', 'file' => __FILE__, 'message' => 'Open SSL not available;'), TRUE, FALSE); $port = 143; - } + } $ICL_PORT = $port; $IMAP_USE_INTERNAL_DATE = false; - $data = rcmail::get_instance()->plugins->exec_hook('imap_connect', array('host' => $host, 'user' => $user)); - if (!empty($data['pass'])) - $pass = $data['pass']; + $attempt = 0; + do { + $data = rcmail::get_instance()->plugins->exec_hook('imap_connect', array('host' => $host, 'user' => $user, 'attempt' => ++$attempt)); + if (!empty($data['pass'])) + $pass = $data['pass']; + + $this->conn = iil_Connect($data['host'], $data['user'], $pass, $this->options); + } while(!$this->conn && $data['retry']); - $this->conn = iil_Connect($data['host'], $data['user'], $pass, $this->options); $this->host = $data['host']; $this->user = $data['user']; $this->pass = $pass; -- cgit v1.2.3