Hi everyone, like the title say, let's add the Google's reCaptcha into the Roundcube's login form. First,
this post is based on this article.
Here we go:Open a terminal and connect to CWP server.
#Installing GITyum install git -y
#Clone the plugin through gitcd /usr/local/cwpsrv/var/services/roundcube/plugins/
git clone https://github.com/dsoares/rcguard.git rcguard
#Change directory permissionchown -R cwpsvc:cwpsvc rcguard/
#Rename the config filecd rcguard
mv config.inc.php.dist config.inc.php
#Edit the config file and adding the Keysnano config.inc.php
Once in there look for:
// Public key for reCAPTCHA<br>$config['recaptcha_publickey'] = '';
// Private key for reCAPTCHA<br>$config['recaptcha_privatekey'] = '';
Add your Keys, if you don't have any,
you can generate them hereNOTE: to save changes in nano editor, press Ctrl+O and Ctrl+X to exit#Like the original article say:You can change other settings of the plugin per your needs. For example this one:
// Number of failed logins before reCAPTCHA is shown
$rcmail_config['failed_attempts'] = 5;
Change it to 0 (zero) to show the captcha always.#Create a new table in the Roundcube database.Go to PHPMyAdmin, selec the Roundcube database (roundcube), click the SQL tab and copy/paste the following code:
CREATE TABLE `rcguard` (
`ip` VARCHAR(40) NOT NULL,
`first` DATETIME NOT NULL,
`last` DATETIME NOT NULL,
`hits` INT(10) NOT NULL,
PRIMARY KEY (`ip`),
INDEX `last_index` (`last`),
INDEX `hits_index` (`hits`)
) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci;
Then, click "Go"
-----------------------------------------------
Image for Reference:
-----------------------------------------------#Last StepAdd 'rcguard' into Roundcube's config file. Should be something like this:
nano /usr/local/cwpsrv/var/services/roundcube/config/config.inc.php
$config['plugins'] = array(
'plugin1',
'plugin2',
'rcguard',
That's all, now Roundcube's form login should look like this:
-----------------------------------------------
Image for Reference:
--------------------------------------------------------------------------------------------------------------------
Works great with CWP v0.9.8.753+ (CentOS 7)
---------------------------------------------------------------------