You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Noel J. Bergman" <no...@devtech.com> on 2002/10/02 23:09:25 UTC

[PATCH] JDBCVirtualUserTable

This is the mailet we've been using since mid-August to handle virtual
domains and users.  Full documentation is in the header comment:

/**
 * Implements a Virtual User Table for JAMES.  Derived from the
 * JDBCAlias mailet, but whereas that mailet uses a simple map from a
 * source address to a destination address, this handles simple
 * wildcard selection, verifies that a catchall address is for a domain
 * in the Virtual User Table, and handles forwarding.
 *
 * With JDBCAlias, if the destination address were remote it would be
 * subject to relay testing, even though it should be treated as a local
 * address.  JDBCVirtualUserTable incorporates JDBCAlias processing for
 * local destinations, and Forward processing for remote destinations.
 *
 * To prevent from breaking existing JDBCAlias applications, and to
 * allow for evolution of this mailet, it is released as a new mailet,
 * rather than as an update to JDBCAlias.  However, anyone using
 * JDBCAlias should be able to upgrade to JDBCVirtualUserTable.
 *
 * As with JDBCAlias, JDBCVirtualUserTable does not provide any
 * administation tools.  You'll have to create the VirtualUserTable
 * yourself.  The standard configuration is as follows:
 *
 * CREATE TABLE VirtualUserTable
 * (
 *  user varchar(64) NOT NULL default '',
 *  domain varchar(255) NOT NULL default '',
 *  target_address varchar(255) NOT NULL default '',
 *  PRIMARY KEY (user,domain)
 * );
 *
 * The standard query used with VirtualUserTable is:
 *
 * select VirtualUserTable.target_address from VirtualUserTable,
VirtualUserTable as VUTDomains
 * where (VirtualUserTable.user like ? or VirtualUserTable.user like "\%")
 * and (VirtualUserTable.domain like ?
 * or (VirtualUserTable.domain like "\%" and VUTDomains.domain like ?))
 * order by concat(VirtualUserTable.user,'@',VirtualUserTable.domain) desc
limit 1
 *
 * For a given [user, domain, domain] used with the query, this will
 * match as follows (in precedence order):
 *
 * 1. user@domain    - explicit mapping for user@domain
 * 2. user@%         - catchall mapping for user anywhere
 * 3. %@domain       - catchall mapping for anyone at domain
 * 4. null           - no valid mapping
 *
 * You need to set the connection.  At the moment, there is a limit to
 * what you can change regarding the SQL Query, because there isn't a
 * means to specify where in the query to replace parameters. [TODO]
 *
 * &lt;mailet match="All" class="JDBCVirtualUserTable"&gt;
 *   &lt;table&gt;db://maildb/VirtualUserTable&lt;/table&gt;
 *   &lt;sqlquery&gt;sqlquery&lt;/sqlquery&gt;
 * &lt;/mailet&gt;
 *
 * @author  Noel J. Begman <no...@devtech.com>
 */


Re: multidomain user

Posted by Zsombor Gegesy <de...@mailbox.hu>.
Hello Davide,

Thursday, October 03, 2002, 10:28:38 AM, you wrote:

DF> Actual implementation of org.apache.james.userrepository.UsersFileRepository
DF> and/or org.apache.james.userrepository.UsersFileRepository can manage
DF> different user for different domain?

DF> Davide Frigerio.

 Nearly ... :)
I faced with the same problem, and developed a small extension... you
can find it at :
 http://www.mail-archive.com/james-dev@jakarta.apache.org/msg03749.html


hi
 Zsombor Gegesy



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: multidomain user

Posted by "Noel J. Bergman" <no...@devtech.com>.
Davide,

I just submitted the mailet that we use to manage a virtual user table.
Supports wildcards and virtual hosts.  Zsombor Gegesy submitted a
modification to the James repositories that uses fully qualified user@domain
names in the repositories.

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


multidomain user

Posted by Davide Frigerio <da...@wise-lab.it>.
Actual implementation of org.apache.james.userrepository.UsersFileRepository
and/or org.apache.james.userrepository.UsersFileRepository can manage
different user for different domain?

Davide Frigerio.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>