Re: [exim] Make existence of SQL table optional

Top Page
Delete this message
Reply to this message
Author: Peter Bowyer
Date:  
To: exim-users
Subject: Re: [exim] Make existence of SQL table optional
On 28 May 2010 10:11, Konstantin Kletschke <lists@???> wrote:
>
> Hello!
>
> In my config i have an alias_domain part in my config, which checks a
> table if there are aliases in it depending on domain.
>
> alias_domain:                                                                     driver = redirect
>  allow_defer                                                                     allow_fail
>  data = ${lookup mysql {MYSQL_DOMAIN_ALIAS}{$value}}                             domains = mysql;MYSQL_LOCALDOMAINS
>  retry_use_local_part
>  user = exim
>
> In many cases these tables are emtpy but I need them to be created, even
> if empty. Can I get a behaviour where the existence is optional so that
> non existand tables are created as if the are there and empty?


Not really an Exim question but relying on the existence/otherwise of
a piece of database schema is not really a sensible route - better to
organise your schema to store aliases in a single table with a column
(indexed to improve performance) to indicate which domain an alias
refers to. You can add/delete rows at will without needing to worry
about the database structure, and construct a query using the domain
as a key.

Peter


--
Peter Bowyer
Email: peter@???
Follow me on Twitter: twitter.com/peeebeee