David Reagan: > Thanks. Switching the query to the default '%s' and making sure I didn't > have 'result_format' set fixed it. The postmap query works. > > Is the fact that %d won't work in this context documented anywhere? I > didn't see anything in http://www.postfix.org/pgsql_table.5.html or any > of the other docs I was reading.
The query is a domain NOT AN EMAIL ADDRESS: http://www.postfix.org/postconf.5.html#virtual_mailbox_domains Quote: This parameter expects the same syntax as the mydestination configuration parameter. The %d requires AN EMAIL ADDRESS: http://www.postfix.org/pgsql_table.5.html Quote: When the input key is an address of the form user@domain, %d is replaced by the SQL quoted domain part of the address. Otherwise, the query is suppressed and returns no results. wietse > - David > > On 8/8/20 7:48 PM, Viktor Dukhovni wrote: > > On Sat, Aug 08, 2020 at 06:42:16PM -0700, David Reagan wrote: > > > >> By key you mean use 'raygun.zat' instead of 'k...@raygun.zat'? > > The former is the lookup key that Postfix asks the lookup table to find. > > > >> Also, if you look at the query, I use '%d'. So, unless I'm > >> misunderstanding the docs, postfix will replace that with 'raygun.zat' > >> even if it gets 'k...@raygun.zat'. > > That's your mistake. You can ONLY use %d with tables whose lookup keys > > are email addresses (localpart@domain). When the lookup key is already > > just the domain, the %d expansion will not find any domain, and will > > skip the lookup. > > > > You're confused about the layering. The table driver interprets %d, > > but the virtual_mailbox_domains feature uses domain-only keys. > > >