MTA Integration Overview¶
tobira provides plugins for the most popular mail transfer agents. Each plugin queries the tobira API server via HTTP and maps the ML spam score to MTA-native scoring symbols.
Supported MTAs¶
| MTA | Plugin Language | Difficulty | Status |
|---|---|---|---|
| rspamd | Lua | Low | Stable |
| SpamAssassin | Perl | Medium | Stable |
| Haraka | Node.js | Low | Stable |
| Postfix milter | Python | Medium | Stable |
How It Works¶
All MTA plugins follow the same pattern:
- Intercept — The plugin hooks into the MTA's message processing pipeline
- Extract — Email body (and optionally headers) are extracted
- Query — An HTTP POST request is sent to
POST /predicton the tobira API server - Score — The ML spam probability is mapped to tiered symbols/rules
Score Mapping¶
All plugins use consistent symbol names and weights:
| ML Score | Symbol | Weight | Meaning |
|---|---|---|---|
| >= 0.9 | TOBIRA_SPAM_HIGH |
+8.0 | High confidence spam |
| >= 0.7 | TOBIRA_SPAM_MED |
+5.0 | Medium confidence spam |
| >= 0.5 | TOBIRA_SPAM_LOW |
+2.0 | Low confidence spam |
| < 0.3 | TOBIRA_HAM |
-3.0 | Likely legitimate |
Fail-Open Mode¶
All plugins support fail-open mode: if the tobira API server is unreachable or returns an error, the email is passed through without ML scoring. This ensures mail delivery is never blocked by an ML service outage.
Prerequisites¶
Before integrating with your MTA, ensure:
- The tobira API server is running and accessible from the MTA host
- The
/healthendpoint returns{"status": "ok"} - Network connectivity between MTA and API server (same host or private network recommended)