Dovecot brute-force blocking with fail2ban

If you are getting any brute force attacks to your dovecot imap/pop3 server, install fail2ban to block the offenders. This works on CentOs 5.7. For other distributions, see the relevant websites. Firstly, install fail2ban. You should have the rpmforge repo from my previous post. Enable it first to install fail2ban: # cd /etc/yum.repos.d/ # vi […]

dmraid error reporting by email

dmraid is a software raid/fakeraid/onboard raid tool. As far as I can tell, the only error reporting that dmraid does is by hooking into logwatch – which emails me a very long file I don’t often read and I would like to know immediately if my raid array is degraded. This works for me on […]

PHP Recursive File Copy Function

I couldn’t find a function online that copies folders recursively in PHP and actually works, so I wrote my own: function recursiveCopy($src, $dest) { if (is_dir($src)) $dir = opendir($src); while ($file = readdir($dir)) { if ($file != ‘.’ && $file != ‘..’) { if (!is_dir($src.’/’.$file)) copy($src.’/’.$file, $dest.’/’.$file); else { @mkdir($dest.’/’.$file, 0750); recursiveCopy($src.’/’.$file, $dest.’/’.$file); } //else […]

Roundcube: Vacation message with Virtualmin Plugin

None of the vacation/forwarding plugins work with Virtualmin so this is my workaround. Firstly, users need to be created as Mail and FTP users, since we will be using FTP to place the .forward files. Download and unzip the plugin: wget http://downloads.sourceforge.net/project/rcubevacation/vacation-1.9.9.zip?use_mirror=ovh&ts=1280145947 unzip vacation-1.9.9.zip cd vacation vi config.ini We are going to use Usermin’s own […]

Roundcube: Change Virtualmin Password Plugin

I can never get the Virtualmin binary file compilation to work properly, so here’s my workaround to enable changing a user’s Virtualmin password in Roundcube Webmail. Firstly, let’s go to the plugins/password directory (your path will be different): cd ~username/public_html/webmail/plugins/password cp config.inc.php.dist config.inc.php vi config.inc.php We need to change the password driver to virtualmin (hit […]