Roundcube: Difference between revisions

From Edgar BV Wiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 141: Line 141:


== Vacation autoresponder ==
== 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
=== 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:
<pre>
[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)
</pre>
To fix this, you can either drop the column (not my preference) or
    alter table users modify alias varchar(128);
<pre>
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                |                |
</pre>
----
Download it from [http://sourceforge.net/projects/rcubevacation/files/ here]
Download it from [http://sourceforge.net/projects/rcubevacation/files/ here]



Latest revision as of 07:47, 17 September 2024

Installation

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

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!

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

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

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