Email Routing: set Delivered-To header to original incoming address

Started using Email Routing and noticed there is no header set by Cloudflare that indicates the actual incoming address to the domain. This is important with catchall forwarding.

Could Cloudflare add a header Delivered-To: to indicate what actual address the email was for at the MX?

It’s in the received header. Why is it important for the catchall? Just for debugging?

1 Like

Received: is not a great header, a lot of noise to parse. It is important for clients to have a reliable way to know what address the email arrived at. E.g. with catchall domains you may have smart email clients/addons that know how to reply from the address that the email arrived at. Something like this addon that unfortunately no longer works in recent Thunderbird versions: Virtual Identity
Or to do custom filtering using procmail, maildrop, sieve, etc.

Delivered-To: seems to be fairly standard, though I’ve seen Original-To: before or Cloudflare could have its own header similar to the http proxy, e.g. CF-Forwarded-For:

Not sure what the best approach is but it should be something fairly standard that tools/clients already understand.

It appears that Gmail filters understand Delivered-To: which will probably settle what the header should be as I suspect many of your customers will forward to Gmail and would want reliable filters/labeling.

Yeah the Received: headers are terrible because there are so many of them and have lots of noise.

More importantly, Gmail doesn’t support filtering by arbitrary headers. There’s only one possibility that I can think of: the deliveredto: operator, as @cf1337 mentioned.

Not having an easy way to forward all the catchall emails to Gmail and then use Gmail’s filter rules easily is pretty much a showstopper for me. My only alternative is to keep using postfix on my VPS.