/roundcube-aliases

RoundCube plugin to set alias addresses in PostfixAdmin database

Primary LanguagePHPGNU General Public License v2.0GPL-2.0

+-------------------------------------------+
| PostfixAdmin Aliases Plugin for RoundCube |
+-------------------------------------------+



AUTHOR

Gianluca Giacometti (php@gianlucagiacometti.it)
Stephan Blanke (stephanblanke@users.noreply.github.com)



VERSION

1.0.0



RELEASE DATE

29-09-2014



INSTALL

Requirements :
- jQuery UI.

To install this plugin, copy all files into /plugin/aliases folder and
add it to the plugin array in config/config.inc.php :

// List of active plugins (in plugins/ directory)
$rcmail_config['plugins'] = array('aliases');



CONFIGURATION

Copy 'config.inc.php.dist' to 'config.inc.php'.
Edit the plugin configuration file 'config.inc.php' and choose the
appropriate options:

$rcmail_config['aliases_driver'] = 'sql';
    so far only sql is available

$rcmail_config['aliases_sql_dsn'] = value;
    example value: 'pgsql://username:password@host/database'
    example value: 'mysql://username:password@host/database'

$rcmail_config['aliases_sql_aliases'] = query;
    query used to select all mailbox aliases
    default mailbox alias to itself is excluded and managed by forward plugin
    the query depends upon your postfixadmin database structure
    placeholders %goto and %address must be kept unchanged
    default query: 'SELECT * FROM alias WHERE goto = %goto AND address != %goto ORDER BY address'
    example query: 'SELECT * FROM aliases WHERE forwardto = %goto AND address != %goto ORDER BY address'

$rcmail_config['aliases_sql_allaliases'] = query;
    query used to select all domain aliases but user's
    need to avoid alias duplicates in the domain
    the query depends upon your postfixadmin database structure
    placeholders %domain, %goto and %address must be kept unchanged
    default query: 'SELECT * FROM alias WHERE domain = %domain AND goto != %goto ORDER BY address'
    example query: 'SELECT * FROM aliases WHERE domain = %domain AND forwardto != %goto ORDER BY address'

$rcmail_config['aliases_sql_read'] = query;
    query used to select an alias
    the query depends upon your postfixadmin database structure
    placeholders $goto and %address must be kept unchanged
    default query: 'SELECT * FROM alias WHERE goto = %goto AND address = %address'
    example query: 'SELECT * FROM aliases WHERE forwardto = %goto AND address = %address'

$rcmail_config['aliases_sql_update'] = query;
    query used to update an alias
    the query depends upon your postfixadmin database structure
    placeholders %newalias, %goto and %address must be kept unchanged
    default query: 'UPDATE alias SET address = %newalias, modified = %modified WHERE goto = %goto AND address = %address'
    example query: 'UPDATE aliases SET address = %newalias WHERE forwardto = %goto AND address = %address'

$rcmail_config['aliases_sql_delete'] = query;
    query used to delete an alias
    the query depends upon your postfixadmin database structure
    placeholders %goto and %address must be kept unchanged
    default query: 'DELETE FROM alias WHERE address = %address AND goto = %goto'
    example query: 'DELETE FROM aliases WHERE address = %address AND forwardto = %goto'

$rcmail_config['aliases_sql_create'] = query;
    query used to create a new an alias
    the query depends upon your postfixadmin database structure
    placeholders %goto, %address, %domain, %created, %modified and %active must be kept unchanged
    default query: 'INSERT INTO alias (address, goto, domain, created, modified, active) VALUES (%address, %goto, %domain, %created, %modified, %active)'
    example query: 'INSERT INTO aliases (address, forwardto, domain, created, updated, active) VALUES (%address, %goto, %domain, %created, %modified, %active)'

$rcmail_config['aliases_sql_toggle'] = query;
    query used to toggle the activation status
    the query depends upon your postfixadmin database structure
    placeholders %goto and %address must be kept unchanged
    default query: 'UPDATE alias SET active = NOT active WHERE goto = %goto AND address = %address';
    example query: 'UPDATE aliases SET active = NOT active WHERE goto = %goto AND address = %address';


LICENCE

Licensed under GNU GPL2 licence.



NOTE

The code is based on SieveRules plugin (sieverules) by Philip Weir.
Thank you Philip.

The javascript was fixed by Jakub Matas.
Thank you Jakub.