Created
August 23, 2024 01:06
-
-
Save SergioRibera/6a090e5e2dfa607752661e31b7f53898 to your computer and use it in GitHub Desktop.
Just Forward emails LOL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Just Forward LOL | |
export default { | |
async email(message, env, ctx) { | |
if (!env.EMAILS || env.EMAILS.split(";").length == 0) { | |
message.setReject("No mails configured in the `EMAILS` environment variable") | |
return | |
} | |
const allowList = env.EMAILS.split(";") | |
for (const to of allowList) { | |
console.log(`Redirecting to ${to}`) | |
await message.forward(to) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment