Re: [Exim] equivilent of lsearch* on mysql/pgsql lookups?

Top Pagina
Delete this message
Reply to this message
Auteur: Jason J. Horton
Datum:  
Aan: Peter Galbavy
CC: exim-users
Onderwerp: Re: [Exim] equivilent of lsearch* on mysql/pgsql lookups?
Maybe I should clarify my question. I use lsearch* so I can have "catchall"
entries
in my alias files, like so:
tom:        tommy@???
jim:        james@???
*:        catchall@???


if an email address doesnt match tom, tommy, jim or james, it gets sent to
the catchall address. Was wondering if there was a way to replicate this with
using pgsql queries. I know I can do something simular to what you have, but
that doesnt allow for a (for lack of a better term) wildcard match.

Peter Galbavy wrote:
>
> The config should look something like this (my postgres quaeries - but mysql
> should work the same):
>
> virtual_alias:
>   driver = aliasfile
>   domains = "pgsql;SELECT domain FROM domains WHERE domain = '$key'"
>   ...
>   search_type = pgsql
>   query = SELECT a.address FROM alias a, lists l, users u WHERE \
>         a.alias = '$local_part' AND a.domain = l.domain AND \
>         a.domain = u.domain AND a.address = u.account AND \
>         a.domain = '$domain' AND \
>         u.status = 100 AND a.status = 100 AND l.status = 100

>
> I do a join and check for status etc. but your query could be much simpler.
> Note the use of 'query' is orthoganal to 'file'.
>
> Peter
>
> ----- Original Message -----
> From: "Jason J. Horton" <jason@???>
> To: <exim-users@???>
> Sent: Tuesday, June 06, 2000 7:44 PM
> Subject: [Exim] equivilent of lsearch* on mysql/pgsql lookups?
>
> > Currently I have a director that looks like this:
> > virtual_alias:
> >    driver = aliasfile
> >    domains = lsearch;/mail/conf/domains
> >    file = /mail/conf/$domain/aliases
> >    file_transport = address_file
> >    search_type = lsearch*
> >    qualify_preserve_domain

> >
> > Using it to get different alias files per domain. I am starting
> > to get tired of dealing with plain text files and would like to
> > stuff everything in a database. Have had good luck replacing passwd
> > file queries with sql queries, but seems like I might get stuck on
> > the alias files.
> >
> > --
> > -Jason J. Horton <jason@???>
> > Fat Man in a Little Coat
> > Intercom Online Inc.
> > 212.376.7440 | http://www.intercom.com
> >
> > --
> > ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim
> details at http://www.exim.org/ ##
> >


-- 
    -Jason J. Horton <jason@???>
     Fat Man in a Little Coat
     Intercom Online Inc. 
     212.376.7440 | http://www.intercom.com