Re: [Exim] Multiple MySQL databases and hosts

Top Page
Delete this message
Reply to this message
Author: Peter Galbavy
Date:  
To: Ollie Cook, exim-users
Subject: Re: [Exim] Multiple MySQL databases and hosts
My original patches submitted to Phil (years ago) for postgresql support
included multiple server support.

I do not know the situation in v4, but the code is quite easy in 3.33 and
you could hack it to support extended syntax and multiple servers.

Phil - I have since forgotten what is happening in v4 - any changes to DB
support ?

PS I gave up using the postgresql support directly and instead implemented a
perl layer between exim and the DB(s) - this is much more flexible as you
can hide the SQL in the perl, and also potentially have multiple and
independent backend DBs over time, without changing the exim config.

Peter

----- Original Message -----
From: "Ollie Cook" <ollie@???>
To: <exim-users@???>
Sent: Wednesday, December 05, 2001 12:41 PM
Subject: [Exim] Multiple MySQL databases and hosts


> Hi,
>
> It seems to me that there is a bit of a issue with Exim
> with regards to MySQL databases, *if* you want to look things
> up in different databases on a variety of hosts.
>
> I know that you can specify more that one MySQL connection:
>
>  mysql_servers = host1::3306/database1/user1/password1\
>                  host2::3306/database2/user2/password2

>
> But imagine a situation where you have:
>
> # main config
> DOMAINS = SELECT domain FROM domains WHERE domain='$key'
> USERS = SELECT login FROM users WHERE

login='${quote_mysql:$local_part}'
> local_domains = mysql;DOMAINS
>
>   # director
>   valid_users:
>     driver = smartuser
>     transport = local_delivery
>     local_parts = mysql;USERS

>
> If the "domains" table is on host2 and the "users" table is on host1
> when a mail arrives Exim will do three lookups:
>
>   1)  DOMAINS lookup on host1 which will fail because that table
>       doesn't exist on host1
>   2)  DOMAINS lookup on host2 which will succeed if the domain
>       is in the table on host2
>   3)  USERS lookup on host1 if #2 succeeds

>
> It seems wasteful to do query #1, here.
>
> As far as I can tell there is no way to specify that a particular
> query should use a particular connection, although I'd like to be
> corrected!
>
> Might I suggest for Exim 4 something where users could give
> host+database+user+password combinations an identifier:
>
>   mysql_servers = domains/host1::3306/database1/user1/password1\
>                   users/host2::3306/database2/user2/password2

>
>                 #  ^^^ identifier

>
> and then use things like:
>
> local_domains = mysql;domains;DOMAINS
> local_parts = mysql;users;USERS
>
> to specify which host to look up a particular query with?
>
> I think it would save rather a lot of lookups which administrators know
> are going to fail, reducing load on the database servers, and would speed
> up the handling of mail on busy servers.
>
> Ollie
> --
> Oliver Cook    Systems Administrator, ClaraNET
> ollie@???               020 7903 3065

>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim

details at http://www.exim.org/ ##
>
>