Skip to content

Commit 9c02e32

Browse files
committed
Merge pull request #9 from zhanghuangbin/master
Fix incorrect VIEW name in PGSQL template, typo in README.md.
2 parents 82dc158 + ee7ac8e commit 9c02e32

File tree

2 files changed

+49
-27
lines changed

2 files changed

+49
-27
lines changed

README.md

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
__If you have any other ideas, create an Issue in this github project.__
2+
13
# RoundCube SQL Global Address Books
24
Roundcube Plugin to create an Address Book from list of users in the SQL View.
35
Currently Natively Supporting:
@@ -16,54 +18,74 @@ Address Book view:
1618

1719
![](./screenshots/address.book.png)
1820

19-
#License#
21+
# License
2022

2123
This software adheres to the MIT License, please see LICENSE File!
2224

23-
#Installation#
25+
# Installation
26+
27+
1. To Install, extract this archive and copy the folder
28+
`sql_global_addressbooks` into `roundcube/plugins/`
29+
30+
2. This plugin queries contacts from SQL VIEW (or table) `global_addressbook`,
31+
please check file `SQL/README.md` to understand how to create a required
32+
VIEW (or table). Available SQL templates:
33+
34+
* For MySQL/MariaDB:
35+
36+
* `iredmail+alias.my.sql`: template for iRedMail server.
37+
it will list both mail user and mail alias accounts in address book.
38+
* `iredmail.my.sql`: template for iRedMail server, it lists mail users
39+
in address book.
2440

25-
1. To Install, extract this archive and copy the folder
26-
`sql_global_addressbooks` into `roundcube/plugins/`
41+
* For PostgreSQL:
2742

28-
2. Choose one of the SQL Scripts from `./SQL/`, dependant on your Mail System
29-
and whether or not you wish to have Alias Support, `[%name%+alias.sql]`
30-
or you would like just to have the primary emails, `[%name%.sql]`
31-
and run it on your `MySQL/MariaDB` Server as `root`, for example from `PHPMyAdmin`
43+
* `iredmail.pg.sql`: template for iRedMail server. Note: it requires
44+
some manual setup, please open this file and read the comment first.
3245

33-
3. And then add `sql_global_addressbooks` to your `roundcube/config/config.inc.php` so it looks like: `$config['plugins'] = array(..., 'sql_global_addressbooks');`
46+
3. under `plugins/sql_global_addressbooks/`, copy `config.inc.php.dist` to
47+
`config.inc.php`. It will enable per-domain address book with default
48+
setting. if you need more control, please open it, read the commend, and
49+
adjust the settings to match your need.
3450

35-
4. Rename `roundcube/plugins/sql_global_addressbooks/config.inc.php.dist` to
36-
`config.inc.php` and fill in the configuration file.
51+
4. Enable this plugin in Roundcube config file `roundcubemail/config/config.inc.php`.
52+
For example:
3753

54+
```php
55+
$config['plugins'] = array(..., 'sql_global_addressbooks');
56+
```
3857

39-
#Book Types#
58+
# Book Types
59+
60+
### Domain Book
4061

41-
###Domain Book###
4262
This Book Type shows all users which are in the same Domain Realm as the Authenticated User.
4363
Supports Whitelist and Blacklist to select which users are given this Book.
4464

45-
###Global Book###
65+
### Global Book
66+
4667
This Book Type shows all users, with the exception of the blacklisted ones.
4768
Supports Whitelist and Blacklist of which domains to include in book, for example if you'd like to hide a domain from the Global Book then just add it to the `_sql_gb_data_hidden` array.
4869
Supports Whitelist and Blacklist to select which users are given this book also.
4970

50-
###Support Book###
71+
### Support Book
72+
5173
This Book Type shows a specific set of domains, to all users except those which are part of any of the domains in the set.
5274
This is the most complicated Book Type in the set, and probably won't get used, I do use it personally which is why its included.
5375

54-
######If you have any other Book Type Ideas, open them up as an Issue Thread######
55-
56-
#Security#
76+
# Security
5777

5878
This plugin is considered secure to use for the following reasons:
59-
+ Security through Obscurity - The plugin uses a MySQL View instead of directly accessing the SQL Schema+Table because it means it is given no access to such things as User Hashes [Passwords] but it also means that the whole Plugin remains the same and the View Defines how it interacts with the Existing DB.
60-
+ Read Only MySQL View - The View containing Functions and SubQueries [Alias Support] means that the View is Read Only which is another layer of security between your Data and any Potential Damaging Code.
61-
+ It uses the Internal Roundcube Address Book classes so if any bugs exist in them they will be patched accordingly, hopefully without breaking the functionality of this plugin.
62-
+ This plugin features no accessible endpoints, it can be Modelled as a processing node, as it does not address the client directly. Ever. All the communication between DB -> Itself -> Client is managed and administered by the RoundCube Plugin Hooks+API.
6379

64-
#####If you do not trust me, just look through the source code, it should be pretty straight forward and you can then rest assured!#####
80+
* Security through Obscurity - The plugin uses a MySQL View instead of directly accessing the SQL Schema+Table because it means it is given no access to such things as User Hashes [Passwords] but it also means that the whole Plugin remains the same and the View Defines how it interacts with the Existing DB.
81+
* Read Only MySQL View - The View containing Functions and SubQueries [Alias Support] means that the View is Read Only which is another layer of security between your Data and any Potential Damaging Code.
82+
* It uses the Internal Roundcube Address Book classes so if any bugs exist in them they will be patched accordingly, hopefully without breaking the functionality of this plugin.
83+
* This plugin features no accessible endpoints, it can be Modelled as a processing node, as it does not address the client directly. Ever. All the communication between DB -> Itself -> Client is managed and administered by the RoundCube Plugin Hooks+API.
84+
85+
If you do not trust me, just look through the source code, it should be pretty straight forward and you can then rest assured!
6586

66-
#Support#
87+
# Support
6788

6889
The Configuration File has been annotated and should prove easy to understand.
69-
Feel free to contact me directly at [email protected] if you have any queries or requests!
90+
Feel free to contact me directly at `postmaster _at_ webdevguru.co.uk` if you
91+
have any queries or requests!

SQL/iredmail.pg.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
--
3333
-- CREATE EXTENSION dblink;
3434

35-
CREATE VIEW global_addressbooks AS
35+
CREATE VIEW global_addressbook AS
3636
SELECT * FROM dblink('host=127.0.0.1 port=5432 user=vmail password=xxx dbname=vmail', 'SELECT extract(epoch FROM created), name, username, domain FROM mailbox WHERE active=1')
3737
AS global_addressbook ("ID" BIGINT, name VARCHAR(255), email VARCHAR(255), domain VARCHAR(255));
3838

39-
ALTER TABLE global_addressbooks OWNER TO roundcube;
39+
ALTER TABLE global_addressbook OWNER TO roundcube;

0 commit comments

Comments
 (0)