This is a completely unserious prototype implementing this tweet:
This repo uses Cloudflare Email Workers to implement a simple greylisting system for your email.
- New person emails you
- They get a reply with a simple math question
- If they answer correctly:
- Their email gets delivered
- They're whitelisted for future emails
- If they don't answer or get it wrong, the email stays blocked
No. Please don't use this.
Also it's beyond me why Email Workers doesn't support forwarding emails with an SRS sender.
-
Create two KV namespaces in Cloudflare:
CHALLENGE_STORE
: For pending challengesWHITELIST_STORE
: For approved senders
-
Edit these constants in the code:
const SENTINEL_EMAIL = '[email protected]';
const TARGET_EMAIL = '[email protected]';
const WORKER_ROUTE = 'your-worker.workers.dev';
- Deploy to Cloudflare Workers with Email Workers enabled and your KV namespaces bound
That's it! New senders will now need to solve a math problem to reach you.