On Sun, 2010-11-21 at 17:13 -0500, Victor Duchovni wrote: > On Sun, Nov 21, 2010 at 04:50:21PM -0500, Jerrale G wrote: > > > On 11/21/2010 4:40 PM, Andrew Beverley wrote: > >> Hi, > >> > >> I have noticed that my Postfix (version 2.3.8) is performing a > >> virtual_alias_maps mysql database query for every email that it is > >> processing, even if the domain is not listed in virtual_alias_domains. > > This is correct behaviour. The rewriting performed by virtual(5) is > documented and intended to apply to *all* addresses.
Is that all addresses including outbound SMTP? Or can I avoid it when the final destination is external to the server? > If you have an SQL or LDAP table that stores data for only a specific > set of domains, you can use the "domain = ..." attribute of LDAP, or > SQL tables to specify which domains the table applies to, and queries > for unrelated domains will be skipped. Thanks, I did have that originally (pointing to /etc/postfix/virtual-domains). The problem is that I am trying to move my virtual_alias_domains list to a SQL query as well (from the virtual-domains file that it currently is). > Note, that the above applies also to "bare" domain queries, so tables > with "domain =" constraints cannot be used to store the list of > virtual_alias_domains, virtual_mailbox_domains, ... Not a problem, > since after hardcoding the candidate domains in the table definition, > there is really no point in using a database at all, just list the > domains in main.cf. I would like to move the list of virtual domains to a SQL table, as opposed to being hard-coded anywhere. Most of my email is outbound, so if I can avoid database lookups for all outbound mail then that would be preferable. Thanks, Andy