wawa
wawa
Explore posts from servers
CDCloudflare Developers
Created by wawa on 1/24/2024 in #workers-help
email not being blocked
Thanks ill take a look at those
27 replies
CDCloudflare Developers
Created by wawa on 1/24/2024 in #workers-help
email not being blocked
I managed to figure it out by doing this
export default {
async email(message, env, ctx) {
const senderAddress = message.headers.get('from');

console.log(senderAddress);

if (!senderAddress.includes('[email protected]')) {
console.log("done");
await message.forward("[email protected]");
console.log("done yes");
} else {
console.log("blocked");
message.setReject("Address is blocked");
console.log("blocked yes");
}
}
}
export default {
async email(message, env, ctx) {
const senderAddress = message.headers.get('from');

console.log(senderAddress);

if (!senderAddress.includes('[email protected]')) {
console.log("done");
await message.forward("[email protected]");
console.log("done yes");
} else {
console.log("blocked");
message.setReject("Address is blocked");
console.log("blocked yes");
}
}
}
27 replies
CDCloudflare Developers
Created by wawa on 1/24/2024 in #workers-help
email not being blocked
alright thanks ill try that
27 replies
CDCloudflare Developers
Created by wawa on 1/24/2024 in #workers-help
email not being blocked
{
"outcome": "ok",
"scriptName": "testemailworker",
"diagnosticsChannelEvents": [],
"exceptions": [],
"logs": [
{
"message": [
],
"level": "log",
"timestamp": 1706130511913
},
{
"message": [
"done"
],
"level": "log",
"timestamp": 1706130511913
},
{
"message": [
"done yes"
],
"level": "log",
"timestamp": 1706130515533
}
],
"eventTimestamp": 1706130511896,
"event": {
"rawSize": 6012,
"rcptTo": "[email protected]",
"mailFrom": "[email protected]"
},
"id": 0
}
{
"outcome": "ok",
"scriptName": "testemailworker",
"diagnosticsChannelEvents": [],
"exceptions": [],
"logs": [
{
"message": [
],
"level": "log",
"timestamp": 1706130511913
},
{
"message": [
"done"
],
"level": "log",
"timestamp": 1706130511913
},
{
"message": [
"done yes"
],
"level": "log",
"timestamp": 1706130515533
}
],
"eventTimestamp": 1706130511896,
"event": {
"rawSize": 6012,
"rcptTo": "[email protected]",
"mailFrom": "[email protected]"
},
"id": 0
}
27 replies
CDCloudflare Developers
Created by wawa on 1/24/2024 in #workers-help
email not being blocked
No description
27 replies
CDCloudflare Developers
Created by wawa on 1/24/2024 in #workers-help
email not being blocked
dashboard, I just see "ok" in the console
27 replies
CDCloudflare Developers
Created by wawa on 1/24/2024 in #workers-help
email not being blocked
yesd
27 replies
CDCloudflare Developers
Created by wawa on 1/24/2024 in #workers-help
email not being blocked
yes
27 replies
CDCloudflare Developers
Created by wawa on 1/24/2024 in #workers-help
email not being blocked
console.logs arent being printed out
27 replies
CDCloudflare Developers
Created by wawa on 1/24/2024 in #workers-help
email not being blocked
export default {
async email(message, env, ctx) {
if (!message.headers.get('from').endsWith('[email protected]')) {
console.log("done")
await message.forward("[email protected]");
console.log("done yes")
} else {
console.log("blocked")
message.setReject("Address is blocked");
console.log("blocked yes")
}
}
}
export default {
async email(message, env, ctx) {
if (!message.headers.get('from').endsWith('[email protected]')) {
console.log("done")
await message.forward("[email protected]");
console.log("done yes")
} else {
console.log("blocked")
message.setReject("Address is blocked");
console.log("blocked yes")
}
}
}
27 replies
CDCloudflare Developers
Created by wawa on 1/24/2024 in #workers-help
email not being blocked
Hm, that still goes through to my email
27 replies
CDCloudflare Developers
Created by wawa on 1/24/2024 in #workers-help
email not being blocked
ty ill try that
27 replies
CDCloudflare Developers
Created by wawa on 1/24/2024 in #workers-help
email not being blocked
how would I get the email then
27 replies
CDCloudflare Developers
Created by wawa on 1/24/2024 in #workers-help
email not being blocked
oh
27 replies