Sfoglia il codice sorgente

Add a few plugins to roundcube install

- managesieve :: this allows sieve filters to be edited through a
  brower
- twofactor_gauthenticator :: allow optional two-factor authentication
  when logging into webmail
- carddav :: sync ownCloud contacts with roundcube
Mike Ashley 7 anni fa
parent
commit
ed5b451c39

+ 45
- 0
roles/webmail/files/var_www_roundcube_composer.json Vedi File

@@ -0,0 +1,45 @@
1
+{
2
+    "name": "roundcube/roundcubemail",
3
+    "description": "The Roundcube Webmail suite",
4
+    "license": "GPL-3.0+",
5
+    "repositories": [
6
+        {
7
+            "type": "pear",
8
+            "url": "https://pear.php.net/"
9
+        },
10
+        {
11
+            "type": "composer",
12
+            "url": "https://plugins.roundcube.net/"
13
+        },
14
+        {
15
+            "type": "vcs",
16
+            "url": "https://github.com/roundcube/Net_Sieve.git"
17
+        },
18
+        {
19
+            "type": "vcs",
20
+            "url": "https://git.kolab.org/diffusion/PNL/php-net_ldap.git"
21
+        }
22
+    ],
23
+    "require": {
24
+        "php": ">=5.3.7",
25
+        "pear/pear-core-minimal": "~1.10.1",
26
+        "roundcube/plugin-installer": "~0.1.6",
27
+        "pear-pear.php.net/net_socket": "~1.0.12",
28
+        "pear-pear.php.net/auth_sasl": "~1.0.6",
29
+        "pear-pear.php.net/net_idna2": "~0.1.1",
30
+        "pear-pear.php.net/mail_mime": "~1.10.0",
31
+        "pear-pear.php.net/net_smtp": "~1.7.1",
32
+        "pear-pear.php.net/crypt_gpg": "~1.4.2",
33
+        "roundcube/net_sieve": "~1.5.0",
34
+        "alexandregz/twofactor_gauthenticator": "dev-master",
35
+	"roundcube/carddav": "dev-master"
36
+    },
37
+    "require-dev": {
38
+        "phpunit/phpunit": "*"
39
+    },
40
+    "suggest": {
41
+        "pear-pear.php.net/net_ldap2": "~2.2.0 required for connecting to LDAP address books",
42
+        "kolab/Net_LDAP3": "dev-master required for connecting to LDAP address books"
43
+    },
44
+    "minimum-stability": "dev"
45
+}

+ 185
- 0
roles/webmail/files/var_www_roundcube_plugins_carddav_config.inc.php Vedi File

@@ -0,0 +1,185 @@
1
+<?php
2
+
3
+//// RCMCardDAV Plugin Admin Settings
4
+
5
+//// ** GLOBAL SETTINGS
6
+
7
+// Disallow users to add / edit / delete custom addressbooks (default: false)
8
+//
9
+// If true, User cannot add custom addressbooks
10
+// If false, user can add / edit / delete custom addressbooks
11
+//
12
+// This option only affects custom addressbooks. Preset addressbooks (see below)
13
+// are not affected.
14
+// $prefs['_GLOBAL']['fixed'] = true;
15
+
16
+// When enabled, this option hides the 'CardDAV' section inside Preferences.
17
+// $prefs['_GLOBAL']['hide_preferences'] = true;
18
+
19
+// Scheme for storing the CardDAV passwords, in order from least to best security.
20
+// Options:
21
+// plain: store as plaintext
22
+// base64: store encoded with base64 (default)
23
+// des_key: store encrypted with global des_key of roundcube
24
+// encrypted: store encrypted with IMAP password of the user
25
+//            NOTE: if the IMAP password of the user changes, the stored
26
+//             CardDAV passwords cannot be decrypted anymore and the user
27
+//             needs to reenter them.
28
+// $prefs['_GLOBAL']['pwstore_scheme'] = 'base64';
29
+
30
+//// ** ADDRESSBOOK PRESETS
31
+
32
+// Each addressbook preset takes the following form:
33
+/*
34
+$prefs['<Presetname>'] = array(
35
+	// required attributes
36
+	'name'         =>  '<Addressbook Name>',
37
+	'username'     =>  '<CardDAV Username>',
38
+	'password'     =>  '<CardDAV Password>',
39
+	'url'          =>  '<CardDAV URL>',
40
+
41
+	// optional attributes
42
+	'active'       =>  <true or false>,
43
+	'readonly'     =>  <true or false>,
44
+	'refresh_time' => '<Refresh Time in Hours, Format HH[:MM[:SS]]>',
45
+
46
+	// attributes that are fixed (i.e., not editable by the user) and
47
+	// auto-updated for this preset
48
+	'fixed'        =>  array( < 0 or more of the other attribute keys > ),
49
+
50
+	// hide this preset from CalDAV preferences section so users can't even
51
+	// see it
52
+	'hide' => <true or false>,
53
+);
54
+*/
55
+
56
+// All values in angle brackets <VALUE> have to be substituted.
57
+//
58
+// The meaning of the different parameters is as follows:
59
+//
60
+// <Presetname>: Unique preset name, must not be '_GLOBAL'. The presetname is
61
+//               not user visible and only used for an internal mapping between
62
+//               addressbooks created from a preset and the preset itself. You
63
+//               should never change this throughout its lifetime.
64
+//
65
+// The following parameters are REQUIRED and need to be specified for any preset.
66
+//
67
+// name:         User-visible name of the addressbook. If the server provides
68
+//               an additional display name for the addressbooks found for the
69
+//               preset, it will be appended in brackets to this name, except
70
+//               if carddav_name_only is true (see below).
71
+//
72
+// username:     CardDAV username to access the addressbook. Set this setting
73
+//               to '%u' to use the roundcube username.
74
+//               In case one uses an email address as username there is the
75
+//               additional option to choose '%l', which will only use the
76
+//               local part of the username (eg: user.name@example.com will
77
+//               become user.name).
78
+//               Also, %d is available to get only the domain part of the
79
+//               username (eg: user.name@example.com will become example.com).
80
+//
81
+// password:     CardDAV password to access the addressbook. Set this setting
82
+//               to '%p' to use the roundcube password. The password will not
83
+//               be stored in the database when using %p.
84
+//
85
+// url:          URL where to find the CardDAV addressbook(s). If the given URL
86
+//               refers directly to an addressbook, only this single
87
+//               addressbook will be added. If the URL points somewhere in the
88
+//               CardDAV space, but _not_ to the location of a particular
89
+//               addressbook, the server will be queried for the available
90
+//               addressbooks and all of them will be added. You can use %u
91
+//               within the URL as a placeholder for the CardDAV username.
92
+//               '%l' works the same way as it does for the username field.
93
+//
94
+// The following parameters are OPTIONAL and need to be specified only if the default
95
+// value is not acceptable.
96
+//
97
+// active:       If this parameter is false, the addressbook is not used by roundcube
98
+//               unless the user changes this setting.
99
+//               Default: true
100
+//
101
+// carddav_name_only:
102
+//               If this parameter is true, only the server provided displayname
103
+//               is used for addressbooks created from this preset, except if
104
+//               the server does not provide a display name.
105
+//               Default: false
106
+//
107
+// readonly:     If this parameter is true, the addressbook will only be
108
+//               accessible in read-only mode, i.e., the user will not be able
109
+//               to add, modify or delete contacts in the addressbook.
110
+//               Default: false
111
+//
112
+// refresh_time: Time interval for that cached versions of the addressbook
113
+//               entries should be used, in hours. After this time interval has
114
+//               passed since the last pull from the server, it will be
115
+//               refreshed when the addressbook is accessed the next time.
116
+//               Default: 01:00:00
117
+//
118
+// fixed:        Array of parameter keys that must not be changed by the user.
119
+//               Note that only fixed parameters will be automatically updated
120
+//               for existing addressbooks created from presets. Otherwise the
121
+//               user may already have changed the setting, and his change
122
+//               would be lost. You can add any of the above keys, but it the
123
+//               setting only affects parameters that can be changed via the
124
+//               settings pane (e.g., readonly cannot be changed by the user
125
+//               anyway). Still only parameters listed as fixed will
126
+//               automatically updated if the preset is changed.
127
+//               Default: empty, all settings modifiable by user
128
+//
129
+//               !!! WARNING: Only add 'url' to the list of fixed addressbooks
130
+//                if it _directly_ points to an address book collection.
131
+//                Otherwise, the plugin will initially lookup the URLs for the
132
+//                collections on the server, and at the next login overwrite it
133
+//                with the fixed value stored here. Therefore, if you change the
134
+//                URL, you have two options:
135
+//                1) If the new URL is a variation of the old one (e.g. hostname
136
+//                 change), you can run an SQL UPDATE query directly in the
137
+//                 database to adopt all addressbooks.
138
+//                2) If the new URL is not easily derivable from the old one,
139
+//                 change the key of the preset and change the URL. Addressbooks
140
+//                 belonging to the old preset will be deleted upon the next
141
+//                 login of the user and freshly created.
142
+//
143
+// hide:         Whether this preset should be hidden from the CalDAV listing
144
+//               on the preferences page.
145
+
146
+
147
+// How Preset Updates work
148
+//
149
+// Preset addressbooks are created for a user as she logs in.
150
+
151
+//// ** ADDRESSBOOK PRESETS - EXAMPLE: Two Addressbook Presets
152
+
153
+//// Preset 1: Personal
154
+/*
155
+$prefs['Personal'] = array(
156
+	// required attributes
157
+	'name'         =>  'Personal',
158
+	// will be substituted for the roundcube username
159
+	'username'     =>  '%u', 
160
+	// will be substituted for the roundcube password
161
+	'password'     =>  '%p',
162
+	// %u will be substituted for the CardDAV username
163
+	'url'          =>  'https://ical.example.org/caldav.php/%u/Personal',
164
+
165
+	'active'       =>  true,
166
+	'readonly'     =>  false,
167
+	'refresh_time' => '02:00:00',
168
+
169
+	'fixed'        =>  array( 'username' ),
170
+	'hide'        =>  false,
171
+);
172
+*/
173
+
174
+//// Preset 2: Corporate
175
+/*
176
+$prefs['Work'] = array(
177
+	'name'         =>  'Corporate',
178
+	'username'     =>  'CorpUser',
179
+	'password'     =>  'C0rpPasswo2d',
180
+	'url'          =>  'https://ical.example.org/caldav.php/%u/Corporate',
181
+
182
+	'fixed'        =>  array( 'name', 'username', 'password' ),
183
+	'hide'        =>  true,
184
+);
185
+*/

+ 100
- 0
roles/webmail/files/var_www_roundcube_plugins_managesieve_config.inc.php Vedi File

@@ -0,0 +1,100 @@
1
+<?php
2
+
3
+// managesieve server port. When empty the port will be determined automatically
4
+// using getservbyname() function, with 4190 as a fallback.
5
+$config['managesieve_port'] = null;
6
+
7
+// managesieve server address, default is localhost.
8
+// Replacement variables supported in host name:
9
+// %h - user's IMAP hostname
10
+// %n - http hostname ($_SERVER['SERVER_NAME'])
11
+// %d - domain (http hostname without the first part)
12
+// For example %n = mail.domain.tld, %d = domain.tld
13
+$config['managesieve_host'] = 'localhost';
14
+
15
+// authentication method. Can be CRAM-MD5, DIGEST-MD5, PLAIN, LOGIN, EXTERNAL
16
+// or none. Optional, defaults to best method supported by server.
17
+$config['managesieve_auth_type'] = null;
18
+
19
+// Optional managesieve authentication identifier to be used as authorization proxy.
20
+// Authenticate as a different user but act on behalf of the logged in user.
21
+// Works with PLAIN and DIGEST-MD5 auth.
22
+$config['managesieve_auth_cid'] = null;
23
+
24
+// Optional managesieve authentication password to be used for imap_auth_cid
25
+$config['managesieve_auth_pw'] = null;
26
+
27
+// use or not TLS for managesieve server connection
28
+// Note: tls:// prefix in managesieve_host is also supported
29
+$config['managesieve_usetls'] = false;
30
+
31
+// Connection scket context options
32
+// See http://php.net/manual/en/context.ssl.php
33
+// The example below enables server certificate validation
34
+//$config['managesieve_conn_options'] = array(
35
+//  'ssl'         => array(
36
+//     'verify_peer'  => true,
37
+//     'verify_depth' => 3,
38
+//     'cafile'       => '/etc/openssl/certs/ca.crt',
39
+//   ),
40
+// );
41
+$config['managesieve_conn_options'] = null;
42
+
43
+// default contents of filters script (eg. default spam filter)
44
+$config['managesieve_default'] = '/etc/dovecot/sieve/global';
45
+
46
+// The name of the script which will be used when there's no user script
47
+$config['managesieve_script_name'] = 'managesieve';
48
+
49
+// Sieve RFC says that we should use UTF-8 endcoding for mailbox names,
50
+// but some implementations does not covert UTF-8 to modified UTF-7.
51
+// Defaults to UTF7-IMAP
52
+$config['managesieve_mbox_encoding'] = 'UTF-8';
53
+
54
+// I need this because my dovecot (with listescape plugin) uses
55
+// ':' delimiter, but creates folders with dot delimiter
56
+$config['managesieve_replace_delimiter'] = '';
57
+
58
+// disabled sieve extensions (body, copy, date, editheader, encoded-character,
59
+// envelope, environment, ereject, fileinto, ihave, imap4flags, index,
60
+// mailbox, mboxmetadata, regex, reject, relational, servermetadata,
61
+// spamtest, spamtestplus, subaddress, vacation, variables, virustest, etc.
62
+// Note: not all extensions are implemented
63
+$config['managesieve_disabled_extensions'] = array();
64
+
65
+// Enables debugging of conversation with sieve server. Logs it into <log_dir>/sieve
66
+$config['managesieve_debug'] = false;
67
+
68
+// Enables features described in http://wiki.kolab.org/KEP:14
69
+$config['managesieve_kolab_master'] = false;
70
+
71
+// Script name extension used for scripts including. Dovecot uses '.sieve',
72
+// Cyrus uses '.siv'. Doesn't matter if you have managesieve_kolab_master disabled.
73
+$config['managesieve_filename_extension'] = '.sieve';
74
+
75
+// List of reserved script names (without extension).
76
+// Scripts listed here will be not presented to the user.
77
+$config['managesieve_filename_exceptions'] = array();
78
+
79
+// List of domains limiting destination emails in redirect action
80
+// If not empty, user will need to select domain from a list
81
+$config['managesieve_domains'] = array();
82
+
83
+// Enables separate management interface for vacation responses (out-of-office)
84
+// 0 - no separate section (default),
85
+// 1 - add Vacation section,
86
+// 2 - add Vacation section, but hide Filters section
87
+$config['managesieve_vacation'] = 0;
88
+
89
+// Default vacation interval (in days).
90
+// Note: If server supports vacation-seconds extension it is possible
91
+// to define interval in seconds here (as a string), e.g. "3600s".
92
+$config['managesieve_vacation_interval'] = 0;
93
+
94
+// Some servers require vacation :addresses to be filled with all
95
+// user addresses (aliases). This option enables automatic filling
96
+// of these on initial vacation form creation.
97
+$config['managesieve_vacation_addresses_init'] = false;
98
+
99
+// Supported methods of notify extension. Default: 'mailto'
100
+$config['managesieve_notify_methods'] = array('mailto');

+ 7
- 0
roles/webmail/files/var_www_roundcube_plugins_twofactor_gauthenticator_config.inc.php Vedi File

@@ -0,0 +1,7 @@
1
+<?php
2
+// if true ALL users must have 2-steps active
3
+$rcmail_config['force_enrollment_users'] = false;
4
+
5
+// whitelist, CIDR format available
6
+// NOTE: we need to use .0 IP to define LAN because the class CIDR have a issue about that (we can't use 129.168.1.2/24, for example)
7
+$rcmail_config['whitelist'] = array('192.168.1.0/24', '::1', '192.168.0.9');

+ 27
- 3
roles/webmail/tasks/roundcube.yml Vedi File

@@ -28,9 +28,12 @@
28 28
   get_url: url=https://getcomposer.org/installer
29 29
            dest=/tmp/composer-installer
30 30
 
31
-- name: Copy compose configuration
32
-  command: creates="/var/www/roundcube/composer.json" mv /var/www/roundcube/composer.json-dist /var/www/roundcube/composer.json
33
-  
31
+- name: Copy composer configuration
32
+  copy: src=var_www_roundcube_composer.json dest=/var/www/roundcube/composer.json
33
+    owner=root
34
+    group=www-data
35
+    mode=0644
36
+
34 37
 - name: Install Composer
35 38
   command: php /tmp/composer-installer
36 39
            chdir=/root
@@ -59,6 +62,27 @@
59 62
 - name: Make roundcube directory accessible to web server
60 63
   file: path=/var/www/roundcube group=www-data recurse=yes state=directory
61 64
 
65
+- name: Install sieve plugin configuration
66
+  copy: src=var_www_roundcube_plugins_managesieve_config.inc.php
67
+    dest=/var/www/roundcube/plugins/managesieve/config.inc.php
68
+    owner=root
69
+    group=www-data
70
+    mode=0644
71
+
72
+- name: Install carddav plugin configuration
73
+  copy: src=var_www_roundcube_plugins_carddav_config.inc.php
74
+    dest=/var/www/roundcube/plugins/carddav/config.inc.php
75
+    owner=root
76
+    group=www-data
77
+    mode=0644
78
+
79
+- name: Install Google 2-factor authentication plugin configuration
80
+  copy: src=var_www_roundcube_plugins_twofactor_gauthenticator_config.inc.php
81
+    dest=/var/www/roundcube/plugins/twofactor_gauthenticator/config.inc.php
82
+    owner=root
83
+    group=www-data
84
+    mode=0644
85
+
62 86
 - name: Configure Apache for Roundcube
63 87
   template: src=etc_apache2_sites-available_roundcube.j2
64 88
     dest=/etc/apache2/sites-available/roundcube.conf

+ 3
- 0
roles/webmail/templates/var_www_roundcube_config_config.inc.j2 Vedi File

@@ -80,6 +80,9 @@ $config['des_key'] = 'fwef42cna12wefew9fewfmac';
80 80
 $config['plugins'] = array(
81 81
     'archive',
82 82
     'zipdownload',
83
+    'managesieve',
84
+    'twofactor_gauthenticator',
85
+    'carddav',
83 86
 );
84 87
 
85 88
 // skin name: folder from skins/

Loading…
Annulla
Salva