Hi, ilsaul, I have worked in the way you suggest since my first self-hosted mail server in 1995. Being able to do what you want was one of my key requirements before switching to the Mailcow. I’ve had it set up working really well in Mailcow for over a year. I use an extension of Dan’s suggestion, like this:
Share email addresses with third parties using the format prefix.label@example.com, where label is different for different ‘suppliers’, e.g. Mailcow, facebook, etc. and prefix is ‘user’ or some other unique string the user want’s to use (actually, I allow any of . or - or _ as the separator; don’t use +).
- Create a dummy user to receive catchall mail, e.g. catchall@example.com
- As Dan says, create a catchall alias, but direct it to the dummy user account created in #1
- In Mailcow admin -> Configuration -> Mail Setup -> Filters, add a pre-filter (owner = catchall@example.com), like this.
require "regex";
if anyof ( address :regex ["to", "cc"] "^prefix[._-]") {
redirect "user@example.com";
}
Once you get started with this, you can be even more imaginative with your filter.
If you implement this, you should also consider the following:
- This does not work with the user in BCC, so check the catchall mailbox from time to time. Add an alias if important email is sent to bcc. There might be a way of improving the filter to handle bcc, but I never got round to making that work.
- If you want to reply as one of the addresses, prefix.label@example.com, you need to add an alias.
- Set up spam aliases for persistent email getting to catchall that you don’t want.