Processing pipeline
Four scheduled jobs run against every tenant and every enabled data source. They run independently; a failure in one does not block the next. Execution order on a shared schedule tick is incoming -> failed -> geolocation -> alerts.
Pipeline
A report that lands in failed stays there until the failed-queue job retries it on its own schedule, with no exponential backoff: each run is one attempt per message.
The four jobs
- Incoming queue (
SCHEDULE_INCOMING_QUEUE, default every 12 hours). Fetches unread email from each enabled data source, runs the pipeline above, moves the message into one of the three outcome folders, and writes ajob_runsrow with per-source counts. - Failed queue (
SCHEDULE_FAILED_QUEUE, default every 12 hours). Reprocesses whatever is sitting in thefailedfolder. No retry wrapper: one attempt per message per run. Success promotes toprocessed; continued failure leaves the message in place for manual inspection. - Geolocation (runs after each incoming-queue batch when
IP2LOCATION_DB_PATHis set). Enriches source IPs on parsed DMARC records in batches of 1000 with country, region, city, and coordinates from the IP2Location LITE DB11 file. UnsetIP2LOCATION_DB_PATHdisables the job entirely. - Alerts generation. Evaluates the configured rules per tenant (or the three legacy detectors when no rules are defined), writes new alerts to
alerts_sent, and dispatches each to every enabled channel. SMTP is the only channel wired today.
Weekly report (optional)
WEEKLY_REPORT_ENABLED=true adds a fifth job on SCHEDULE_WEEKLY_REPORT (default Mondays at 08:00) that emails a per-tenant seven-day summary.