Hi,
It’s long time I think this idea but I don’t know how to make it.
Sometimes happen that I use my email for register to download a software. After a while, I received casually some spam.
Then I think if I have my email for instance user@domain and I can add a custom part to the user part for instance user.mailcow@domain or user.facebook@domain, etc and all this mail arrive to my inbox without set every time a new alias but one generic alias with regex part then I can solve my problem.
Then I can identify how sell/lose my information.

Someone know how to help me?

You can set a catchall alias which will redirect all email that does not match any other aliases or mailboxes. That’s what I do. When creating the alias in Mailcow, just use @domain and it’ll create a catchall.

Have something to say?

Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

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 +).

  1. Create a dummy user to receive catchall mail, e.g. catchall@example.com
  2. As Dan says, create a catchall alias, but direct it to the dummy user account created in #1
  3. 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:

  1. 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.
  2. If you want to reply as one of the addresses, prefix.label@example.com, you need to add an alias.
  3. Set up spam aliases for persistent email getting to catchall that you don’t want.

Hi,
thank you for the replay but it can’t work.

Mar 18 22:48:09 46f3c6646209 postfix/smtpd[394]: NOQUEUE: reject: RCPT from unknown[209.85.166.171]: 550 5.1.1 <prefix_test@domain>: Recipient address rejected: User unknown in virtual mailbox table; from=prefixXX@gmail.com to=<prefix_test@domain> proto=ESMTP helo=<mail-il1-f171.google.com>

  1. I create user catchall@domain
  2. I create alias spam@domain of catchall@domain
  3. I create a filter owner catchall@domain - to:spam@domain - the script you make.

I restart all but don’t work

Hi,

With a catchall alias correctly configured, email for all usernames should be accepted. I think you still need to add the catchall alias:

Mailcow -> Configuration -> Mail Setup -> Alias -> Add Alias:

Alias Address: @domain
Goto Address: catchall@domain

thank you now work

No one is typing