In my postfix configuration, I'm forwarding (PIPE) all emails to a script. But I also have some virtual mailboxes in dovecot that should be prioritized.
main.cf
...
# Handle mailboxes from database
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_mailbox_maps = mysql:/etc/postfix/virtual-mailbox-maps.cf
virtual_mailbox_base = /var/mail/vhosts
virtual_transport = dovecot
local_transport = virtual
local_recipient_maps = mysql:/etc/postfix/virtual-mailbox-maps.cf
# fallback to mailinglists when users are not database
fallback_transport = ScriptTransporter
...
The fallback should be a catch-all transport for all aliases not in the virtual mailbox, but the received mails will never reach the fallback_transport but will always end in a Recipient address rejected: User unknown in local recipient table
error
EDIT:
The (Symfony) script does check on aliases itself and stores these emails in a database, as these aliases change dynamically, I would like to check them via the script itself rather than using postfix to have more flexibility and control.
Is a configuration like this possible in another way?
Thanks