Hi Dan,
On Wed, Aug 20, 2003 at 06:36:13AM +0200, Dan Evans wrote:
> I've tried "${tr {$domain}{.}{_}}" in place of **table**, dots are replaced
> with underscores in the tablenames for the obvious reason, but with no joy
$domain is not defined (at least not with anything that makes sense)
in the authenticator's server_condition. You will have to split
the "username" at "@". And: I really don't like the idea of having
the user specify part of the SQL statements...
Why don't you create a map with the domain->table association
# domain sql-table
domain.com domain_com
foobar.example foo_ex
and use a statement like:
SELECT FROM ${lookup \
{${extract{2}{@}{$1}}} \ <-- extract domain part
dbm \
{/etc/mail/sql_tables} \
{$value}{default_table} \
} WHERE ...
Of course, for easy maintainability, this could also be a SQL lookup.
Chris