Skip to content

Worker Variables

Note

For CLI deployment syntax, please refer to worker/wrangler.toml.template

Required Variables

Variable NameTypeDescriptionExample
DOMAINSJSONAll domains for temporary email, supports multiple domains["awsl.uk", "dreamhunter2333.xyz"]
JWT_SECRETText/SecretSecret key for generating JWT, used for login and authenticationxxx
ADMIN_PASSWORDSJSONAdmin console passwords, console access disabled if not configured["123", "456"]
ENABLE_USER_CREATE_EMAILText/JSONWhether to allow users to create mailboxes, disabled if not configuredtrue
ENABLE_USER_DELETE_EMAILText/JSONWhether to allow users to delete emails, disabled if not configuredtrue
Variable NameTypeDescriptionExample
PASSWORDSJSONWebsite private passwords, required after configuration["123", "456"]
DISABLE_ADMIN_PASSWORD_CHECKText/JSONWarning: Admin console without password or user checkfalse
Variable NameTypeDescriptionExample
PREFIXTextDefault prefix for new email address names, can be left unconfigured if no prefix neededtmp
MIN_ADDRESS_LENNumberMinimum length of email address name1
MAX_ADDRESS_LENNumberMaximum length of email address name30
DISABLE_CUSTOM_ADDRESS_NAMEText/JSONDisable custom email address names, if set to true, users cannot enter custom names and they will be auto-generatedtrue
ADDRESS_CHECK_REGEXTextRegular expression for email address name, used for validation only^(?!.*admin).*
ADDRESS_REGEXTextRegular expression to replace illegal symbols in email address name, symbols not in the regex will be replaced. Default is [^a-z0-9] if not set. Use with caution as some symbols may prevent email reception[^a-z0-9]
DEFAULT_DOMAINSJSONDefault domains available to users (not logged in or users without assigned roles)["awsl.uk", "dreamhunter2333.xyz"]
CREATE_ADDRESS_DEFAULT_DOMAIN_FIRSTText/JSONWhether to prioritize default domain when creating new addresses, if set to true, will use the first domain when no domain is specified, mainly for telegram bot scenariosfalse
DOMAIN_LABELSJSONFor Chinese domains, you can use DOMAIN_LABELS to display Chinese names["中文.awsl.uk", "dreamhunter2333.xyz"]
ENABLE_AUTO_REPLYText/JSONAllow automatic email repliestrue
DEFAULT_SEND_BALANCEText/JSONDefault email sending balance, will be 0 if not set1
ENABLE_ADDRESS_PASSWORDText/JSONEnable address password feature, when enabled, passwords will be auto-generated for new addresses, supports password login and modificationtrue
Variable NameTypeDescriptionExample
BLACK_LISTTextBlacklist for filtering senders, comma separatedgov.cn,edu.cn
ENABLE_CHECK_JUNK_MAILText/JSONWhether to enable junk mail checking, used with the following two listsfalse
JUNK_MAIL_CHECK_LISTJSONJunk mail check configuration, marked as junk if any item exists and fails["spf", "dkim", "dmarc"]
JUNK_MAIL_FORCE_PASS_LISTJSONJunk mail check configuration, marked as junk if any item does not exist or fails["spf", "dkim", "dmarc"]
FORWARD_ADDRESS_LISTJSONGlobal forward address list, disabled if not configured, all emails will be forwarded to listed addresses when enabled["[email protected]"]
REMOVE_EXCEED_SIZE_ATTACHMENTText/JSONIf attachment exceeds 2MB, remove it, email may lose some information due to parsingtrue
REMOVE_ALL_ATTACHMENTText/JSONRemove all attachments, email may lose some information due to parsingtrue

NOTE

Junk mail checking and attachment removal require email parsing, free tier CPU is limited, may cause large email parsing timeout

If you want stronger email parsing capabilities

Refer to Configure worker to use wasm for email parsing

Variable NameTypeDescriptionExample
ENABLE_WEBHOOKText/JSONWhether to enable webhooktrue
FRONTEND_URLTextFrontend URL, used for sending webhook email URLshttps://xxxx.xxx

NOTE

Webhook functionality requires email parsing, free tier CPU is limited, may cause large email parsing timeout

If you want stronger email parsing capabilities

Refer to Configure worker to use wasm for email parsing

Variable NameTypeDescriptionExample
USER_DEFAULT_ROLETextDefault role for new users, only effective when email verification is enabledvip
ADMIN_USER_ROLETextAdmin role configuration, if user role equals ADMIN_USER_ROLE, user can access admin consoleadmin
USER_ROLESJSON-See below
DISABLE_ANONYMOUS_USER_CREATE_EMAILText/JSONDisable anonymous user mailbox creation, if set to true, users can only create addresses after logintrue
NO_LIMIT_SEND_ROLETextRoles that can send unlimited emails, multiple roles separated by comma vip,adminvip

USER_ROLES User Role Configuration

  • If domains is empty, DEFAULT_DOMAINS will be used
  • If prefix is null, the default prefix will be used, if prefix is an empty string, no prefix will be used

When deploying through UI, configure USER_ROLES in this format: [{"domains":["awsl.uk","dreamhunter2333.xyz"],"role":"vip","prefix":"vip"},{"domains":["awsl.uk","dreamhunter2333.xyz"],"role":"admin","prefix":""}]

When deploying via CLI, refer to worker/wrangler.toml.template and configure USER_ROLES in this format: [{ domains = ["awsl.uk", "dreamhunter2333.xyz"], role = "vip", prefix = "vip" }, { domains = ["awsl.uk", "dreamhunter2333.xyz"], role = "admin", prefix = "" }]

Variable NameTypeDescriptionExample
DEFAULT_LANGTextWorker error message default language, zh/enzh
TITLETextCustom frontend page website title, supports htmlCustom Title
ANNOUNCEMENTTextCustom frontend page announcement, supports htmlCustom Announcement
ALWAYS_SHOW_ANNOUNCEMENTText/JSONWhether to always show announcement (even if unchanged), default falsetrue
COPYRIGHTTextCustom frontend footer text, supports htmlDream Hunter
ADMIN_CONTACTTextAdmin contact information, can be any string, hidden if not configured[email protected]
DISABLE_SHOW_GITHUBText/JSONWhether to show GitHub linktrue
CF_TURNSTILE_SITE_KEYText/SecretTurnstile CAPTCHA configurationxxx
CF_TURNSTILE_SECRET_KEYText/SecretTurnstile CAPTCHA configurationxxx
Variable NameTypeDescriptionExample
TG_MAX_ADDRESSNumberMaximum number of mailboxes that can be bound to telegram bot5
TG_BOT_INFOTextOptional, telegram BOT_INFO, predefined BOT_INFO can reduce webhook latency{}

NOTE

Telegram functionality requires email parsing, free tier CPU is limited, may cause large email parsing timeout

If you want stronger email parsing capabilities

Refer to Configure worker to use wasm for email parsing

Other Variables

Variable NameTypeDescriptionExample
ENABLE_ANOTHER_WORKERText/JSONWhether to enable other workers to process emailsfalse
ANOTHER_WORKER_LISTJSON- Configuration for other workers to process emails, multiple workers can be configured
- Filter by keywords, call the bound worker's method (default method name is rpcEmail)
- keywords are required, otherwise the worker will not be triggered
See below

NOTE

ANOTHER_WORKER_LIST configuration example

toml
#ANOTHER_WORKER_LIST ="""
#[
#    {
#        "binding":"AUTH_INBOX",
#        "method":"rpcEmail",
#        "keywords":[
#            "验证码","激活码","激活链接","确认链接","验证邮箱","确认邮件","账号激活","邮件验证","账户确认","安全码","认证码","安全验证","登陆码","确认码","启用账户","激活账户","账号验证","注册确认",
#            "account","activation","verify","verification","activate","confirmation","email","code","validate","registration","login","code","expire","confirm"
#        ]
#    }
#]
#

Based on MIT license