Email routing rejected by Postfix due to address rewrite

I recently got access to the Email Routing Beta and tried it out.

Unfortunately my Postfix server is rejecting relayed messages due to the addresses being rewritten, as others have mentioned here “name=sender.tld(at)mydomain.tld”.

NOQUEUE: reject: RCPT from a2-74.email.cloudflare.net[104.30.2.74]: 550 5.1.0 <name=sender.tld(at)mydomain>: Sender address rejected: User unknown in virtual mailbox table; from=<name=sender.tld(at)mydomain> to=<myrecipientaddress> proto=ESMTP helo=<a2-74.email.cloudflare.net>

Is this something one needs to configure in Postfix? Obviously I can’t create a mailbox for every possible email address…

Thanks for the report. This is a common issue. Do you know if there’s a way to tell Postfix not to try to lookup the sender address locally?

In your Postfix config is Postfix Configuration Parameters set?

Sorry I just now got to check it. This setting is indeed enabled and I think it makes sense.

This is my relevant config line:

smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch,
  permit_mynetworks,
  permit_sasl_authenticated,
  reject_unlisted_sender,
  reject_unknown_sender_domain

I am still quite confused why Cloudflare is rewriting the sender address. I switched to Gandi’s email forwarding service which works fine without having to allow this, as they do not change the email addresses in the message.

I am not sure if this is the real reason, but I believe it is to avoid problems with SPF rules.

If Cloudflare redirects while keeping the FROM, for example from a Sender @gmail, the server that receives the redirect may reject Cloudflare message, because it is not listed in the SPF of gmail.com.

I avoid this problem with the catch-all rule.

Do you mean CloudFlare doesn’t re-write the sender for the catch-all?

First of all, Cloud Flare rewrites the sender, that’s not what I said.

One of the reasons I use catch-all is to avoid problems when the server lookup the sender address locally.

English is not my native language*