Attach is a SQL proof of concept.  I propose to incorporate this into
JDBCAlias.  The idea is that JDBCAlias will be able to do the following:

 1. Map from source-user@source-domain to dest-user@dest-domain.
    We use this to map from domain-user@domain to local-user@localhost.
    This maintains the existing functionality of JDBCAlias.

 2. Map from any-user@source-domain to specific-user@dest-domain.
    This can be used to implement a catchall address for a domain.
    This is NEW functionality.

 3. Map from specific-user@any-local-domain to specific-user@dest-domain.
    The meaning of "any-local-domain" is that although there is a wildcard,
the
    match succeeds IFF the requested domain exists somewhere in the domain
column.
    This is important because otherwise the wildcard user map could trap
e-mail
    intended for relay.
    This is NEW functionality.

If you are using JDBCAlias to support a virtual user table, this change
provides the ability to create a catch-all address for a given domain, and
to easily map a username across all local domains, without having to edit
config.xml for each case.

The SQL file can be tested by typing mysql < maptest.sql.  It uses the test
database, so you have no authentication requirement for this demo.  The SQL
file shows the table, a comment showing the prototype query (which will be
used with JDBC), sample data, test results, and a set of test queries.

The results are the test queries are the comments between the insert
statements and the select statements.

A few notes about how it works.  Part of the key is the ORDER BY clause.  I
believe that '%' is always going to be less than a legitimate user or domain
name.  This means that user@domain > user@% > %@domain.  I believe that to
be the desireable precedence, however, I plan to add a <sqlquery></sqlquery>
child to the mailet config, so that the query can be user replaced.
Replacing the query replaces the mapping policy.  But you have to be able to
code the policy in one query.

The query demonstrated is for MySQL.  I don't intend to provide queries for
other SQL servers, but other users can feel free to submit the equivalents.

Comments are solicited.

        --- Noel

Attachment: maptest.sql
Description: Binary data

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to