mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Domain stopgaps
This commit is contained in:
parent
28144334eb
commit
9ba141597b
@ -620,15 +620,18 @@ async function processSingleEmail(context: TenancyProcessingContext, row: EmailO
|
||||
}
|
||||
|
||||
const BLOCKED_PROJECT_ID = "2397ef60-a33e-4efb-ad9b-300da67ee29e";
|
||||
const BLOCKED_DOMAIN = "gsmoal.com";
|
||||
const BLOCKED_DOMAINS = ["gsmoal.com", "virgilian.com"];
|
||||
if (context.tenancy.project.id === BLOCKED_PROJECT_ID) {
|
||||
for (const email of resolution.emails) {
|
||||
const emailDomain = email.split("@")[1]?.toLowerCase();
|
||||
if (emailDomain === BLOCKED_DOMAIN || emailDomain.endsWith(`.${BLOCKED_DOMAIN}`)) {
|
||||
console.warn(`[email-queue] Blocked email to ${email} from project ${BLOCKED_PROJECT_ID} — domain @${BLOCKED_DOMAIN} (or subdomain) is blocked for this project`);
|
||||
const blockedDomain = emailDomain
|
||||
? BLOCKED_DOMAINS.find((domain) => emailDomain === domain || emailDomain.endsWith(`.${domain}`))
|
||||
: undefined;
|
||||
if (blockedDomain) {
|
||||
console.warn(`[email-queue] Blocked email to ${email} from project ${BLOCKED_PROJECT_ID} — domain @${blockedDomain} (or subdomain) is blocked for this project`);
|
||||
await markSkipped(row, EmailOutboxSkippedReason.LIKELY_NOT_DELIVERABLE, {
|
||||
reason: "domain_blocked_for_project",
|
||||
blockedDomain: BLOCKED_DOMAIN,
|
||||
blockedDomain,
|
||||
email,
|
||||
});
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user