Skip to content

Email Forwarding

Email forwarding turns Forge into an inbound mail receiver. Point your domain’s MX records at your Forge server, create forwarding rules, and email sent to @yourdomain.com lands in your personal inbox.

External sender
│ SMTP (port 25)
┌──────────────────────────┐
│ Forge Inbound SMTP │
│ (smtp-server + mailparser)│
│ │
│ 1. Receives raw email │
│ 2. SPF check on sender │
│ 3. Spam scoring │
│ 4. Matches forward rule │
│ 5. Re-wraps & relays │
└──────────┬───────────────┘
┌──────────────────────────┐
│ Forge Outbound SMTP │
│ (nodemailer) │
│ │
│ Forwards to: │
│ me@gmail.com │
└──────────────────────────┘

Forge is a mail relay, not a mail server. It receives, filters, and forwards. It does not store email (beyond logs) or provide IMAP/POP3 access. Your destination inbox (Gmail, Proton, Fastmail) handles storage, search, and replies.

Terminal window
# In your Forge .env:
FORGE_EMAIL_INBOUND_ENABLED=true
FORGE_EMAIL_INBOUND_PORT=25 # 25 for production, 2525 for testing

Restart Forge.

Terminal window
sudo ufw allow 25/tcp

Some VPS providers block port 25 by default. You may need to request unblocking:

  • Hetzner: Unblocked by default
  • DigitalOcean: Open a support ticket
  • AWS Lightsail/EC2: Port 25 is permanently restricted — use SES instead
  • Linode: Open a support ticket

Add MX records to your domain:

Type Name Value Priority
MX mail.yourdomain.com forge.yourserver.com. 10
A forge.yourserver.com YOUR_VPS_IP -
TXT mail.yourdomain.com "v=spf1 mx -all" (SPF record)

Replace forge.yourserver.com with the hostname pointing to your Forge server, and YOUR_VPS_IP with the actual IP.

Go to System Settings → Email → Forwards → Add Forward.

Source: support@yourdomain.com
Destination: me@gmail.com
Spam filter: Standard

Emails to support@yourdomain.com are forwarded to me@gmail.com.

Source: *@yourdomain.com
Destination: me@gmail.com
Spam filter: Standard

Any email to @yourdomain.com that doesn’t match an exact rule is forwarded to me@gmail.com. Only one wildcard per identity — create it last.

Exact matches are checked first. The wildcard (if any) is checked last. If no rule matches, the email is silently dropped (not bounced, to avoid backscatter spam).

Forge scores every inbound email from 0–100:

SignalCheck
SPF validationDid the sender’s IP match the domain’s SPF record?
Reverse DNSDoes the sender’s IP have a PTR record?
DNS blacklistsIs the sender IP on Spamhaus or similar DNSBL? (configurable)
Header heuristicsMissing Message-ID, malformed Date, mismatched From
Content signalsKnown spam patterns in subject and body

Threshold modes:

ModeScore thresholdBehavior
OffN/AForward everything — no spam filtering
Standard (default)60+Drop if score exceeds 60
Strict35+Drop if score exceeds 35

Set the mode per forwarding rule in the dashboard.

The Inbound Log tab shows all received emails:

ColumnDescription
FromSender address
ToRecipient address (the forwarding address)
SubjectEmail subject
Spam Score0–100 spam probability
Actionforwarded or dropped
TimeWhen the email was received

Dropped emails are logged with their spam score — useful for tuning thresholds or investigating false positives.

Inbound emails with attachments are forwarded with attachments intact (up to 25 MB total message size). Forge does not scan or modify attachment content.

Replies to forwarded emails go to the original sender, not to Forge. The Reply-To header is preserved from the original email. Forge does not rewrite headers.

To reply from your custom domain address (e.g., support@yourdomain.com), configure that address as a “Send mail as” alias in Gmail or your email client, using your SMTP server credentials.

LimitValue
Max inbound message size25 MB
Inbound rate limit600 emails/minute per identity
Max forwarding rules per identity50
Port (production)25
Port (development)2525
ProblemLikely causeFix
Emails not arrivingDNS MX records not propagatedCheck with dig MX yourdomain.com. Wait up to 48 hours for DNS propagation.
Port 25 connection refusedVPS blocks port 25Use FORGE_EMAIL_INBOUND_PORT=2525 for testing, or request unblock from VPS provider.
All emails dropped as spamSpam threshold too strictLower threshold or set mode to “Off” temporarily to check if emails are arriving.
Forwarded email not in inboxDestination spam filterCheck Gmail/Proton spam folder. Whitelist noreply@forge.yourserver.com.
SPF validation failsMissing SPF recordAdd "v=spf1 mx -all" TXT record to your domain.