While the new email routing feature is a great addition, I would like to have email routing support added to Cloudflare Workers.
This would enable more advanced flows that might not be appropriate for a general purpose UI, instead of waiting/hoping for and being limited to the features that Cloudflare creates.
What type of applications would you hope to write in Workers for dealing with email routing?
For one, I would like to be able to block (550 response) certain destination emails (see Feature Request: Add ability to actively block (550 response) by email addresses instead of only silently drop or forward ).
The ability to add/drop/block based on sender/destination/subject regex.
The ability to select forwarding destination based on time.
Custom spam filtering
Amazon SES can use Lambda functions to provide this type of functionality. Invoke Lambda function action - Amazon Simple Email Service , Forward Incoming Email to an External Destination | AWS Messaging & Targeting Blog
These seem like more features for email routing than workers
This requires being able to send emails, which I doubt is a planned feature.
Yes, I want routing/forwarding via a Cloudflare workers (js) for email, not the ability to send emails from Cloudflare workers (for web) – although I could see that being useful as well (within the restrictions noted below)
It doesn’t need to be generic email sending. Sending could be restricted to verified forwarding addresses (and possibly the accounts Cloudflare managed domains for a more general solution).