RoundCube server side mail filtering on ISPconfig 3.1.1 and CentOS 7.2 with managesieve plugin

I had dozen of Debian servers powered by ISPconfig and RoundCube webmail for years. Last year I decided to shut them all down due to lack of time and decided to just run my own server strictly for private use. This time I picked on CentOS, but basically everything is the same like in Debian except that few config locations differ and there is yum replacing apt. Anyway I was surprised that no one mentioned how to filter emails on server side since I was used to have this nice option in Gmail.

To setup OS and other apps I followed this great perfect server guide from howtoforge.com. If you will ever use their product ISPconfig, tutorials or forums for help, be kind and support them.

Here are steps to enable server side filtering:

Open dovecot.conf:

# nano /etc/dovecot/dovecot.conf

Make sure that protocols line has “sieve” in it:

protocols = imap pop3 sieve

and plugin should look like this:

plugin {
quota = dict:user::file:/var/vmail/%d/%n/.quotausage
sieve=/var/vmail/%d/%n/.sieve
sieve_dir = /var/vmail/%d/%n/sieve/
sieve_before = /var/vmail/%d/%n/sieve/ispconfig.sieve
sieve_extensions = +notify +imapflags
}

 

Save the file and reload dovecot:

# systemctl restart dovecot.service

Check that sieve is running:

# netstat -a –numeric-ports | grep 4190

It should display something like:

tcp 0 0 0.0.0.0:4190 0.0.0.0:* LISTEN
tcp6 0 0 [::]:4190 [::]:* LISTEN

Now edit roundcube config file config.inc.php:

# nano /etc/roundcubemail/config.inc.php

Find $config[‘plugins’] and add managesieve and jqueryui to enable sieve filter plugin so it should look like this if , notice that there be more plugins enabled like password, zipdownload, etc… :

$config[‘plugins’] = array(‘managesieve’, ‘jqueryui’, ‘password’, ‘zipdownload’);

That’s it, go to your webmail and check if under settings exists filters tab like on this picture:

Roundcube server side filtering

Now you just have to create your filters. Happy emailing 🙂