I recently had a client who moved RoundCube to a new server. Since the move they are receiving the below error when they go to their webmail site.
SERVICE CURRENTLY NOT AVAILABLE!
Error No. 
After much digging and searching, I wasn’t coming up with much. I finely started walking threw the config file seeing what was enabled and were the different config options were pointing. After some digging I found they had memcache configured for session data. The php-pecl-memcache module wasn’t installed. I installed the module via yum, as it was a Fedora system using the below command.
yum install php-pecl-memcache
Since the config was still pointing at the running memcache server, the site came back up and is now working well again.
In order for Fail2Ban to be able to ban IP addresses from computers trying to break into RoundCube. RoundCube needs to write the IP address of the offending system in it’s logs. To accomplish this, run the following patch from the root of your RoundCube directory, or modify the program/lib/imap.inc file directly.
--- program/lib/imap.inc (revision 2446)
+++ program/lib/imap.inc (working copy)
@@ -428,7 +428,7 @@
if ($result == -3) fclose($conn-&amp;gt;fp); // BYE response
- $conn-&amp;gt;error .= 'Authentication for ' . $user . ' failed (AUTH): &amp;quot;';
+ $conn-&amp;gt;error .= 'Authentication for ' . $user . ' (' . getenv(&amp;quot;REMOTE_ADDR&amp;quot;) . ') failed (AUTH): &amp;quot;';
$conn-&amp;gt;error .= htmlspecialchars($line) . '&amp;quot;';
$conn-&amp;gt;errorNum = $result;
Once you have RoundCube patched, you may use the below config and filter in Fail2Ban to block the IP address from RoundCube’s logs.
enabled = true
port = http,https
filter = roundcube
action = iptables-multiport[name=roundcube, port=&amp;quot;http,https&amp;quot;]
logpath = /var/logs/httpd/errors
failregex = IMAP Error: Authentication for .* (&amp;lt;HOST&amp;amp;lg;) failed ((?:LOGIN|AUTH)):