Rene Bartsch: > Sorry, I had the approach according to the DBMail-Setup-Wiki > running for years, but after changing > machine and distro I didn't got it working again. So I didn't > consider the MySQL-queries but some > kind of configuration error. Maybe you could add an example to > the docs for returning "1" or a > empty set to point out what returning "keys" means.
You don't have to return "1". For Postfix, the lookup either succeeds (the domain is a member of the virtual_mailbox_domains list) or it doesn't. For MySQL lookups, The mysql_table(5) manpage explains how list membership is implemented in the case of MySQL. It makes little sense to repeat MySQL-specific detail with every Postfix feature that might use MySQL. And there are a lot of those features. Wietse MYSQL_TABLE(5) MYSQL_TABLE(5) NAME mysql_table - Postfix MySQL client configuration ... LIST MEMBERSHIP When using SQL to store lists such as $mynetworks, $mydestination, $relay_domains, $local_recipient_maps, etc., it is important to under- stand that the table must store each list member as a separate key. The table lookup verifies the *existence* of the key. See "Postfix lists versus tables" in the DATABASE_README document for a discussion. Do NOT create tables that return the full list of domains in $mydesti- nation or $relay_domains etc., or IP addresses in $mynetworks. DO create tables with each matching item as a key and with an arbitrary value. With SQL databases it is not uncommon to return the key itself or a constant value. ...