Skip to content

Commit

Permalink
Provide function in rcube to connect to IMAP
Browse files Browse the repository at this point in the history
This is useful for plugins like FreeBusy [1] that previously
connected to IMAP via plain rcube_imap::connect().

[1] https://git.kolab.org/source/freebusy/browse/master/lib/Kolab/FreeBusy/SourceIMAP.php
  • Loading branch information
jaudriga committed Apr 17, 2024
1 parent 0f405f4 commit f891a11
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions program/include/rcmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -764,13 +764,7 @@ public function login($username, $password, $host = null, $cookiecheck = false,
$storage = $this->get_storage();

// try to log in
if (!$storage->connect($host, $username, $password, $port, $ssl)) {
if ($user) {
$user->failed_login();
}

// Wait a second to slow down brute-force attacks (#1490549)
sleep(1);
if (!$this->imap_connect($storage, $host, $username, $password, $port, $ssl, $user)) {
return false;
}

Expand All @@ -782,7 +776,6 @@ public function login($username, $password, $host = null, $cookiecheck = false,
return true;
}


// user already registered -> update user's record
if (is_object($user)) {
// update last login timestamp
Expand Down

0 comments on commit f891a11

Please sign in to comment.