Re: [exim] domainlist & mysql

Top Pagina
Delete this message
Reply to this message
Auteur: Wakko Warner
Datum:  
Aan: Stephen Gran
CC: exim-users
Onderwerp: Re: [exim] domainlist & mysql
Please keep me in CC.

> > That won't work. When you use <lookup>;query like you're doing, it is only
> > looking for a "yes" or "no" answer (1 or more rows returned = yes, none =
> > no). As long as you have 1 row in Virtusers, it is always true.
>
> That helps a lot, thanks.


You're welcome. Been there, tried that.

> > I sucessfully did this at work using something like this:
> > domainlist doms = ${lookup mysql{select name from domains}{$sg{$value}{ *\\n}{:}}fail}
>
> Just for the record, it was:
> domainlist virt_domains = ${lookup mysql{select distinct domain from Virtusers}{${sg{$value}{ *\\n}{:}}}fail}
> (extra {} - always gets me too :)


I was pulling that off the top of my head. Which is why I said to double
check the syntax.

> > You might want to double check the syntax, I am not looking at the config I
> > used nor the spec. IIRC it does cache this!
>
> It appears to, but only for the first address lookup. In other words,
> I have a list of domains that contain no real users - they all undergo
> alias expansion and are remailed elsewhere to real email addresses (that
> may then be forwarded again for all I know, but I'm just doing this hop).
> When I try an address, say foo@???, it gets looked up in SQL, and
> then later, when a routing decision is made based on +virtual_domains,
> it uses the cached lookup. After alias expansion to bar@??? occurs
> in that redirect router, however, and it is routing the second address,
> exim has to make a new query - the results of the old aren't cached
> any more. Now I have to decide which kind of lookup is less overhead :)
> Since the connection is cached, I am betting multiple single key lookups
> is better than two big ones here.


Which version of exim are you using? I think it also depends on how you use
the domainlist. a few releases ago, IIRC, Nico fixed the caching in the
lookups. I haven't tested it at work to see exactly how it works. Just as
long as it worked. I used MySQL instead of flat files to ease in mail
server administration.

--
Lab tests show that use of micro$oft causes cancer in lab animals