Some postconf -n options in which the empty option is virtual_alias__domains which should be, in most cases empty if we don’t want to specifically create a domain in which there will be only virtual aliases. And if we just want to add an alias for domains in which we already have virtual users, we need to specify them only in virtual_mailbox_domains , and they should not be repeated in mydestination and virtual_alias_domains .
compatibility_level = 2 stress = yes biff = no disable_vrfy_command = yes strict_rfc821_envelopes = yes smtputf8_autodetect_classes = bounce myhostname = example.ua mydomain = $myhostname mydestination = localhost.$mydomain, localhost inet_interfaces = all inet_protocols = ipv4 smtpd_recipient_restrictions = permit_inet_interfaces, permit_sasl_authenticated, reject_unauth_destination, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unknown_helo_hostname, reject_unknown_client_hostname, reject_rbl_client zen.spamhaus.org smtpd_relay_restrictions = permit_inet_interfaces, permit_sasl_authenticated, reject_unauth_destination smtpd_data_restrictions = reject_unauth_pipelining, reject_multi_recipient_bounce smtpd_etrn_restrictions = reject smtp_use_tls = yes smtp_enforce_tls = yes smtp_tls_security_level = encrypt smtp_helo_timeout = 10s smtp_rcpt_timeout = 10s smtp_tls_CAfile = /etc/ssl/ca-bundle.pem smtp_tls_CApath = /etc/ssl/certs smtp_tls_cert_file = /etc/apache2/ssl.crt/example.ua.crt smtp_tls_key_file = /etc/apache2/ssl.key/example.ua.key smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_scache smtp_tls_session_cache_timeout = 1d smtpd_use_tls = yes smtpd_enforce_tls = yes smtpd_helo_required = yes smtpd_tls_auth_only = yes smtpd_tls_security_level = encrypt smtpd_recipient_limit = 100 smtpd_reject_unlisted_recipient = yes smtpd_reject_unlisted_sender = yes smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_path = private/auth smtpd_sasl_type = dovecot smtpd_tls_CAfile = /etc/ssl/ca-bundle.pem smtpd_tls_CApath = /etc/ssl/certs smtpd_tls_cert_file = /etc/apache2/ssl.crt/example.ua.crt smtpd_tls_key_file = /etc/apache2/ssl.key/example.ua.key smtpd_tls_received_header = yes smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_scache smtpd_tls_session_cache_timeout = 1d virtual_alias_domains = virtual_alias_maps = hash:/etc/postfix/virtual virtual_mailbox_domains = $myhostname, subdomain.$myhostname virtual_mailbox_base = /srv/vmail virtual_mailbox_lock = fcntl virtual_minimum_uid = 303 virtual_uid_maps = static:303 virtual_gid_maps = static:303 virtual_transport = lmtp:unix:private/dovecot-lmtp reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unknown_helo_hostname, reject_unknown_client_hostname, reject_rbl_client zen.spamhaus.org compatibility_level = 2 stress = yes biff = no disable_vrfy_command = yes strict_rfc821_envelopes = yes smtputf8_autodetect_classes = bounce myhostname = example.ua mydomain = $myhostname mydestination = localhost.$mydomain, localhost inet_interfaces = all inet_protocols = ipv4 smtpd_recipient_restrictions = permit_inet_interfaces, permit_sasl_authenticated, reject_unauth_destination, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unknown_helo_hostname, reject_unknown_client_hostname, reject_rbl_client zen.spamhaus.org smtpd_relay_restrictions = permit_inet_interfaces, permit_sasl_authenticated, reject_unauth_destination smtpd_data_restrictions = reject_unauth_pipelining, reject_multi_recipient_bounce smtpd_etrn_restrictions = reject smtp_use_tls = yes smtp_enforce_tls = yes smtp_tls_security_level = encrypt smtp_helo_timeout = 10s smtp_rcpt_timeout = 10s smtp_tls_CAfile = /etc/ssl/ca-bundle.pem smtp_tls_CApath = /etc/ssl/certs smtp_tls_cert_file = /etc/apache2/ssl.crt/example.ua.crt smtp_tls_key_file = /etc/apache2/ssl.key/example.ua.key smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_scache smtp_tls_session_cache_timeout = 1d smtpd_use_tls = yes smtpd_enforce_tls = yes smtpd_helo_required = yes smtpd_tls_auth_only = yes smtpd_tls_security_level = encrypt smtpd_recipient_limit = 100 smtpd_reject_unlisted_recipient = yes smtpd_reject_unlisted_sender = yes smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_path = private/auth smtpd_sasl_type = dovecot smtpd_tls_CAfile = /etc/ssl/ca-bundle.pem smtpd_tls_CApath = /etc/ssl/certs smtpd_tls_cert_file = /etc/apache2/ssl.crt/example.ua.crt smtpd_tls_key_file = /etc/apache2/ssl.key/example.ua.key smtpd_tls_received_header = yes smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_scache smtpd_tls_session_cache_timeout = 1d virtual_alias_domains = virtual_alias_maps = hash:/etc/postfix/virtual virtual_mailbox_domains = $myhostname, subdomain.$myhostname virtual_mailbox_base = /srv/vmail virtual_mailbox_lock = fcntl virtual_minimum_uid = 303 virtual_uid_maps = static:303 virtual_gid_maps = static:303 virtual_transport = lmtp:unix:private/dovecot-lmtp
/ etc / postfix / virtual
# example.ua postmaster@example.ua user@example.ua abuse@example.ua user@example.ua # subdomain.example.ua postmaster@subdomain.example.ua user@example.ua abuse@subdomain.example.ua user@example.ua
sudo postmap hash: / etc / postfix / virtual
And after that, the mail sent to the addresses postmaster@example.ua , abuse@example.ua , postmaster@subdomain.example.ua , abuse@subdomain.example.ua comes to the virtual user user@example.ua , as intended.
postmap hash:/etc/postfix/virtualinstead ofpostmap /etc/postfix/virtual(the type can not be specified explicitly only if it matches thedefault_database_type). // and then with the same postmap check: postfix.org/VIRTUAL_README.html#local_vs_database - aleksandr barakin