Sieve Plugin for Roundcube

2014-01-31    Filed under linux, Tags server email

Roundcube allows the management of email filter rules through the managesieve plugin. This plugin connects with the dovecot-sieve server and update user filters using a standard protocol. This way the user doesn't have to edit the ~/.dovecot.sieve files directly in its home directory, avoiding possible syntax mistakes.

Filters can be managed throug Roundcube -> Configuration -> Server config -> Filters.

With my setup (Nginx, php5-fpm and Dovecot) these are the necessary steps to configure it.

Activate managesieve server

Install managesieve:

sudo apt-get install dovecot-managesieved

Edit file /etc/dovecot/conf.d/20-managesieve.conf:

service managesieve-login {
  inet_listener sieve {
    port = 4190
  }
}
service managesieve {
}
protocol sieve {
}

Edit file /etc/dovecot/dovecot.conf and activate protocol sieve:

plugin {
    sieve = ~/.dovecot.sieve
    sieve_dir = ~/sieve
}
protocols = imap sieve

Reload php-fpm application server (if using this method to serve php):

sudo service php5-fpm reload

Check that the managesieve server is really running and listening at port 4190:

sudo netstat -tnlp | grep dovecot

Configure managesieve plugin at Roundcube

Edit /etc/roundcube/main.inc.php:

// List of active plugins (in plugins/ directory)
$rcmail_config['plugins'] = array('jqueryui', 'managesieve');

Copy contents of file /usr/share/roundcube/plugins/managesieve/config.inc.php.dist``to ``/etc/roundcube/plugins/managesieve/config.inc.php and edit it:

$rcmail_config['managesieve_port'] = 4190;
$rcmail_config['managesieve_host'] = 'localhost';

References: