Using Regex with Catch-All email alias ??

I am using a Return Address with a variable code embedded.
A general catch-all will catch too much spam

So I want to set up a catch-all which only catches incoming email that begin with
the code. : “M1” up to “M99999”

( must be capital M and must start with M then numbers)

To for example these would be caught and re-directed:,

But these will be rejected: ,,

Can I set up this in VirtualMin - or can I do it by editing the POSTFIX server files directly ?

In my research I found this on a Ubuntu forum:
Regex multiple catch-all setup in postfix

I need to setup a regex catch-all function on postfix such that:
tom.(anything) goes to

Add this to your
alias_maps = regexp:/etc/postfix/aliases

Then create /etc/postfix/aliases

But maybe VirtualMin can do this ???

Any help much appreciated :slight_smile:


Virtualmin does not have a feature to do that directly… You can use Webmin’s Postfix module to semi-manually do what was suggested here. Check out the “Aliases” icon in the main module view.