On Mon, Oct 27, 2014 at 02:42:38PM +0100, Gabor Lenart wrote: > On Mon, Oct 27, 2014 at 08:13:10AM -0500, Chad M Stewart wrote: > > query_filter = (&(ObjectClass=dNSDomain)(dc=%2)) > [...] > > [root@mta03 /opt/local/etc/postfix]# postmap -v -q balius > > ldap:/opt/local/etc/postfix/ldap_virtual_mailbox_domains.cf > > I guess, since you used %2 in the query_filter, it will be the second > component from the right, > eg for "balius.com" %1 is com, and %2 is balius. Thus, to test this, you may > need the postmap > with -q balius.com instead of just balius (what you did). If you query just > balius, it will be > %1 (and not %2, what you use in your query_filter). > > But I can be wrong here.
Quite right, but there is a further restriction: %[1-9] The patterns %1, %2, ... %9 are replaced by the corre- sponding most significant component of the input key's domain. If the input key is u...@mail.example.com, then %1 is com, %2 is example and %3 is mail. If the input key is unqualified or does not have enough domain components to satisfy all the specified patterns, the search is sup- pressed and returns no results. The "%[1-9]" substitution only apply to input keys that are full addresses "user@domain". This avoids false matches on components of localparts: joe....@example.org If example.org is either $myorigin or listed in $mydestination, Postfix will issue address lookup queries for "joe.net", whose name should not be treated as a domain. -- Viktor.