Phased Deployment Guide¶
tobira is designed for zero-downtime integration with your existing mail infrastructure. This guide describes a phased rollout strategy.
Overview¶
Phase A: MTA standard filters (immediate)
↓
Phase B: ML model training (parallel)
↓
Phase C: ML model deployment (zero-downtime switch)
↓
Phase D: Continuous improvement
Phase A: MTA Standard Filters¶
Start with your MTA's built-in filtering (Bayesian, SPF, DKIM, fuzzy hashing, etc.). Install the tobira plugin but keep it disabled.
Goal: Begin collecting labeled spam/ham data for ML training.
tobira init auto-detects your running MTA and generates the appropriate plugin configuration.
Duration: Immediate. Start collecting data from day one.
Phase B: ML Model Training¶
While Phase A runs in production, train your ML model on the collected data.
-
Anonymize training data (PII removal):
-
Train and evaluate:
-
Check if the model meets quality thresholds:
Duration: Hours to days, depending on data volume and model complexity.
Requirement: F1 score > 0.95 before proceeding to Phase C.
Phase C: ML Model Deployment¶
Deploy the trained model with zero downtime.
-
Start the tobira API server:
-
Verify the server is healthy:
-
Enable the MTA plugin:
Duration: Configuration change only. No mail service interruption.
Phase D: Continuous Improvement¶
Monitor model performance and retrain as needed.
tobira's monitoring detects:
- Concept drift — Score distribution shifts over time
- Threshold tuning — Optimal classification thresholds
- Backend upgrade suggestions — When to switch to a more accurate backend
Infrastructure Requirements¶
| Phase | Infrastructure | Data |
|---|---|---|
| A | MTA filter (rspamd / SpamAssassin / Haraka) | None (start collecting) |
| B | GPU environment (for training) | 500+ labeled emails |
| C | API server (CPU is sufficient) | Trained model |
| D | Same as Phase C | Continuously collected data |