>>> This causes a bounce instead of reject. Do I have to add a clause for
>>> this to my query? I start to feel like I'm doing things Postfix > should >>> be doing. There must be a more simple way to do this? >> >> postfixadmin have domain-alias support fits 100% to subject, makes sense >> if dns data is templated same way >> > > Probably the best lesson to learn from postfixadmin is: you can have > more than one lookup table in postfix per main.cf directive. > Postfixadmin uses 2 separate queries for "regular" aliases and domain > aliases. > > from main.cf: > virtual_alias_maps = /etc/postfix/mysql_virtual_alias_maps.cf > /etc/postfix/virtual_alias_domain_maps.cf > > where each file contains a simple db query. Makes it much easier to > write the correct query, on the expense of some more db load. Thanks Tom for making it more clear. However, if you split to two queries, you still need a complex query for the mapped domain. In my example, still like: query = select if ('%d' = 'example-2.com', IFNULL((select dest from aliases where addr = '%u...@example.com'), (select addr from users where addr = '%u...@example.com')), NULL) I've found that in conjunction with a 2nd query (the original normal one), everything seems to work as expected (including aliases with only local parts like "postmaster") But I'm still unsure if this kind of query is correct, if I'm on the right track. Can anyone tell me if there's a better way to do it? Where are all those examples that are supposedly posted on this list previously?