This is a discussion on Re: number of queries in mysql within the mailing.postfix.users forums, part of the Mail Servers and Related category; Gustavo A. Baratto wrote: > > Cami wrote: > >> Gustavo A. Baratto wrote: >> >> man ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Gustavo A. Baratto wrote:
> > Cami wrote: > >> Gustavo A. Baratto wrote: >> >> man 5 mysql_table. Postfix allows freeform queries that should >> resolve your problems (if i'm wrong, someone mention it). >> >> query = SELECT destination FROM alias WHERE alias='%u@%d' > > Still wondering why the %s key is different than %u@%d though... > what I understood from the doc is that: > > %u@%d = %s Someone will have to check me on this one: %s is replaced by the input key. If you do not specify exactly what it is you're after, Postfix will specify multiple keys to lookup, hence why you have multiple queries occurring by default. > And still cant't find out why smtpd lookup the source server as well. > I have these two queries when I receive an e-mail: > > ------- > 299 Query SELECT domain FROM domains WHERE domain='source.domain.org' > 299 Query SELECT domain FROM domains WHERE domain='destination.domain.com' > > Any way eliminating the first query? man 5 mysql_table. Postfix allows you to limit the domains being queried by doing the following: domain = btree:/etc/postfix/relay_domains.txt Since you already have the domains you relay for, postfix can load that. As the man page say, Postfix supports "a list of domain names, paths to files, or dictionaries." Cami |