email worker doing the opposite

export default { async email(message, env, ctx) { if (message.headers.get("from").includes("Mark Mateschitz")) { await message.forward("<me>"); } else { message.setReject("Rejected. Sending to this inbox has been banned by your email"); } } }

Sent an email from my test account that doesn't include Mark Mateschitz in the from header but it still rejects.
Was this page helpful?