"A table that is expected to return a result for a query with a lookup key of each of the *domain names* (the result is ignored, the *existence* of the key is what counts)."e
Yes, OK, I checked the manual: ""type:table <http://www.postfix.org/DATABASE_README.html>" lookup table is matched when a name matches a lookup key (the lookup result is ignored)." But doesn't this mean that if there is a return, it should pass, if there isn't, it shouldn't? So even if I list all the domains, it should be working? Anyway, I changed the query, and now it just returns '1', but it still doesn't work. "That's not the right lookup key, and an irrelevant result." So what is the problem with this?: mysql-virtual-domain.cf: ... query = SELECT 1 FROM domain WHERE name='%d' postmap query: postmap -q robert.ne...@virtualdomain.uk mysql:/etc/postfix/ mysql-virtual-mailbox-domains.cf 1 postmap -q robert.ne...@anyotherdomain.uk mysql:/etc/postfix/ mysql-virtual-mailbox-domains.cf <no result - no output> " But frankly, I don't recommend using an SQL table for the virtual domains unless you're going to be hosting a much larger (dynamic) population of these than just three." There are 58 domains in the table on production, and it will be more. I wouldn't bother using SQL if it was just a couple of domains and new ones were added once in every year :) On Mon, May 4, 2020 at 8:18 PM Viktor Dukhovni <postfix-us...@dukhovni.org> wrote: > On Mon, May 04, 2020 at 08:08:25PM +0100, Robert Nemet wrote: > > > main.cf > > > > *** version one, working configuration *** > > > > virtual_mailbox_domains = myvirtualdomain.uk,myvirtualdomain2.uk, > myvirtualdomain3.uk > > A list of *domain names*. > > > *** version two *** > > > > virtual_mailbox_domains = proxy:mysql:/etc/postfix/ > mysql-virtual-mailbox-domains.cf > > [...] > > Mail is rejected: > > A table that is expected to return a result for a query with a lookup > key of each of the *domain names* (the result is ignored, the > *existence* of the key is what counts). > > > If I query the table with postmap, I get the same result as the working > > config: > > > > postmap -q robert.ne...@virtualdomain.uk mysql:/etc/postfix/ > mysql-virtual-mailbox-domains.cf > > myvirtualdomain.uk,myvirtualdomain2.uk,myvirtualdomain3.uk > > That's not the right lookup key, and an irrelevant result. > > > Could anybody tell me what can be the problem? > > The table does not hold the domains as lookup keys. But frankly, I > don't recommend using an SQL table for the virtual domains unless you're > going to be hosting a much larger (dynamic) population of these than > just three. > > -- > Viktor. >