GithubHelp home page GithubHelp logo

gianlucagiacometti / roundcube-aliases Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 11.0 87 KB

RoundCube plugin to set alias addresses in PostfixAdmin database

License: GNU General Public License v2.0

PHP 52.48% JavaScript 15.27% CSS 16.96% HTML 15.28%

roundcube-aliases's Introduction

DEPRECATED

NOTE
THIS PLUGIN DOES NOT WORK IN RC 1.4.x AND ITS DEVELOPMENT IS DICONTINUED
all functionalities will be migrated into the new plugin roundcube-toolbox

AUTHOR

Gianluca Giacometti ([email protected])

VERSION

1.3.6

RELEASE DATE

10-05-2018

INSTALL

Requirements :

  • jQuery UI.

To install this plugin, copy all files into /plugin/aliases folder and add it to the plugin array in config/main.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['alias_driver'] = 'sql';

so far only sql is available

$rcmail_config['alias_sql_dsn'] = value;

example value: 'pgsql://username:password@host/database'
example value: 'mysql://username:password@host/database'

$rcmail_config['alias_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 domain = %domain AND address != %goto ORDER BY address'
example query: 'SELECT * FROM aliases WHERE forwardto = %goto AND domain = %domain AND address != %goto ORDER BY address'

$rcmail_config['alias_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['alias_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['alias_sql_update'] = query;

query used to update an alias
the query depends upon your postfixadmin database structure
placeholders %newalias, %goto, %address and %active must be kept unchanged

default query: 'UPDATE alias SET address = %newalias, modified = %modified, active = %active WHERE goto = %goto AND address = %address'
example query: 'UPDATE aliases SET address = %newalias, active = %active WHERE forwardto = %goto AND address = %address'

$rcmail_config['alias_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['alias_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)'

LICENCE

Licensed under GNU GPL2 licence.

NOTE

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

roundcube-aliases's People

Contributors

dicea-unipd avatar gianlucagiacometti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

roundcube-aliases's Issues

aliases plugin not compatible with roundcube 0.9 beta

Hi,

Due to changes in the way roundcube access database in the 0.9 beta version, the forward plugin doesn't work anymore starting with this version.

this is related with the following changelog line of roundcube 0.9 :

Another major change is the new database abstraction. In order to add support for SQLite3 the PEAR:MDB2 dependency was dropped and Roundcube now uses the native PHP Data Objects (PDO). ATTENTION: due a small lack in the MySQL PDO driver this version of Roundcube requires PHP 5.3 when using the MySQL database.

A workaround is to replace in lib/driver/sql.php the line

    $db = new rcube_mdb2($dsn, '', FALSE);

by

        if (!class_exists('rcube_db')) {
            $db = new rcube_mdb2($dsn, '', FALSE);
        } else {
            $db = rcube_db::factory($dsn, '', FALSE);
        }

regards,

S.B.

Roundcube-Aliases crash

Hi all,

i try the plugin on my roundcube instance, but all times i get "HTTP ERROR 500".

My steps:

cd /var/www/roundcubemail/plugins/
git checkout https://github.com/gianlucagiacometti/Roundcube-Aliases aliases
chown -R www-data:www-data aliases
cp aliases/config.inc.php.dist aliases/config.inc.php
activate the plugin
roundcube -> settings -> aliases

/var/www/roundcubemail/logs/errors

[25-Oct-2017 22:44:03 Europe/Berlin] PHP Parse error: syntax error, unexpected 'factory' (T_STRING), expecting variable (T_VARIABLE) or '$' in /var/www/sources/git/roundcubemail/plugins/aliases/lib/drivers/sql.php on line 27

Set the correct mysql login data doesn't change anything ...
I also tried to change back to 1.3.0 (git checkout tags/1.3.0).

My system:

Debian 8.9 (all updates)
PHP 5.6.30-0+deb8u1
Roundcubemail 1.3.1 [GIT 20170904.2049]

Regards
erdo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.