On 04 May 2020, at 13:08, Robert Nemet <robert.nemet...@gmail.com> wrote: > > virtual_mailbox_domains = > proxy:mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
What is in mysql-virtual-mailbox-domains.cf? > virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf > proxy:mysql:/etc/postfix/mysql-virtual-mailbox-maps2.cf > proxy:mysql:/etc/postfix/mysql-virtual-recipients-alias.cf VMM should only contain the map for the mailboxes (ie username in the database). virtual_alias_maps = proxy:mysql:$config_directory/mysql_virtual_alias_maps.cf hash:$config_directory/virtual virtual_mailbox_domains = proxy:mysql:$config_directory/mysql_virtual_domains_maps.cf virtual_mailbox_maps = proxy:mysql:$config_directory/mysql_virtual_mailbox_maps.cf mysql_virtual_alias_maps.cf user = postfix password = postfix hosts = localhost dbname = postfix table = alias select_field = goto where_field = address mysql_virtual_domains_maps.c user = postfix password = postfix hosts = localhost dbname = postfix query = SELECT domain FROM domain WHERE domain='%u’ mysql_virtual_mailbox_maps.cf user = postfix password = postfix hosts = localhost dbname = postfix table = mailbox select_field = maildir where_field = username Note the differences in these files and where they are used in main.cf )obviously, set you own surname, password, dynamo, and hosts. > postmap -q robert.ne...@virtualdomain.uk > mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf > myvirtualdomain.uk,myvirtualdomain2.uk,myvirtualdomain3.uk That is wrong, a lookup for domain should lookup only the domain and returns only the domain if it exists. # postmap -q kreme.com mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cf kreme.com # postmap -q notkreme.com mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cf # Mailbox maps might return “user” or “u...@domain.tld” depending on your setup. # postmap -q krem...@kreme.com mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf krem...@kreme.com/ # postmap -q krem...@notkreme.com mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf # And alias maps will only return a result if the user@domains maps to an alias to a different user@domain. (So most of the time it should probably return nothing. -- "Are you pondering what I'm pondering?" Yeah, but I thought Madonna already had a steady bloke!”