2021-10-19 19:14:10 +02:00
## Installing Roundcube
2021-08-20 08:38:51 +02:00
Download Roundcube 1.5.x to the web htdocs directory and extract it (here `rc/` ):
2017-05-06 00:22:26 +02:00
```
2020-02-03 11:52:58 +01:00
# Check for a newer release!
2017-11-24 01:51:18 +01:00
cd data/web
2021-11-28 20:24:29 +01:00
wget -O - https://github.com/roundcube/roundcubemail/releases/download/1.5.1/roundcubemail-1.5.1-complete.tar.gz | tar xfvz -
2017-05-06 00:22:26 +02:00
# Change folder name
2021-11-28 20:24:29 +01:00
mv roundcubemail-1.5.1 rc
2021-10-19 19:14:10 +02:00
2017-05-06 00:22:26 +02:00
# Change permissions
chown -R root: rc/
```
2021-10-03 17:30:35 +02:00
If you need spell check features, create a file `data/hooks/phpfpm/aspell.sh` with the following content, then `chmod +x data/hooks/phpfpm/aspell.sh` . This installs a local spell check engine. Note, most modern web browsers have built in spell check, so you may not want/need this.
2021-09-06 15:27:17 +02:00
```
#!/bin/bash
apk update
2021-09-09 13:40:46 +02:00
apk add aspell-en # or any other language
2021-09-06 15:27:17 +02:00
```
2017-05-06 00:22:26 +02:00
Create a file `data/web/rc/config/config.inc.php` with the following content.
2021-10-03 17:30:35 +02:00
- **Change the `des_key` parameter to a random value.** It is used to temporarily store your IMAP password.
- The `db_prefix` is optional but recommended.
- If you didn't install spell check in the above step, remove `spellcheck_engine` parameter and replace it with `$config['enable_spellcheck'] = false;` .
2017-05-06 00:22:26 +02:00
```
< ?php
error_reporting(0);
if (!file_exists('/tmp/mime.types')) {
2019-01-10 07:51:45 +01:00
file_put_contents("/tmp/mime.types", fopen("http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types", 'r'));
2017-05-06 00:22:26 +02:00
}
$config = array();
2019-01-10 07:51:45 +01:00
$config['db_dsnw'] = 'mysql://' . getenv('DBUSER') . ':' . getenv('DBPASS') . '@mysql/' . getenv('DBNAME');
2017-05-06 00:22:26 +02:00
$config['default_host'] = 'tls://dovecot';
$config['default_port'] = '143';
$config['smtp_server'] = 'tls://postfix';
$config['smtp_port'] = 587;
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['support_url'] = '';
$config['product_name'] = 'Roundcube Webmail';
2019-01-09 08:50:53 +01:00
$config['des_key'] = 'yourrandomstring_changeme';
2017-05-06 00:22:26 +02:00
$config['log_dir'] = '/dev/null';
$config['temp_dir'] = '/tmp';
$config['plugins'] = array(
2019-01-09 08:50:53 +01:00
'archive',
'managesieve'
2017-05-06 00:22:26 +02:00
);
2021-09-30 06:23:46 +02:00
$config['spellcheck_engine'] = 'aspell';
2017-05-06 00:22:26 +02:00
$config['mime_types'] = '/tmp/mime.types';
$config['imap_conn_options'] = array(
2019-01-09 08:50:53 +01:00
'ssl' => array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true)
2017-05-06 00:22:26 +02:00
);
2017-11-01 18:01:47 +01:00
$config['enable_installer'] = true;
2017-05-06 00:22:26 +02:00
$config['smtp_conn_options'] = array(
2019-01-09 08:50:53 +01:00
'ssl' => array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true)
);
2020-07-02 17:49:24 +02:00
$config['db_prefix'] = 'mailcow_rc1';
```
Point your browser to `https://myserver/rc/installer` and follow the instructions.
Initialize the database and leave the installer.
**Delete the directory `data/web/rc/installer` after a successful installation!**
### Configure ManageSieve filtering
2019-01-09 08:50:53 +01:00
2020-07-02 17:49:24 +02:00
Open `data/web/rc/plugins/managesieve/config.inc.php` and change the following parameters (or add them at the bottom of that file):
```
2021-11-19 23:13:10 +01:00
//Make sure you have < ?php at the beginning of the file or add just like below
< ?php
2019-01-09 08:50:53 +01:00
$config['managesieve_port'] = 4190;
$config['managesieve_host'] = 'tls://dovecot';
$config['managesieve_conn_options'] = array(
'ssl' => array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true)
2017-05-06 00:22:26 +02:00
);
2019-01-09 08:50:53 +01:00
// Enables separate management interface for vacation responses (out-of-office)
// 0 - no separate section (default),
// 1 - add Vacation section,
// 2 - add Vacation section, but hide Filters section
$config['managesieve_vacation'] = 1;
2017-05-06 00:22:26 +02:00
```
### Enable change password function in Roundcube
Open `data/web/rc/config/config.inc.php` and enable the password plugin:
```
...
$config['plugins'] = array(
'archive',
'password',
);
...
```
Open `data/web/rc/plugins/password/password.php` , search for `case 'ssha':` and add above:
```
case 'ssha256':
$salt = rcube_utils::random_bytes(8);
$crypted = base64_encode( hash('sha256', $password . $salt, TRUE ) . $salt );
$prefix = '{SSHA256}';
break;
```
Open `data/web/rc/plugins/password/config.inc.php` and change the following parameters (or add them at the bottom of that file):
```
$config['password_driver'] = 'sql';
$config['password_algorithm'] = 'ssha256';
$config['password_algorithm_prefix'] = '{SSHA256}';
$config['password_query'] = "UPDATE mailbox SET password = %P WHERE username = %u";
```
2017-06-11 02:31:01 +02:00
2018-10-03 22:54:41 +02:00
### Integrate CardDAV addressbooks in Roundcube
2021-08-26 17:38:14 +02:00
Download the latest release of [RCMCardDAV ](https://github.com/mstilkerich/rcmcarddav ) to the Roundcube plugin directory and extract it (here `rc/plugins` ):
2018-10-03 22:54:41 +02:00
```
cd data/web/rc/plugins
2021-08-26 08:56:39 +02:00
wget -O - https://github.com/mstilkerich/rcmcarddav/releases/download/v4.1.2/carddav-v4.1.2.tar.gz | tar xfvz -
2018-10-06 22:56:10 +02:00
chown -R root: carddav/
2018-10-03 22:54:41 +02:00
```
Copy the file `config.inc.php.dist` to `config.inc.php` (here in `rc/plugins/carddav` ) and append the following preset to the end of the file - don't forget to replace `mx.example.org` with your own hostname:
```
$prefs['SOGo'] = array(
'name' => 'SOGo',
'username' => '%u',
'password' => '%p',
'url' => 'https://mx.example.org/SOGo/dav/%u/',
'carddav_name_only' => true,
'use_categories' => true,
'active' => true,
'readonly' => false,
'refresh_time' => '02:00:00',
'fixed' => array( 'active', 'name', 'username', 'password', 'refresh_time' ),
'hide' => false,
);
```
2018-10-06 22:56:10 +02:00
Please note, that this preset only integrates the default addressbook (the one that's named "Personal Address Book" and can't be deleted). Additional addressbooks are currently not automatically detected but can be manually added within the roundecube settings.
2018-10-03 22:54:41 +02:00
2019-11-21 14:11:28 +01:00
Enable the plugin by adding `carddav` to `$config['plugins']` in `rc/config/config.inc.php` .
2018-10-03 22:54:41 +02:00
2020-04-21 23:34:34 +02:00
If you want to remove the default addressbooks (stored in the Roundcube database), so that only the CardDAV addressbooks are accessible, append `$config['address_book_type'] = '';` to the config file `data/web/rc/config/config.inc.php` .
2018-10-03 22:54:41 +02:00
2017-06-12 12:43:44 +02:00
---
2017-06-11 06:40:03 +02:00
Optionally, you can add Roundcube's link to the mailcow Apps list.
2017-06-11 02:31:01 +02:00
To do this, open or create `data/web/inc/vars.local.inc.php` and add the following code-block:
2017-06-11 06:40:35 +02:00
*NOTE: Don't forget to add the `<?php` delimiter on the first line*
2017-06-11 02:31:01 +02:00
````
...
$MAILCOW_APPS = array(
array(
'name' => 'SOGo',
'link' => '/SOGo/'
),
array(
2017-06-12 12:46:45 +02:00
'name' => 'Roundcube',
2017-06-13 14:58:24 +02:00
'link' => '/rc/'
2017-06-11 02:31:01 +02:00
)
);
...
````
2021-10-19 19:14:10 +02:00
## Upgrading Roundcube
Upgrading Roundcube is rather simple, go to the [Github releases ](https://github.com/roundcube/roundcubemail/releases ) page for Roundcube and get the link for the "complete.tar.gz" file for the wanted release. Then follow the below commands and change the URL and Roundcube folder name if needed.
```
# Enter a bash session of the mailcow PHP container
docker exec -it mailcowdockerized_php-fpm-mailcow_1 bash
# Install required upgrade dependency, then upgrade Roundcube to wanted release
apk add rsync
cd /tmp
2021-11-28 20:24:29 +01:00
wget -O - https://github.com/roundcube/roundcubemail/releases/download/1.5.1/roundcubemail-1.5.1-complete.tar.gz | tar xfvz -
cd roundcubemail-1.5.1
2021-10-19 19:14:10 +02:00
bin/installto.sh /web/rc
# Type 'Y' and press enter to upgrade your install of Roundcube
# Remove leftover files
cd /tmp
rm -rf roundcube*
```