Author Topic: Roundcube tricks & tips 3.5  (Read 11856 times)

StuartNaylor

  • Guest
Roundcube tricks & tips 3.5
« on: July 12, 2014, 01:24:39 am »
The Zentyal version of Roundcube is actually a bit dated (Roundcube Webmail 0.9.5) and this might cause problems with some plugins.

Basically roundcube is just a web imap client so its no big deal as we dont need the zentyal module as the standard install is very easy.

So here is a little tutorial based on Zentyal 3.5. Based on http://trac.roundcube.net/wiki/Howto_Install

In webmin Others>Upload&Download>Download from web.

Paste http://downloads.sourceforge.net/project/roundcubemail/roundcubemail/1.0.1/roundcubemail-1.0.1.tar.gz in "URLs to download"
Change the directory to /usr/share/ in "Download to file or directory"

In webmin Others>File Manager

Find /usr/share/roundcubemail-1.0.1.tar.gz select extract and delete.

We should now have a /usr/share/roundcube-1.0.1 folder.

In webmin Servers>MySQL Database Server.

If you are asked for a MySQL Login then the login is root and the password right click on filemanager and open in another tab copy and paste the password from /var/lib/zentyal/conf/zentyal-mysql.passwd

Create a database roundcube
Create a roundcube user for localhost with a password
Set the database permissions for roundube allow everything but grant permissions.

See attached images for user and database permissions.

Code: [Select]

Alias /webmail /usr/share/roundcubemail-1.0.1

<Directory /usr/share/roundcubemail-1.0.1>
Options +FollowSymLinks
# AddDefaultCharset     UTF-8
AddType text/x-component .htc

<IfModule mod_php5.c>
php_flag        display_errors  Off
php_flag        log_errors      On
# php_value     error_log       logs/errors
php_value       upload_max_filesize     10M
php_value       post_max_size           12M
php_value       memory_limit            64M
php_flag        zlib.output_compression         Off
php_flag        magic_quotes_gpc                Off
php_flag        magic_quotes_runtime            Off
php_flag        zend.ze1_compatibility_mode     Off
php_flag        suhosin.session.encrypt         Off
#php_value      session.cookie_path             /
php_flag        session.auto_start      Off
php_value       session.gc_maxlifetime  21600
php_value       session.gc_divisor      500
php_value       session.gc_probability  1
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^favicon\.ico$ skins/larry/images/favicon.ico
# security rules:
# - deny access to files not containing a dot or starting with a dot
#   in all locations except installer directory
RewriteRule ^(?!installer)(\.?[^\.]+)$ - [F]
# - deny access to some locations
RewriteRule ^/?(\.git|\.tx|SQL|bin|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F]
# - deny access to some documentation files
RewriteRule /?(README\.md|composer\.json-dist|composer\.json|package\.xml)$ - [F]
</IfModule>

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
</IfModule>

<IfModule mod_headers.c>
# replace 'append' with 'merge' for Apache version 2.2.9 and later
# Header append Cache-Control public env=!NO_CACHE
</IfModule>

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
</IfModule>

FileETag MTime Size

<IfModule mod_autoindex.c>
Options -Indexes
</ifModule>

AllowOverride None
Order allow,deny
Allow from all
</Directory>

<Directory /usr/share/roundcube-1.0.1/plugins/enigma/home>
Options -FollowSymLinks
AllowOverride None
Order allow,deny
Deny from all
</Directory>

<Directory /usr/share/roundcube-1.0.1/config>
Options -FollowSymLinks
AllowOverride None
Order allow,deny
Deny from all
</Directory>

<Directory /usr/share/roundcube-1.0.1/temp>
Options -FollowSymLinks
AllowOverride None
Order allow,deny
Deny from all
</Directory>

<Directory /usr/share/roundcube-1.0.1/logs>
Options -FollowSymLinks
AllowOverride None
Order allow,deny
Deny from all
</Directory>

Create /etc/apache2/conf-available/roundcube.conf and paste the above

Alias /webmail can be changed to what ever you require or so it doesn't conflict with the zentyal webmail

a2enconf roundcube.conf

restart the webserver

point your browser to my-server-ip/webmail/installer

Follow the steps in the installer. Check you can connect then delete the installer folder.

Ok we should have a working copy of the latest roundcube.

I am going to continue this and start adding some plugins.
Global ldap address book.
Global SQL shared contacts
and hopefully a calendar.

If anybody wants to check the above and give feedback it would be much appreciated.

I do like roundcube as a webinterface it is quite sexy.
« Last Edit: July 12, 2014, 02:41:00 am by StuartNaylor »

StuartNaylor

  • Guest
Re: Roundcube tricks & tips 3.5
« Reply #1 on: July 12, 2014, 03:24:49 am »
Global Address Book

Download from https://github.com/JohnDoh/Roundcube-Plugin-Global-Address-Book/releases

Version 1.8

Extract into the plugings directory rename the folder globaladdressbook. Change the permissions so www-data can access.

/usr/share/roundcubemail-1.0.1/config/config.inc.php change the line and include 'globaladdressbook'

$config['plugins'] = array('additional_message_headers','archive','zipdownload','globaladdressbook');

/usr/share/roundcubemail-1.0.1/plugins/globaladdressbook/README.md

Have a read either its readonly with admin users or readonly=false

Code: [Select]
Roundcube Webmail GlobalAddressbook
===================================
This plugin adds an SQL based global address book to Roundcube. It can be
global per installation, per IMAP host or per domain.

License
-------
This plugin is released under the [GNU General Public License Version 3+][gpl].

Even if skins might contain some programming work, they are not considered
as a linked part of the plugin and therefore skins DO NOT fall under the
provisions of the GPL license. See the README file located in the core skins
folder for details on the skin license.

Install
-------
* Place this plugin folder into plugins directory of Roundcube
* Add globaladdressbook to $config['plugins'] in your Roundcube config

**NB:** When downloading the plugin from GitHub you will need to create a
directory called globaladdressbook and place the files in there, ignoring the
root directory in the downloaded archive.

Config
------
The default config file is plugins/globaladdressbook/config.inc.php.dist
Rename this to plugins/globaladdressbook/config.inc.php

**'username'**

This is the name of the dummy user which holds the global address book.
The username does not have to belong to a valid email account. The username
will be stored in the Roundcube database but will not be able to log into
Roundcube unless it belongs to a valid email account on your server.

To create a single global address book for everyone who access Roundcube set
this options to something like: '[global_addressbook_user]'

To create a global address book per email domain which Roundcube serves set
this options to something like: 'global_addressbook@%d'

The username can contain the following macros that will be expanded as
follows:
* %d is replaced with the domain part of the logged in user's username
* %h is replaced with the imap host (from the session info)

**'readonly'**

Make address book read only, users will not be able to edit the contents of the
address book or add new contacts

**'groups'**

Should contact groups be available in the global address book

**'admin'**

The admin is a user or users who will always have full read/write access even
if the address book is set to read only. The follow options are available:
* To set a single user as admin then enter their username as a string like:
  'admin@domain.com'
* If you wish give admin rights to multiple users then enter the usernames in
  an array like: array('admin1@domain.com', 'admin2@domain.com')
* You can also use regual expressions to match the admin username, regular
  expressions must be started and finished the a '/'. Eg: '/^admin@/'

**'autocomplete'**

Show contacts from this book in the auto complete menu when composing an email

[gpl]: http://www.gnu.org/licenses/gpl.html

LDAP Address Book

/config/config.inc.php

Paste and adapt the following
Code: [Select]
$rcmail_config['ldap_public'] = array(
        'MyAdLdap' =>
        array (
                   'name' => 'Zentyal.lan Contacts',
                   'hosts' =>
                   array (
                      0 => 'localhost',
                    ),
                   'sizelimit' => 6000,
                   'port' => 3268,
                   'use_tls' => false,
                   'user_specific' => false,
                   'base_dn' => 'DC=office,DC=zentyal,DC=lan',
                   'bind_dn' => 'CN=Administrator,CN=Users,DC=office,DC=zentyal,DC=lan',
                   'bind_pass' => 'zent1',
                   'writable' => false,
                   'ldap_version' => 3,
                   'search_fields' =>
                   array (
                     0 => 'mail',
                     1 => 'cn',
                    ),
                   'name_field' => 'cn',
                   'email_field' => 'mail',
                   'surname_field' => 'sn',
                   'firstname_field' => 'givenName',
                    'sort' => 'sn',
                   'scope' => 'sub',
                   'filter' =>

'(&(mail=*)(|(&(objectClass=user)(!(objectClass=computer)))(objectClass=group)))',
                   'global_search' => true,
                   'fuzzy_search' => true
                 ),
);
« Last Edit: July 12, 2014, 08:39:05 pm by StuartNaylor »

StuartNaylor

  • Guest
Re: Roundcube tricks & tips 3.5
« Reply #2 on: July 12, 2014, 10:30:38 am »
Had a go at creating a bash script that should install roundcube

Set up the zentyal mail with a virtual mail domain

run as root or sudo

bash roundcube-install

point a browser at http://your-domain/webmail/installer

This will check everything remember to add an ?> to the end of config.inc.php

Then delete the /installer folder

point a browser at http://your-domain/webmail
« Last Edit: July 12, 2014, 03:06:26 pm by StuartNaylor »

StuartNaylor

  • Guest
Re: Roundcube tricks & tips 3.5
« Reply #3 on: July 22, 2014, 07:18:09 am »
Quick update to 1.0.2

Previous post shows how to add global contacts (stored in sql)
and Domain contacts (ldap)

Will have a go one time at a calendar with roundcube.
There is but didn't look too great.

Script should auto install
Code: [Select]
bash roundcube-install
point a browser at http://your-domain/webmail/installer

This will check everything remember to add an ?> to the end of config.inc.php

Then delete the /installer folder

point a browser at http://your-domain/webmail

[EDIT] Lol forgot to attach the script
« Last Edit: July 22, 2014, 08:14:04 am by StuartNaylor »

elzein

  • Zen Apprentice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Roundcube tricks & tips 3.5
« Reply #4 on: September 29, 2014, 08:44:11 am »
Quick update to 1.0.2

Previous post shows how to add global contacts (stored in sql)
and Domain contacts (ldap)

Will have a go one time at a calendar with roundcube.
There is but didn't look too great.

Script should auto install
Code: [Select]
bash roundcube-install
point a browser at http://your-domain/webmail/installer

This will check everything remember to add an ?> to the end of config.inc.php

Then delete the /installer folder

point a browser at http://your-domain/webmail

[EDIT] Lol forgot to attach the script

on the test config got error

red,left]config.inc.php:  NOT OK (Unable to read file. Did you create the config file?)
DSN (write):  NOT OK (Could not read config file)


this error in localhost/webmail


CONFIGURATION ERROR
config.inc.php was not found.
Please read the INSTALL instructions!

please help?