Wildcard/RegEx matching with Cloudflare Email routing

Hi,

Is it possible to do wildcard or RegEx matching with Cloudflare email routing?

I understand that wildcard routing is possible with Page Rules, like *domain.com/*$1domain.net/$2

Would be good to have the same ability here too.

Thanks,

8 Likes

Hi,

It’s not currently possible but it’s being considered.
Could you please share more details about your use-case (feel free to DM me if you prefer)?

3 Likes

This would be great. The main use for me would be to alias an entire domain without creating individual per-user forwards - so *@domain1.com > [email protected].

3 Likes

Hi,

Multiple use cases really:

  1. Definitely this:
  1. Redirecting a whole subdomain, like so:
    *@events.domain.com > [email protected]

  2. Change in email address structure/services:
    notification.service.*@domain.com > [email protected]
    So, when users respond to old emails, their emails will be routed appropriately to the new service.

I’ve had clients with the use cases above, would’ve been good to have a simple redirection service like this to resolve that.

Thanks,

2 Likes

I’m also interested in this for the use case of gmail-style addressing ([email protected]). Wildcard is useful because some sites block plus symbols in email addresses, so I use [email protected] with my current provider - this would be awesome to replicate with cloudflare.

3 Likes

+1 for wildcard redirects - has there been any more movement on this one?

The primary reason I desire this to be able to migrate my domain off of qmail.

The problem I have is that many of my users came to rely on .qmail- especially .qmail-default which would enable them to manage mail sent to user- (or user- with default). Regex would enable me to continue to forward their mail correctly with a single rule per user of ‘user(-.*)[email protected]’. I can do this with google workspace email routing, so was hoping I could do this with cloudflare as well.

1 Like

+1

My use case is to register unique addresses on different webshops/platforms (and easily block an address if it is being abused/leaked).

E.g.
[email protected]
[email protected]

With a routing rule of shop.*@example.org[email protected] (or [email protected]mail.com)

I’m aware of the possibility to use the + sign on new registrations, but I already have a lot with a dot registered.

3 Likes

+1

Same use case as above - to easily create unique addresses for different sites without the need to use a catchall address (to further reduce spam).

Happily using Mailway which serves my needs very well for now. Would be glad to port over to Cloudflare as soon as wildcards are supported.

+1

I’ve been using wildcard redirects for years for the reasons listed above. Having this supported by email routing would enable me to make the jump over to Cloudflare.

+1

My use cases are covered above.

Hi @sven2,

Any updates on this?

I’ve got some clients’ domains which have been allowed CF Emails Beta, but couldn’t use them as their use cases are related to wildcard/regex matching.

Thanks

1 Like

I also have similar use cases here. My mail platform was originally qmail as well, and I modified postfix’s configuration to use the same setup I had in qmail with tagged addresses. I wouldn’t need to run a custom MX anymore if Cloudflare supported the wildcard ability.

Thanks for your consideration!

Have you tried the catch-all option? its where all none defined emails goes to…

So call [email protected]

Yes, but the point of this topic is to support regex matching without catch-all :slight_smile:
This makes fine-grained routing possible, without allowing ALL mail (and potentially receive a lot more spam) with a catch-all.

So… are we any closer to a solution or do we just look elsewhere?

You can get examples in Routes — Mailgun API documentation, e.g.

.*@bar.com
foo(.*)[email protected]
^foo(.*)@bar.com
^(privacy|foo(.*))@bar.com

i would really appreciate this feature as well.

specifically, i would like to:

foo*@example1.com -> [email protected]

I’m also interested by this feature, hopefully, it will be considered

Please add this wildcard feature for emails, so I can migrate from NameCheap to Cloudflare and have all the benefits in one place.