Roundcube: Difference between revisions

From Edgar BV Wiki
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Installation =
= Installation in Debian =
Roundcube came back!
 
It installs settings into /etc/roundcube and the rest into /usr/share/roundcube<syntaxhighlight lang="bash">
apt-get install roundcube roundcube-skin-classic roundcube-skin-larry roundcube-mysql roundcube-plugins roundcube-plugins-extra
</syntaxhighlight>NB ensure that /etc/roundcube/<syntaxhighlight lang="bash">
config.inc.php
debian-db.php
</syntaxhighlight>are readable by www-data
 
In /etc/roundcube/config.inc.php<syntaxhighlight lang="bash">
$config['product_name'] = 'Edgar BV Webmail';
</syntaxhighlight>Then<syntaxhighlight lang="bash">
mkdir /usr/share/roundcube/logs/
mkdir /usr/share/roundcube/temp/
 
chgrp www-data /usr/share/roundcube/logs/
chgrp www-data /usr/share/roundcube/temp/
 
chmod 775 /usr/share/roundcube/logs/
chmod 775 /usr/share/roundcube/temp/
</syntaxhighlight>Add the following to /etc/roundcube/config.inc.php<syntaxhighlight lang="bash">
$config['log_dir'] = '/usr/share/roundcube/logs/';
$config['temp_dir'] = '/usr/share/roundcube/temp/';
$config['temp_dir_ttl'] = '48h';
</syntaxhighlight>
 
=== Updating the DB schema ===
/usr/share/roundcube/bin/update.sh
 
=== Logrotation ===
/etc/logrotate.d/roundcube<syntaxhighlight lang="bash">
/usr/share/roundcube/logs/errors.log {
    weekly
    rotate 8
    compress
    notifempty
    create 0640 www-data www-data
}
</syntaxhighlight>
 
=== Getting Plugins to work ===
Download latest tar.gz version from roundcube and copy composer.json-dist to /usr/share/roundcube/composer.json
 
from https://packagist.org/
 
<code>curl -sS <nowiki>https://getcomposer.org/installer</nowiki> | php</code>
 
Or download composer.phar into your project root (/usr/share/roundcube)
 
in /usr/share/roundcube/ run<syntaxhighlight lang="bash">
php composer.phar update
</syntaxhighlight>This will also install some new plugins.
 
After this, installing plugins will work using composer but give an Underfined array key "log_dir" error. You can find them in the plugins directory and enable them.
 
Plugins can be installed in /etc/roundcube/plugins, usr/share/plugins (which they will be using this composer method) and are linked to (and searched for) in the /var/lib/roundcube/plugins directory, so they have to be there too. You can find the errors loading in /usr/share/roundcube/logs/error.log<syntaxhighlight lang="bash">
composer require texxasrulez/advanced_search
ln -s /usr/share/roundcube/plugins/advanced_search /var/lib/roundcube/plugins/advanced_search
composer require shirosaki/sendcharset
ln -s /usr/share/roundcube/plugins/sendcharset /var/lib/roundcube/plugins/sendcharset
composer require texxasrulez/plugin_manager
ln -s /usr/share/roundcube/plugins/plugin_manager /var/lib/roundcube/plugins/plugin_manager
composer require texxasrulez/persistent_login
ln -s /usr/share/roundcube/plugins/persistent_login /var/lib/roundcube/plugins/persistent_login
</syntaxhighlight>NB for Persistentlogin and lastlogin you need to run some SQL in the directories. For persistentlogin you need to set the use of auth tokens to true and mv config.inc.php.dist to config.inc.php in the plugin directory. For advanced_search you need to rename the  config.inc.php.dist
 
== Installation by hand ==
Download the files and unzip to /usr/share/roundcube
Download the files and unzip to /usr/share/roundcube


Line 34: Line 101:
</pre>
</pre>


== Installation obsolete ==
== Installation obsolete / Squeeze ==
There is no jessie roundcube :(
There is no jessie roundcube :(


Line 110: Line 177:


NB dragndrop_attachments.js has a hardcoded max message size in it!
NB dragndrop_attachments.js has a hardcoded max message size in it!
== Automatic Addressbook ==
https://github.com/HostOncilla/roundcube-automatic_addressbook# / https://packagist.org/packages/projectmyst/automatic_addressbook
Composer does not work
so you have to
git clone <nowiki>https://github.com/HostOncilla/roundcube-automatic_addressbook.git</nowiki>
ln -s /usr/share/roundcube/plugins/automatic_addressbook /var/lib/roundcube/plugins/automatic_addressbook
then run the SQL
then rename config.inc.php.dist to confiig.inc.php


== Google Contacts ==
== Google Contacts ==
Line 139: Line 221:
== Automatic Addressbook ==
== Automatic Addressbook ==
Automatically adds people you send a mail to to an address book. Get it [http://code.crapouillou.net/projects/roundcube-plugins here]
Automatically adds people you send a mail to to an address book. Get it [http://code.crapouillou.net/projects/roundcube-plugins here]
= Broken Plugins =
These plugins I could not get to work
composer require jfcherng-roundcube/quota
ln -s /usr/share/roundcube/plugins/quota /var/lib/roundcube/plugins/quota
keyboard shortcuts


== Vacation autoresponder ==
== Vacation autoresponder ==
Line 146: Line 237:
You can search it up on https://plugins.roundcube.net/#/
You can search it up on https://plugins.roundcube.net/#/


Installation instructions can be found on https://github.com/bukowski12/roundcube-vacation-plugin/blob/master/INSTALL.md
Installation instructions can be found on https://github.com/bukowski12/roundcube-vacation-plugin/blob/master/INSTALL.md<syntaxhighlight lang="bash">
apt install php-ssh2
systemctl restart apache2
cd /usr/share/roundcube/plugins/
git clone https://github.com/bukowski12/roundcube-vacation-plugin.git
mv roundcube-vacation-plugin/ vacation/
ln -s /usr/share/roundcube/plugins/vacation /var/lib/roundcube/plugins/vacation
</syntaxhighlight>It is set up by default to create .forward files in the user home directory using sftp / ssh.
 
It does throw  PHP Deprecated:  Creation of dynamic property SSHFTP::$identity is deprecated in /usr/share/roundcube/plugins/vacation/lib/vacationdriver.class.php on line 27 errors.
 
== LastLogin ==
https://packagist.org/packages/dsoares/lastlogin
 
== Hotkeys ==
https://packagist.org/packages/random-cuber/hotkeys
 
After instructions
 
ln -s /usr/share/roundcube/plugins/hotkeys /var/lib/roundcube/plugins/hotkeys
 
== Control SpamAssassin settings from within Roundcube ==
https://packagist.org/packages/johndoh/sauserprefs


=== Obsolete ===
=== Obsolete ===

Latest revision as of 13:50, 15 September 2025

Installation in Debian

Roundcube came back!

It installs settings into /etc/roundcube and the rest into /usr/share/roundcube

apt-get install roundcube roundcube-skin-classic roundcube-skin-larry roundcube-mysql roundcube-plugins roundcube-plugins-extra

NB ensure that /etc/roundcube/

config.inc.php
debian-db.php

are readable by www-data In /etc/roundcube/config.inc.php

$config['product_name'] = 'Edgar BV Webmail';

Then

mkdir /usr/share/roundcube/logs/
mkdir /usr/share/roundcube/temp/

chgrp www-data /usr/share/roundcube/logs/
chgrp www-data /usr/share/roundcube/temp/

chmod 775 /usr/share/roundcube/logs/
chmod 775 /usr/share/roundcube/temp/

Add the following to /etc/roundcube/config.inc.php

$config['log_dir'] = '/usr/share/roundcube/logs/';
$config['temp_dir'] = '/usr/share/roundcube/temp/';
$config['temp_dir_ttl'] = '48h';

Updating the DB schema

/usr/share/roundcube/bin/update.sh

Logrotation

/etc/logrotate.d/roundcube

/usr/share/roundcube/logs/errors.log {
    weekly
    rotate 8
    compress
    notifempty
    create 0640 www-data www-data
}

Getting Plugins to work

Download latest tar.gz version from roundcube and copy composer.json-dist to /usr/share/roundcube/composer.json

from https://packagist.org/

curl -sS https://getcomposer.org/installer | php

Or download composer.phar into your project root (/usr/share/roundcube)

in /usr/share/roundcube/ run

php composer.phar update

This will also install some new plugins.

After this, installing plugins will work using composer but give an Underfined array key "log_dir" error. You can find them in the plugins directory and enable them.

Plugins can be installed in /etc/roundcube/plugins, usr/share/plugins (which they will be using this composer method) and are linked to (and searched for) in the /var/lib/roundcube/plugins directory, so they have to be there too. You can find the errors loading in /usr/share/roundcube/logs/error.log

composer require texxasrulez/advanced_search
ln -s /usr/share/roundcube/plugins/advanced_search /var/lib/roundcube/plugins/advanced_search
composer require shirosaki/sendcharset
 ln -s /usr/share/roundcube/plugins/sendcharset /var/lib/roundcube/plugins/sendcharset
composer require texxasrulez/plugin_manager
ln -s /usr/share/roundcube/plugins/plugin_manager /var/lib/roundcube/plugins/plugin_manager
composer require texxasrulez/persistent_login
ln -s /usr/share/roundcube/plugins/persistent_login /var/lib/roundcube/plugins/persistent_login

NB for Persistentlogin and lastlogin you need to run some SQL in the directories. For persistentlogin you need to set the use of auth tokens to true and mv config.inc.php.dist to config.inc.php in the plugin directory. For advanced_search you need to rename the config.inc.php.dist

Installation by hand

Download the files and unzip to /usr/share/roundcube

Chown www-data:www-data the temp and logs directories

link from /var/lib/roundcube to /usr/share/roundcube

ln -s /var/log/roundcube /usr/share/roundcube/logs
ln -s /etc/roundcube/ /var/lib/config
ln -s /usr/share/roundcube/robots.txt /var/lib/roundcube/robots.txt
ln -s /etc/roundcube/htaccess /var/lib/roundcube/.htaccess
ln -s /usr/share/roundcube/program /var/lib/roundcube/program

edit a conffile in /etc/apache2/conf-enabled

Alias /roundcube /usr/share/roundcube
<Directory /var/lib/roundcube/>
  Options +FollowSymLinks
  # This is needed to parse /var/lib/roundcube/.htaccess. See its
  # content before setting AllowOverride to None.
  AllowOverride All
  order allow,deny
  allow from all
</Directory>

run the installer

change the following in /etc/roundcube/config.inc.php

$config['default_host'] = 'localhost';
$config['product_name'] = 'Edgar BV Webmail';

Installation obsolete / Squeeze

There is no jessie roundcube :(

We're going to get the backport version as it's much much better

so in /etc/apt/sources.list add

deb http://backports.debian.org/debian-backports squeeze-backports main

and to install

apt-get -t squeeze-backports install roundcube roundcube-mysql roundcube-plugins roundcube-plugins-extra

You will need mysql-server, apache2 and php5 as well.

then in /etc/roundcube/apache.conf

uncomment:
    Alias /roundcube/program/js/tiny_mce/ /usr/share/tinymce/www/
    Alias /roundcube /var/lib/roundcube

in /etc/roundcube/main.inc.php change

$rcmail_config['htmleditor'] = 0; to 1
$rcmail_config['preview_pane'] = 0; to 1
$rcmail_config['default_host'] = '127.0.0.1';
$rcmail_config['language'] = 'nl_NL';

Settings that need looking at and haven't been enabled yet!

$rcmail_config['smtp_server'] = 'localhost';
$rcmail_config['smtp_user'] = '%u';
$rcmail_config['smtp_pass'] = '%p';

in /usr/local/etc/php.ini

upload_max_filesize = 5M

Plugins

virtuser_file

This comes with the roundcube-plugins package and makes roundcube read the identities (@domain.ext) from a file in the format:

email@domain.ext user

email2@domain2.ext user2


If a user has multiple @domain.ext set in the file, then it makes multiple entries you can choose from as your from address.

Find in /etc/roundcube/config.inc.php

$rcmail_config['plugins'] = array('virtuser_file');

To enable it. and then all the way at the bottom set

$rcmail_config['virtuser_file'] = '/etc/postfix/virtual';

NB: This only reads the identities the first time a user logs in!

DragnDrop Attachments

You can find that here

download, then unzip and mv to /var/lib/roundcube/plugins/dragndrop_attachments/

In main.inc.php

$rcmail_config['plugins'] = array('virtuser_file','vcard_attachments','show_additional_headers','emoticons','jqueryui','dragndrop_attachments', 'vacation');

NB dragndrop_attachments.js has a hardcoded max message size in it!

Automatic Addressbook

https://github.com/HostOncilla/roundcube-automatic_addressbook# / https://packagist.org/packages/projectmyst/automatic_addressbook

Composer does not work

so you have to

git clone https://github.com/HostOncilla/roundcube-automatic_addressbook.git

ln -s /usr/share/roundcube/plugins/automatic_addressbook /var/lib/roundcube/plugins/automatic_addressbook

then run the SQL

then rename config.inc.php.dist to confiig.inc.php

Google Contacts

Syncs your Google account with the adress book. Find it here

Download, then unzip and mv to /var/lib/roundcube/plugins/google_contacts/

Add the SQL in the file, move the config/config.inc.php.dist to config.inc.php (might want to change $rcmail_config['google_contacts_max_results'] = 1000; to a higher number)

Download the Zend GData API's. In that file there is a subdirectory somewhere called Zend, which you copy to /var/lib/roundcube/program/lib/Zend/

In main.inc.php

$rcmail_config['plugins'] = array('virtuser_file','vcard_attachments','show_additional_headers','emoticons','jqueryui','dragndrop_attachments', 'vacation','google_contacts');

If you get a bad authentication error, you need to ensure that in Personal Settings -> Address Book the account has been filled in with everything after the @ as well. If you still get the error, gmail may have sent you a message saying that you need to authenticate the new device. There should be a link to allow this in that mail.

This also creates a log in /var/log/roundcube/google_contacts

If /var/log/roundcube/errors starts giving memory exhausted errors you need to edit the memory_limit in /var/lib/roundcube/.htaccess

404 error with photo's can be solved by commenting out everything before 'start photo' and 'end photo'. This is because roundcube 7.2 (debian wheezy) doesn't support photo's.

404 error with photos

May have to look at 503 error

Automatic Addressbook

Automatically adds people you send a mail to to an address book. Get it here

Broken Plugins

These plugins I could not get to work

composer require jfcherng-roundcube/quota

ln -s /usr/share/roundcube/plugins/quota /var/lib/roundcube/plugins/quota

keyboard shortcuts

Vacation autoresponder

The best version I can find now is https://github.com/bukowski12/roundcube-vacation-plugin

You can search it up on https://plugins.roundcube.net/#/

Installation instructions can be found on https://github.com/bukowski12/roundcube-vacation-plugin/blob/master/INSTALL.md

apt install php-ssh2
systemctl restart apache2
cd /usr/share/roundcube/plugins/
git clone https://github.com/bukowski12/roundcube-vacation-plugin.git
mv roundcube-vacation-plugin/ vacation/
ln -s /usr/share/roundcube/plugins/vacation /var/lib/roundcube/plugins/vacation

It is set up by default to create .forward files in the user home directory using sftp / ssh.

It does throw PHP Deprecated:  Creation of dynamic property SSHFTP::$identity is deprecated in /usr/share/roundcube/plugins/vacation/lib/vacationdriver.class.php on line 27 errors.

LastLogin

https://packagist.org/packages/dsoares/lastlogin

Hotkeys

https://packagist.org/packages/random-cuber/hotkeys

After instructions

ln -s /usr/share/roundcube/plugins/hotkeys /var/lib/roundcube/plugins/hotkeys

Control SpamAssassin settings from within Roundcube

https://packagist.org/packages/johndoh/sauserprefs

Obsolete

This package is not compatible with the elastic skin. It does create some real problems though because it creates an aliases column in the user table which is not nullable. This means that new users can't log in without this plugin installed as it throws errors like:

[17-Sep-2024 06:53:25 +0000]: <as95v65i>  DB Error: [1364] Field 'alias' doesn't have a default value (SQL Query: INSERT INTO `users` (`created`, `last_login`, `username`, `mail_host`, `language`, `preferences`) VALUES (now(), now(), 'username', 'localhost', 'en_GB', 'a:0:{}')) in /usr/share/roundcube/program/lib/Roundcube/rcube_db.php on line 578 (POST /roundcube/?_task=login&_action=login)
[17-Sep-2024 06:53:25 +0000]: <as95v65i> PHP Error: Failed to create new user in /usr/share/roundcube/program/lib/Roundcube/rcube_user.php on line 726 (POST /roundcube/?_task=login&_action=login)
[17-Sep-2024 06:53:25 +0000]: <as95v65i> PHP Error: Failed to create a user record. Maybe aborted by a plugin? in /usr/share/roundcube/program/include/rcmail.php on line 813 (POST /roundcube/?_task=login&_action=login)

To fix this, you can either drop the column (not my preference) or

   alter table users modify alias varchar(128);
MariaDB [roundcube]> describe users;
+----------------------+------------------+------+-----+---------------------+----------------+
| Field                | Type             | Null | Key | Default             | Extra          |
+----------------------+------------------+------+-----+---------------------+----------------+
| user_id              | int(10) unsigned | NO   | PRI | NULL                | auto_increment |
| username             | varchar(128)     | NO   | MUL | NULL                |                |
| mail_host            | varchar(128)     | NO   |     | NULL                |                |
| alias                | varchar(128)     | YES  | MUL | NULL                |                |

Download it from here

unzip it to /var/lib/roundcube/plugins/vacation/

The config.ini should look like this:

[default]
driver = "ftp"
subject = "Afwezig"
body = "default.txt"

[dotforward]
binary = "/usr/bin/vacation"
flags = ""
message = ".vacation.msg"
database = ".vacation.db"
alias_identities = true
set_envelop_sender = false
always_keep_message = true

in Roundcube 0.5 the page layout has changed and the plugin displays incorrectly. To fix this, edit

plugins/vacation/skins/default/vacation.css

and add in some padding:

#pagecontent {
width: 800px;
padding-top:70px;
}

Also edit plugins/vacation/default.txt

Note that it won't save the autoresponder message and subject if you don't tick the checkbox on the top of the page (which we've moved down a bit above)

Finally, add 'vacation' to the $rcmail_config['plugins'] in roundcube main.inc.php

You can find the auto reply in the settings

Changing max attachment filesize

Make sure the following settings are correct:

php

/etc/php5/apache2/php.ini:post_max_size = 100M
/etc/php5/apache2/php.ini:upload_max_filesize = 100M

postfix

/etc/postfix/main.cf:mailbox_size_limit = 0
/etc/postfix/main.cf:message_size_limit = 104857600

roundcube

/usr/share/roundcube/.htaccess:php_value    upload_max_filesize     100M
/usr/share/roundcube/.htaccess:php_value    post_max_size           100M
NB
maybe also /etc/roundcube/htaccess

drag 'n drop attachments

/var/lib/roundcube/plugins/dragndrop_attachments/dragndrop_attachments.js: if(total_size > 100000000
/var/lib/roundcube/plugins/dragndrop_attachments/localization/en_US.inc:$labels['files_to_upload_bigger_than_allowed'] = 'The size of the files exceeds the maximum allowed size (100 Mb)';
/var/lib/roundcube/plugins/dragndrop_attachments/localization/en_GB.inc:$labels['files_to_upload_bigger_than_allowed'] = 'The size of the files exceeds the maximum allowed size (100 Mb)';

Important when testing!

NB. when testing, you may need to delete the users from the roundcube mysql database to check if certain settings are being set before logging in (the identities and users table)

Also there is a

/var/log/roundcube/error.log

you can consult