configure catch-all alias in postfix using mysql
postfix-mta
Solution
Your `mysql` query should be
SELECT destination FROM virtual_aliases WHERE source='%s'
UNION ALL
SELECT destination FROM virtual_aliases WHERE source='@%d'
AND NOT EXISTS (SELECT destination FROM virtual_aliases WHERE source='%s')
Problem
It seems like my catch-all alias doesn't work. When I use ``` postmap -q test@example.org mysql:/etc/postfix/mysql-virtual-alias-maps.cf ``` There is no output. But when I command ``` postmap -q jack@example.org mysql:/etc/postfix/mysql-virtual-alias-maps.cf ``` the output is ``` john@example.org. ``` How can I fix this? The configure query is: ``` query= SELECT destination FROM virtual_aliases WHERE source='%s' ``` Table virtual_aliases: ``` id domain_id source destination 5 1 @example.org john@example.org 7 1 john@example.org john@example.org 8 1 jack@example.org john@example.org ``` Table virtual_domains: ``` id name 1 example.org ``` Table virtual_users: ``` id domain_id password email 1 1 pwd john@example.org ```