Working with Roundcube

Updated 12 May 2021

Introduction

This manual contains information on how to work with Roundcube and how to install and configure plugins. To install Roundcube, please refer to the following manual.

Plugins

Context Menu

A context menu is an element of an operating system GUI, which is a list of commands called by user in order to select the desired action to perform on the selected object.

Download and extract the ContextMenu plugin:

su - -s /bin/bash roundcube

cd ~/roundcubemail-latest/plugins

VERSION=$(curl -s https://api.github.com/repos/johndoh/roundcube-contextmenu/releases/latest | grep tag_name | cut -d '"' -f 4) && echo "Latest ContextMenu version is $VERSION"

wget "https://github.com/johndoh/roundcube-contextmenu/archive/refs/tags/${VERSION}.tar.gz"

mkdir contextmenu

tar -C contextmenu --strip-components=1 -xf ${VERSION}.tar.gz

Enable the plugin in RoundCube by adding the following lines:

/var/calculate/www/roundcube/config/config.inc.php

$config['plugins'] = array('contextmenu')

CardDAV

CardDAV is a client/server protocol for the address book, providing user access to shared data on the server. For example, you can get your contact list from [Nextcloud] (nextcloud) with CardDAV.

Download and unpack CardDAV:

su - -s /bin/bash roundcube

cd ~/roundcubemail-latest/plugins

VERSION=$(curl -s https://api.github.com/repos/mstilkerich/rcmcarddav/releases/latest | grep tag_name | cut -d '"' -f 4) && echo "Latest CardDAV version is $VERSION"

wget "https://github.com/mstilkerich/rcmcarddav/releases/download/${VERSION}/carddav-${VERSION}.tar.gz"

tar xf carddav-v4.1.1.tar.gz

rm carddav-v4.1.1.tar.gz

Configure CardAV:

cp carddav/config.inc.php.dist carddav/config.inc.php

/var/calculate/www/roundcube/roundcubemail-latest/plugins/carddav/config.inc.php

$prefs['_GLOBAL']['hide_preferences'] = false;
$prefs['_GLOBAL']['pwstore_scheme'] = 'encrypted';
$prefs['_GLOBAL']['suppress_version_warning'] = false;

Enable the new plug-in in the general configuration file:

/var/calculate/www/roundcube/roundcubemail-latest/config/config.inc.php

$config['plugins'] = array('carddav');

Increase the memory limit in php settings:

/etc/php/fpm-php7.4/php.ini

memory_limit = 256M

Reset active sessions to apply the CardDAV migration:

psql -U roundcube -d roundcubemail -c "delete from session"

Go to the site: Settings → Settings → CardDAV:

CardDAV in Roundcube

Sieve

Sieve is a language for describing filtering rules for email messages.

Dovecot configuration

Add the following to the Dovecot configuration:

/etc/dovecot/conf.d/20-lmtp.conf

protocol lmtp {
 mail_plugins = $mail_plugins sieve
}

/etc/dovecot/conf.d/20-managesieve.conf

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

/etc/dovecot/conf.d/90-sieve.conf

plugin {
 sieve = file:/var/calculate/server-data/mail/%n/sieve/sieve;active=/var/calculate/server-data/mail/%n/sieve/.dovecot.sieve 
}

Postfix configuration

Edit the Postfix settings:

/etc/postfix/main.cf

mailbox_command = /usr/libexec/dovecot/dovecot-lda

Roundcube configuration

Enable the plugin in RoundCube by adding the following lines:

/var/calculate/www/roundcube/config/config.inc.php

$config['managesieve_host'] = 'mail.example.org';
$config['plugins'] = array('managesieve')