Verified Commit 9c4074ac authored by Maciej Delmanowski's avatar Maciej Delmanowski

Merge branch 'roundcube-merge' of into ganto-roundcube-merge

parents ac480f7c b7cfdc7a
sudo: required
dist: trusty
language: 'python'
python: '2.7'
system_site_packages: true
before_install: True
install: True
- 'git clone --depth 1'
- 'cd rolespec ; bin/rolespec -r'
.. _roundcube__ref_changelog:
.. include:: includes/all.rst
This project adheres to `Semantic Versioning <>`__
and `human-readable changelog <>`__.
The current role maintainer_ is ganto_.
Refer to the :ref:`roundcube__ref_upgrade_notes` when you intend to upgrade to a
new release of this role.
`debops-contrib.roundcube master`_ - unreleased
.. _debops-contrib.roundcube master:
`debops-contrib.roundcube v0.2.0`_ - 2017-08-28
.. _debops-contrib.roundcube v0.2.0:
- Added new soft dependency on debops.ferm_ to the example playbook. [ganto_]
- Added new soft dependency on debops.apt_preferences_ to the example playbook
to satisfy possible package pinning requirements of the debops.nginx_ and
debops.php_ roles. [ganto_]
- Added new soft dependency on debops.logrotate_ to the example playbook to
handle logfile rotation of PHP-FPM. [ganto_]
- New configuration variables :envvar:`roundcube__shell` and
:envvar:`roundcube__comment` to customize the Roundcube system account. [ganto_]
- New configuration variables :envvar:`roundcube__database_password_path` and
:envvar:`roundcube__database_name` for easier customization of the database
setup. [ganto_]
- Install PHP packages which cannot be satisfied by the APT package manager
via PHP's own :command:`composer` dependency manager. [ganto_]
- Run post-install script provided by upstream which downloads the required
Javascript libraries served to the Web browsers. [ganto_]
- Set default Roundcube version to 1.3.0. [ganto_]
- Adjusted the debops.nginx_ configuration to make use of the role's dependent
variables which required minor format changes and variable name adjustments to
correspond to the DebOps naming conventions:
``roundcube__nginx_server`` → :envvar:`roundcube__nginx__dependent_servers`
``roundcube__nginx_upstream_php5`` → :envvar:`roundcube__nginx__dependent_upstreams`
- Make use of the debops.mariadb_ dependent variables in the example playbook.
- Updated PHP role dependency from ``debops.php5`` to the more capable debops.php_.
This changed the format and name of the following variables:
``roundcube__php5_packages`` → :envvar:`roundcube__php__dependent_packages`
``roundcube__php5_pool`` → :envvar:`roundcube__php__dependent_pools`
- Renamed ``roundcube__extra_packages`` to :envvar:`roundcube__packages` to be
consistent with other DebOps roles. [ganto_]
- Changed default configuration of :envvar:`roundcube__www` from
:file:`/srv/www/{{ roundcube__user }}` to :file:`/srv/www` to be more
consistent with other system-wide Web applications. [ganto_]
- Fixed definition of :envvar:`roundcube__home` and :envvar:`roundcube__src` in
cases where the local facts defined by debops.core_ are not available. [ganto_]
- Remove support for Debian (oldoldstable) wheezy. [ganto_]
`debops-contrib.roundcube v0.1.3`_ - 2017-07-26
.. _debops-contrib.roundcube v0.1.3:
- Set default version to 1.1.9. [ganto_]
- Fix documentation build error due to deleted link definition to deprecated
``debops.php5`` role repository. [ganto_]
- Probe if :envvar:`roundcube__domain` is a string and construct :envvar:`roundcube__git_checkout` accordingly. [cultcom]
`debops-contrib.roundcube v0.1.2`_ - 2017-03-09
.. _debops-contrib.roundcube v0.1.2:
- Set default version to 1.1.7. [ganto_]
- Moved all variable definitions to :file:`defaults/main.yml` for better
configurability. Restructured defaults configuration file. [ganto_]
- Properly pass ``password`` parameter to debops.mariadb_ role dependency. [cultcom]
- Fix ``login_host`` definition in database schema import. [cultcom]
- Fix syntax error in :envvar:`roundcube__database_schema` variable definition. [cultcom]
- Fix MySQL database schema setup when using remote database by adjusting
indentation of example playbook. [ganto_]
`debops-contrib.roundcube v0.1.1`_ - 2016-08-03
.. _debops-contrib.roundcube v0.1.1:
- Introduced playbook-based role dependencies and removed hard-dependencies on
optional roles. For this reason the role variable ``roundcube__dependencies``
was removed too. If no or only individual dependencies are required simply
adjust the playbook accordingly. [ganto_]
- Converted documentation/Changelog to a new format. [ganto_]
debops-contrib.roundcube v0.1.0 - 2016-06-14
- Initial release of Roundcube 1.1.5 with SQLite and MySQL support. [ganto_]
debops-contrib.roundcube - Manage Roundcube Web mail with Ansible
Copyright (C) 2016-2017 Reto Gantenbein <[email protected]>
Copyright (C) 2016-2017 DebOps
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
## [![DebOps](]( roundcube
<!-- This file was generated by Ansigenome. Do not edit this file directly but
instead have a look at the files in the ./meta/ directory. -->
[![Travis CI](](
[![Ansible Galaxy](](
This role installs and manages [Roundcube](, a IMAP Web client written in PHP.
### Installation
This role requires at least Ansible `v2.3.0`. To install it, run:
ansible-galaxy install debops-contrib.roundcube
### Documentation
More information about `debops-contrib.roundcube` can be found in the
[official debops-contrib.roundcube documentation](
### Role dependencies
- `debops.secret`
### Are you using this as a standalone role without DebOps?
You may need to include missing roles from the [DebOps common
into your playbook.
[Try DebOps now]( for a complete solution to run your Debian-based infrastructure.
### Authors and license
- [Reto Gantenbein]( (maintainer) | [e-mail](mailto:[email protected]) | [GitHub](
License: [GPLv3](
This role is part of [DebOps]( README generated by [ansigenome](
- support mariadb or postgresql setup
- document sieve plugin setup
.. _roundcube__ref_upgrade_notes:
Upgrade notes
.. include:: includes/all.rst
The upgrade notes only describe necessary changes that you might need to make
to your setup in order to use a new role release. Refer to the
:ref:`roundcube__ref_changelog` for more details about what has changed.
From v0.1.3 to v0.2.0
Due to changes in the role dependencies and some adjustments in the role's
default values, your setup is likely to break if you simply execute the
updated role. To avoid this, take care of the following issues:
- If you are using a custom playbook, make sure to review the changes in
the :ref:`roundcube__ref_example_playbook`.
- The following variables were replaced and therefore are not defined
anymore in the default variables:
- ``roundcube__nginx_server``
- ``roundcube__nginx_upstream_php5``
- ``roundcube__php5_packages``
- ``roundcube__php5_pool``
- ``roundcube__extra_packages``
In case your playbook is referencing one of them, make sure they are
properly defined in your inventory or update your playbook. If you are using
the example playbook but customized one of those variables in your Ansible
inventory update the definition accordingly.
- The default installation path defined in :envvar:`roundcube__www` changed.
If you didn't customize its value the Roundcube installation will be under
a new file system path after the installation.
**Upgrade procedure**
The following procedure is valid if you are using the role dependencies as
defined in the example playbook.
1. Make sure you have the latest version of the DebOps roles.
.. code:: shell
$ debops-update
2. Make sure you have the lastest version of the debops-contrib.roundcube_
role. In your DebOps project directory run:
.. code:: shell
$ ansible-galaxy install --force --no-deps --roles-path=ansible/roles debops-contrib.roundcube
2. Review the :ref:`roundcube__ref_changelog` and make sure your Ansible
inventory is adjusted to the variable changes (if necessary).
3. Remove the nginx virtual host and PHP definitions created by the
debops.nginx_ role from the Roundcube server:
.. code:: shell
# rm /etc/nginx/{sites-available,sites-enabled}/
# rm /etc/nginx/conf.d/upstream_php5_roundcube.conf
4. Run the role (e. g. via example playbook):
.. code:: shell
$ debops ansible/roles/debops-contrib.roundcube/docs/playbooks/roundcube.yml
5. In case you are using the default configuration copy the Roundcube
SQLite database containing the user settings to the new installation path.
.. code:: shell
$ cp /srv/www/roundcube/sites/ \
6. In case Roundcube was installed into a new directory but you didn't use the
default :envvar:`roundcube__www` configuration before the update or you
experience SQL schema issues, you need to manually run the upstream post
update script on the Roundcube server.
.. code:: shell
# su roundcube -s /bin/bash \
-c "php /srv/www/sites/ \
--package=roundcube --dir=/srv/www/sites/"
7. If you manually installed some additional plugins you might need to reinstall
or update them for the new Roundcube version.
This diff is collapsed.
.. literalinclude:: ../COPYRIGHT
.. _roundcube__ref_getting_started:
Getting started
.. contents::
.. include:: includes/all.rst
.. _roundcube__ref_default_setup:
Default setup
If you don't specify any configuration values, the role will setup a Nginx_
HTTP server running a default installation of the latest Roundcube stable
release which is then accessible via ``https://roundcube.<your-domain>``.
SQLite is used as database backend for storing the user settings.
.. _roundcube__ref_example_inventory:
Example inventory
Roundcube can be installed on a given host by adding it to the
``[debops_service_roundcube]`` Ansible inventory group::
.. _roundcube__ref_example_playbook:
Example playbook
The following playbook can be used with DebOps. If you are using these role
without DebOps you might need to adapt them to make them work in your setup.
.. literalinclude:: playbooks/roundcube.yml
:language: yaml
This playbook is also shipped with the role under :file:`docs/playbooks/`.
.. _roundcube__ref_ansible_tags:
Ansible tags
You can use Ansible ``--tags`` or ``--skip-tags`` parameters to limit what
tasks are performed during Ansible run. This can be used after a host was first
configured to speed up playbook execution, when you are sure that most of the
configuration is already in the desired state.
Available role tags:
Main role tag, should be used in the playbook to execute all of the role
tasks as well as role dependencies.
Run tasks related to system package installation.
Run tasks related to the application deployment and update.
Run tasks related to the Roundcube application configuration.
Run tasks related to setup or update the database user and schema.
Guides and examples
Enable spell checking with aspell
To enable local spell checking of your email content, you have to install
``php5-enchant`` and ``aspell`` together with the according language
dictionaries. For example for english and french spell checking, you would
add the following packages to your Roundcube role configuration:
.. code:: yaml
roundcube__packages: [ 'php5-enchant', 'aspell', 'aspell-en', 'aspell-fr' ]
Additionally you have to tell Roundcube that you want to use the local
spell checking library:
.. code:: yaml
spellcheck_engine: 'enchant'
spellcheck_languages: "array('en', 'fr')"
Of course, many more languages are supported. You can find more information
about the required packages and configuration in the Roundcube `Aspell-Howto`_.
.. _Aspell-Howto:
.. _debops-contrib.roundcube:
Ansible role: debops-contrib.roundcube
.. toctree::
:maxdepth: 2
Local Variables:
mode: rst
ispell-local-dictionary: "american"
This `Ansible`_ role allows you to install and manage `Roundcube`_, a
IMAP Web client written in PHP.
.. _Ansible:
.. _Roundcube:
This role requires at least Ansible ``v2.3.0``. To install it, run:
.. code-block:: console
ansible-galaxy install debops-contrib.roundcube
Local Variables:
mode: rst
ispell-local-dictionary: "american"
- name: Manage Roundcube Web mail
hosts: [ 'debops_service_roundcube' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
- role: debops.php/env
tags: [ 'role::php', 'role::php:env' ]
- role: debops.apt_preferences
tags: [ 'role::apt_preferences', 'role::nginx', 'role::php' ]
- '{{ nginx__apt_preferences__dependent_list }}'
- '{{ php__apt_preferences__dependent_list }}'
- role: debops.logrotate
tags: [ 'role::logrotate' ]
- '{{ php__logrotate__dependent_config }}'
- role: debops.ferm
tags: [ 'role::ferm', 'role::nginx' ]
- '{{ nginx__ferm__dependent_rules }}'
- role: debops.php
tags: [ 'role::php' ]
- '{{ roundcube__php__dependent_packages }}'
- '{{ roundcube__php__dependent_pools }}'
- role: debops.nginx
tags: [ 'role::nginx' ]
- '{{ roundcube__nginx__dependent_servers }}'
- '{{ roundcube__nginx__dependent_upstreams }}'
- role: debops.mariadb
tags: [ 'role::mariadb' ]
- database: '{{ roundcube__database_map[roundcube__database].dbname }}'