I have a setup using Postfix with a MySQL database to configure domains, accounts and aliases.
I can set up a catch-all address when using a @example.com
mail and forward it to account@example.com
.
Now I want a more advanced catch-all, like user-%@example.com
to forward all to alice@example.com
and prod-%@example.com
forward to bob@example.com
. %
should be any alpha-numeric letter combination like user-1@example.com
or prod-asdf@example.com
.
Is this possible or do I need to change my setup?
Seems feasible enough with slight effort; Postfix supports random user-created aliases via the recipient_delimiter
configuration directive, so you could set recipient_delimiter = -
and create user@example.com
as an alias to alice@example.com
, and user-%@example.com
would resolve first via recipient_delimiter
to user@example.com
, and from there via the alias map to alice@example.com
. (If you already have email addresses containing dashes in your domain, you'll need to choose a different delimiter, or those addresses will stop working.)