mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-06 07:57:04 +08:00
feat: add ENABLE_ATTACHMENT config (#99)
This commit is contained in:
@@ -137,6 +137,8 @@ PREFIX = "tmp" # 要处理的邮箱名称前缀
|
|||||||
DOMAINS = ["xxx.xxx1" , "xxx.xxx2"] # 你的域名
|
DOMAINS = ["xxx.xxx1" , "xxx.xxx2"] # 你的域名
|
||||||
JWT_SECRET = "xxx" # 用于生成 jwt 的密钥
|
JWT_SECRET = "xxx" # 用于生成 jwt 的密钥
|
||||||
BLACK_LIST = "" # 黑名单,用于过滤发件人,逗号分隔
|
BLACK_LIST = "" # 黑名单,用于过滤发件人,逗号分隔
|
||||||
|
# 免费版附件过大会造成 Exceeded CPU Limit 错误,如果不需要附件功能,可以关闭
|
||||||
|
ENABLE_ATTACHMENT = true
|
||||||
|
|
||||||
[[d1_databases]]
|
[[d1_databases]]
|
||||||
binding = "DB"
|
binding = "DB"
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ pnpm install
|
|||||||
# DOMAINS = ["xxx.xxx1" , "xxx.xxx2"] you domain name
|
# DOMAINS = ["xxx.xxx1" , "xxx.xxx2"] you domain name
|
||||||
# JWT_SECRET = "xxx"
|
# JWT_SECRET = "xxx"
|
||||||
# BLACK_LIST = ""
|
# BLACK_LIST = ""
|
||||||
|
# free version attachment too large will cause Exceeded CPU Limit error, if you don't need attachment function, you can close
|
||||||
|
# ENABLE_ATTACHMENT = true
|
||||||
cp wrangler.toml.template wrangler.toml
|
cp wrangler.toml.template wrangler.toml
|
||||||
# deploy
|
# deploy
|
||||||
pnpm run deploy
|
pnpm run deploy
|
||||||
|
|||||||
+2
-1
@@ -82,7 +82,8 @@ async function email(message, env, ctx) {
|
|||||||
// process attachments
|
// process attachments
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
parsedEmail.attachments
|
env.ENABLE_ATTACHMENT
|
||||||
|
&& parsedEmail.attachments
|
||||||
&& parsedEmail.attachments.length > 0
|
&& parsedEmail.attachments.length > 0
|
||||||
) {
|
) {
|
||||||
const { success } = await env.DB.prepare(
|
const { success } = await env.DB.prepare(
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ PREFIX = "tmp"
|
|||||||
DOMAINS = ["xxx.xxx1" , "xxx.xxx2"]
|
DOMAINS = ["xxx.xxx1" , "xxx.xxx2"]
|
||||||
JWT_SECRET = "xxx"
|
JWT_SECRET = "xxx"
|
||||||
BLACK_LIST = ""
|
BLACK_LIST = ""
|
||||||
|
# IF YOU WANT DISABLE ATTACHMENT, SET IT TO false or COMMENT IT
|
||||||
|
ENABLE_ATTACHMENT = true
|
||||||
|
|
||||||
[[d1_databases]]
|
[[d1_databases]]
|
||||||
binding = "DB"
|
binding = "DB"
|
||||||
|
|||||||
Reference in New Issue
Block a user