title: "Email Security — Anti-Spoofing & Anti-Spam Filters" description: "GoWeBa protects your email domains against identity spoofing and spam with built-in RFC 2822, SPF, DKIM, and DMARC filters in the reception engine." lastUpdated: "2026-05-13" author: "GoWeBa — Security Team"
Email Security — Anti-Spoofing & Anti-Spam Filters
🛡️ GoWeBa includes a multi-layer email protection system that automatically detects and blocks fraudulent emails, identity spoofing attempts, and spam before they ever reach your inbox.
📅 Date: May 13, 2026 🏷️ Version: 1.2.1 🟢 Status: Active — deployed in production
🔒 What is Email Spoofing?
Email spoofing is a technique used by scammers to send emails that appear to come from your own email address or domain. The goal is to trick the recipient into believing the message is legitimate.
Common example: a sextortion email claiming "I hacked your email account and sent this message from your own address!" In reality, the scammer simply forged the "From" field — they have no access to your account.
⚠️ Important: A spoofed email does NOT mean your account has been hacked. It's the digital equivalent of writing a fake return address on a paper envelope.
🛡️ GoWeBa Multi-Layer Protection
GoWeBa uses a defense-in-depth system with 3 layers of protection:
Layer 1 — DNS-Level Filtering (Prevention)
Your email domains are protected by three Internet security standards:
| Standard | Function | GoWeBa Configuration |
|---|---|---|
| SPF (Sender Policy Framework) | Declares which servers are authorized to send emails for your domain | v=spf1 include:sendgrid.net -all — Strict mode: any unauthorized server is rejected |
| DKIM (DomainKeys Identified Mail) | Cryptographic signature proving the email wasn't modified in transit | 2048-bit RSA keys (s1 + s2) via SendGrid — automatic signing |
| DMARC (Domain-based Message Authentication) | Policy telling worldwide servers what to do with unauthenticated emails | p=reject — Strict mode: spoofed emails are rejected, never delivered |
Layer 2 — Webhook-Level Filtering (Real-Time Detection)
GoWeBa's reception engine analyzes every incoming email in real time:
| Rule | Detection | Action |
|---|---|---|
| Self-spoofing | Sender claims to send from your own domain but fails SPF verification | 🚫 Blocked — email never stored |
| High spam score | SpamAssassin score (provided by SendGrid) exceeds 5.0 threshold | 🚫 Blocked — email never stored |
| SPF hard fail | SPF verification fails for any sender | 🚫 Blocked — email never stored |
💡 Every blocked email is logged with the reason, spam score, and SPF/DKIM results for audit and analysis.
Layer 3 — Security Verdicts (Traceability)
Every email that passes the filters is stored with complete security verdicts:
- SPF result: pass, fail, softfail, neutral
- DKIM result: pass, fail
- Spam score: numeric SpamAssassin score
This information is accessible in each message's metadata for full transparency.
📊 Security Dashboard
Administrators can monitor email security from the WEBA Cleanup module (/inbox/cleanup):
- 📈 Real-time statistics — messages analyzed, RFC links found
- 🔗 Conversation regrouping — detection of fragmented threads via In-Reply-To and Message-ID
- 🧹 Automatic cleanup — removal of empty threads, counter corrections
- ⚡ Retroactive regrouping — intelligent merging of scattered conversations after import/migration
🔧 Recommended Configuration for Your Domains
When you connect a custom domain to GoWeBa, we automatically configure the security DNS records. Here's the optimal configuration:
SPF (TXT record on your domain)
v=spf1 include:sendgrid.net -all
- ✅
include:sendgrid.net— authorizes SendGrid servers (GoWeBa) - ✅
-all— strict mode — rejects any other server - ⚠️ Do not use
~all(tilde) — that's the permissive mode that lets spoofed emails through
DKIM (CNAME records)
s1._domainkey.yourdomain.com → s1.domainkey.u61475168.wl169.sendgrid.net
s2._domainkey.yourdomain.com → s2.domainkey.u61475168.wl169.sendgrid.net
Two 2048-bit RSA signing keys for redundancy and secure rotation.
DMARC (TXT record on _dmarc.yourdomain.com)
v=DMARC1; p=reject; rua=mailto:dmarc@yourdomain.com; pct=100
- ✅
p=reject— blocks unauthenticated emails (doesn't even send them to spam) - ✅
rua=mailto:...— aggregated DMARC reports for monitoring - ✅
pct=100— applied to 100% of emails
🆘 What to Do If You Receive a Suspicious Email?
| Action | Recommendation |
|---|---|
| Don't reply | Never respond to a spam or sextortion email |
| Don't pay | Cryptocurrency ransom demands are always scams |
| Don't click | Don't click any links in a suspicious email |
| Delete it | You can safely delete the email |
| Check your DNS | Confirm your SPF uses -all and your DMARC p=reject |
| Contact support | If in doubt, contact support@goweba.com |
🏗️ Technical Architecture
Email Reception Flow
Internet → SendGrid (MX) → GoWeBa Webhook → Anti-spoofing/spam filter → Storage
↓
┌───────────────┐
│ Rule 1: Self-spoof │ → Blocked (SPF fail + same domain)
│ Rule 2: Spam score │ → Blocked (score ≥ 5.0)
│ Rule 3: SPF fail │ → Blocked (hard fail)
└───────────────┘
↓
Legitimate email → Stored with verdicts
Components Involved
| Component | Role |
|---|---|
SendGrid Inbound Parse | Email reception via MX, delivery to webhook |
/api/webhooks/sendgrid-inbound | Processing webhook with built-in anti-spoofing filter |
checkSpamAndSpoofing() | Multi-level verification function (3 rules) |
securityVerdicts | JSON storage of SPF, DKIM and spam score results per message |
lib/imap/thread-cleanup.ts | Conversation cleanup and regrouping engine |
✅ Summary
| Protection | Type | Status |
|---|---|---|
SPF -all | DNS — prevention | ✅ Configured by GoWeBa |
| DKIM RSA 2048 | DNS — authenticity | ✅ Configured by GoWeBa |
DMARC p=reject | DNS — policy | ✅ Configured by GoWeBa |
| Self-spoofing filter | Webhook — detection | ✅ Active |
| Spam score filter | Webhook — detection | ✅ Active |
| SPF hard fail filter | Webhook — detection | ✅ Active |
| Security verdicts | Storage — traceability | ✅ Active |
| RFC 2822 regrouping | Cleanup — conversations | ✅ Active |
GoWeBa protects your communications. You can send and receive emails with confidence. 🛡️
— GoWeBa Security Team 🔒