diff --git a/apps/backend/src/lib/email-queue-step.tsx b/apps/backend/src/lib/email-queue-step.tsx index ae1968f56..61fbd735e 100644 --- a/apps/backend/src/lib/email-queue-step.tsx +++ b/apps/backend/src/lib/email-queue-step.tsx @@ -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;