Add Cloudflare catch-all mail worker

This commit is contained in:
2026-07-22 13:40:09 +08:00
parent 0d98ffaf89
commit 5e993b5961
10 changed files with 1979 additions and 1 deletions
+10 -1
View File
@@ -493,7 +493,16 @@ def extract_verification_code(text, subject=""):
match = re.search(r"^([A-Z0-9]{3}-[A-Z0-9]{3})\s+xAI", subject, re.IGNORECASE)
if match:
return match.group(1)
match = re.search(r"\b([A-Z0-9]{3}-[A-Z0-9]{3})\b", text, re.IGNORECASE)
for source in (subject, text):
match = re.search(
r"(?:confirmation|verification)\s+code\s*[:]\s*([A-Z0-9]{3}-[A-Z0-9]{3})",
source,
re.IGNORECASE,
)
if match:
return match.group(1)
# Keep this case-sensitive: lower-case CSS tokens such as `per-100` are not codes.
match = re.search(r"\b([A-Z0-9]{3}-[A-Z0-9]{3})\b", text)
if match:
return match.group(1)
patterns = [