On Wed, Aug 5, 2009 at 10:18 AM, Magnus Bäck<mag...@dsek.lth.se> wrote: > On Wednesday, August 05, 2009 at 10:48 CEST, > Yeray Gutiérrez Cedrés <yera...@gmail.com> wrote: > >> I don't know why $virtual_mailbox_maps is listed in >> virtual_mailbox_domains. I've read that $virtual_mailbox_maps is the >> default value for virtual_mailbox_domains, so I think that the >> previous guy thought that if he set virtual_mailbox_domains just to >> hash:/etc/postfix/vmaildomains it would overwrite the default value >> and the virtual_mailbox_maps lookup table wouldn't be in use. However, >> I'm not sure why having virtual_mailbox_domains set is necessary, >> since the virtual(8) delivery agent will use the virtual_mailbox_maps >> lookup table anyway (if this have been set) to verify that the >> recipient address is valid. Am I right? > > Yes, but Postfix must know which domains are virtual mailbox domains, > i.e. which domains should be passed off to virtual(8). It's not > necessarily wrong to list $virtual_mailbox_maps in > virtual_mailbox_domains (it's there by default for backwards > compatibility reasons), but unless you actually list the virtual > mailbox domains in lookup tables specified in $virtual_mailbox_maps > there is no point in listing $v_m_m in v_m_d.
So qmgr(8) checks that the domain is a virtual mailbox domain (performing a lookup in a hash listed in virtual_mailbox_domains) before passing it off to virtual(8). Then, the mail delivery agent virtual(8) performs a lookup in the LDAP server (listed in virtual_mailbox_maps). Is my reasoning right? If it's right and virtual_mailbox_domain is not set, so its default value is virtual_mailbox_maps (wich lists an LDAP database), Postfix would perform twice the same LDAP lookup (one time in qmgr(8) and another time in virtual(8)). I suppose that I'm wrong with that, but I can't see how does this behave. If I were right, that would mean that's much better to list virtual domains in virtual_mailbox_domains with a simple hash than just leaving it to its default value. > > Bottom line -- if all virtual mailbox domains are listed in the > vmaildomains file you can remove $v_m_m from v_m_d to simply your > configuration, avoid confusion, and relieve your LDAP server from > unnecessary lookups. > > The latter is good since qmgr(8) runs in a single thread and is severely > affected by high-latency lookups. It's therefore highly preferable to > have mydestination and the xxx_domains parameters list "simple" lookup > tables like hash, btree, cdb, pcre etc that always have a quick response > time. > > Please do not top-post. > Sorry for that. > -- > Magnus Bäck > mag...@dsek.lth.se >