Proposal: L402-Based Paid Inbound Gating for the Archon DMail Gateway
Executive Summary
This proposal recommends adding L402-backed paid inbound gating to the Archon DMail gateway as an optional anti-spam and contact-control feature.
The recommended first phase is:
- keep token-threaded replies free
- keep trusted or allowlisted senders free
- require payment for unsolicited first-contact inbound mail
- perform payment verification through Archon Drawbridge
- initially enforce the feature at the gateway/application layer, with a longer-term option to move enforcement to the SMTP edge via
archon-mail-bridge or Postfix policy delegation
This is a practical fit for Archon because the current Herald email bridge already distinguishes between token-threaded replies and unsolicited inbound mail, and Drawbridge already exposes L402/payment capabilities that can be reused as the settlement and authorization layer.
Goals
- Reduce unsolicited inbound spam and abuse.
- Preserve a smooth experience for legitimate ongoing conversations.
- Reuse Archon’s existing L402 and DID infrastructure where practical.
- Avoid breaking the current Email ↔ DMail bridge model.
- Preserve a path to SMTP-edge enforcement later.
Non-Goals
- Replacing DKIM, SPF, or DMARC.
- Building a content-classification spam engine.
- Requiring payment for all email by default.
- Replacing standard mailbox storage with Archon-native message storage in the first phase.
Current State
Archon’s current Email ↔ Dmail Bridge design is centered on Herald as a trusted courier. The bridge currently supports:
- outbound DMail → email delivery
- inbound email replies via token-gated reply addresses
- unsolicited inbound email to registered Herald names
- webhook authentication and a basic spam-score threshold
- an
EmailServiceInterface abstraction with SendGridEmailService as the documented implementation
The design explicitly lists rate limiting as future work, which makes paid admission control a natural extension rather than a conceptual mismatch.1
Archon also already has Drawbridge as an L402 API gateway. The sample environment file includes:
ARCHON_DRAWBRIDGE_L402_ENABLED
ARCHON_DRAWBRIDGE_DEFAULT_PRICE_SATS
- invoice expiry and rate-limit settings
That confirms the project already has an L402-oriented service boundary and configuration model that can support payment-gated access flows.2
Separately, the archon-mail-bridge project provides a more SMTP-native architecture, with:
- an inbound SMTP listener
- outbound SMTP delivery
- name → DID resolution
- SQLite-backed conversation/message storage
- standard email threading headers
That project is a stronger long-term fit if the goal is true SMTP-time enforcement rather than post-accept application-layer handling.3
Problem Statement
The current DMail gateway can reject obvious abuse through simple checks, but it does not impose a meaningful economic cost on unsolicited inbound contact. Traditional content spam filtering is imperfect, and a paid-contact control can be effective even when sender identity is weak.
L402 does not classify spam content. Instead, it changes the economics of unsolicited contact by requiring payment before a message is delivered into a DMail conversation.
This makes L402 best suited for:
- first-contact inboxes
- premium aliases
- professional or consulting endpoints
- anti-spam gating for public-facing recipients
Proposed Feature
Add an optional L402 paid inbound policy to the Archon DMail gateway.
Recommended Default Policy
Free
- token-threaded replies
- allowlisted senders
- policy-exempt recipients
- optionally, DID-authenticated trusted contacts
Paid
- unsolicited first-contact inbound mail to
name@domain
- optionally, large attachments or high-volume senders
Rejected or Quarantined
- unpaid unsolicited mail after challenge issuance
- expired invoice cases
- mail that fails existing spam/auth policy before payment is even considered
Why This Fits the Existing Architecture
The current Herald bridge already has a clean branch point between:
- token-gated reply mail, and
- unsolicited inbound mail
That is exactly where a paid gate belongs. Free replies preserve ongoing conversations, while payment requirements are applied only to cold inbound messages.1
The current bridge also already stores mappings and token state in Herald’s database. A paid-gating feature can reuse the same general model by storing a short-lived pending inbound message record until payment clears.1
Architecture Options
Option A — Herald Webhook-Layer Paid Gating (Recommended First Phase)
Flow
- External sender emails
alice@domain.
- SendGrid accepts the message and forwards it to Herald’s inbound webhook.
- Herald classifies the message:
- if token-threaded reply: deliver immediately
- if allowlisted/trusted: deliver immediately
- if unsolicited and payment required: create a pending inbound record
- Herald or Drawbridge generates an invoice/payment challenge.
- After payment confirmation, Herald converts the pending message into a DMail.
Advantages
- Minimal disruption to the current documented bridge design.
- Reuses existing Herald routing logic.
- Reuses Drawbridge’s L402/payment machinery.
- Low implementation surface compared with a full SMTP-edge redesign.
Limitations
- Payment gating happens after SendGrid has already accepted the email.
- This is not true SMTP-time refusal.
- Operational behavior is closer to quarantine-until-paid than “pay before acceptance.”
This limitation follows directly from the documented SendGrid inbound parse webhook architecture used by Herald today.1
Option B — archon-mail-bridge SMTP-Time Paid Gating (Recommended Long-Term Path)
Flow
- External sender connects to the bridge’s SMTP listener.
- The bridge checks whether the recipient policy requires payment.
- If payment is required and not yet satisfied, the bridge defers or rejects according to policy.
- After payment clears, a retry or release path allows delivery.
Advantages
- Cleaner SMTP-native control point.
- Better fit for message acceptance policy.
- Easier to evolve into a full paid-inbox mail front end.
- Avoids dependency on SendGrid webhook semantics.
Limitations
- Larger implementation and deployment scope.
- Requires careful SMTP behavior design.
- More moving parts than the Herald-first approach.
This is attractive because archon-mail-bridge already documents an inbound SMTP listener, outbound SMTP, and local conversation storage.3
Option C — Postfix Policy Service + Archon Settlement Backend (Best for Mature Mail Deployments)
Flow
- Postfix receives inbound SMTP.
check_policy_service asks an Archon-aware policy daemon whether the sender may proceed.
- The policy daemon checks payment state in Drawbridge or a companion service.
- Postfix accepts, defers, or rejects accordingly.
Advantages
- Best fit for operators already running Postfix.
- True SMTP policy enforcement point.
- Clean separation between mail transport and Archon business logic.
Limitations
- More operational complexity.
- Requires extra policy-service implementation.
- Less aligned with the documented Herald bridge as it exists today.
Postfix explicitly supports delegated policy services and can make decisions at states including RCPT, DATA, and END-OF-MESSAGE. It also supports delivery to external commands through pipe(8) when final delivery needs to be handed to another system.45
Recommendation
Adopt a two-stage roadmap:
Stage 1
Implement Herald webhook-layer paid gating for unsolicited inbound only.
Stage 2
Move policy enforcement to archon-mail-bridge or Postfix if operators want true SMTP-edge behavior.
This approach gives Archon a useful feature quickly without forcing an immediate redesign of the existing bridge.
Detailed Policy Design
1. Policy Decision Matrix
| Message Type |
Default Policy |
| Token-threaded reply |
Deliver free |
| Allowlisted sender |
Deliver free |
| Trusted DID-linked sender |
Deliver free or discounted |
| First-contact unsolicited inbound |
Require payment |
| Oversized/abusive sender |
Higher price or reject |
| Unknown invalid recipient |
Reject/ignore per deployment policy |
2. Payment Object
For unsolicited inbound mail, create a short-lived pending object containing:
- sender address
- recipient address/name
- message metadata
- message body pointer or encrypted storage reference
- invoice id / payment id
- expiry timestamp
- delivery status
3. Payment Outcomes
| Outcome |
Action |
| Paid before expiry |
Convert to DMail and deliver |
| Not paid |
Discard or keep pending until expiry |
| Invoice expired |
Mark failed; optionally allow reissue |
| Already-paid trusted sender |
Deliver immediately |
4. Pricing Model
Start simple:
- global default price in sats
- optional per-recipient override later
- optional discounts for trusted contacts or credentialed senders later
This aligns with Drawbridge’s existing default pricing configuration model.2
DID and Identity Integration
DIDs should not be treated as a universal SMTP anti-spoofing solution, but they can still improve policy quality.
Recommended uses:
- tie paid privileges to a DID for Archon-aware users
- allow DID-authenticated or credentialed senders to bypass fees
- give lower pricing to senders with stronger identity proof
- keep ordinary SMTP senders on the default paid-first-contact path
This preserves compatibility with ordinary email while letting Archon-native identity improve trust and usability.
User Experience
Recipient Experience
- fewer unsolicited messages
- no payment friction for active threads
- optional premium public contact inboxes
Sender Experience
- ordinary correspondents can still reply normally in active threads
- first-contact senders may receive payment instructions or a payment-gated contact page
- Archon-native users may qualify for bypass or reduced rates
Security Considerations
Benefits
- raises the cost of unsolicited abuse
- reduces low-effort spam economics
- preserves existing thread continuity via free replies
- lets Archon identity and credential systems add trust where available
Risks
- paywalling can frustrate legitimate first-contact senders
- webhook-layer enforcement does not stop upstream acceptance by SendGrid
- invoice state handling and expiry logic add complexity
- malicious actors may still pay; payment is an admission control, not a content-quality guarantee
Operational Considerations
Observability
Track:
- total unsolicited inbound attempts
- invoices issued
- invoices paid
- paid messages delivered
- invoice expiries
- allowlist bypasses
- false-positive complaints
Configuration
Suggested first-pass settings:
- feature disabled by default
- one global default price
- recipient-level opt-in
- free token-threaded replies
- hard bypass for allowlisted contacts
Rollout Strategy
Phase 0 — Internal Testing
- add pending message storage
- add invoice generation and settlement callbacks
- simulate successful/expired unpaid flows
- verify free reply path remains unchanged
Phase 1 — Soft Launch
- enable for one or two experimental recipients
- use low sats pricing
- collect sender/recipient feedback
Phase 2 — Expanded Recipient Controls
- per-recipient prices
- allowlists and exemptions
- trust-tier discounts
Phase 3 — SMTP-Edge Migration (Optional)
- move enforcement into
archon-mail-bridge or Postfix policy services
- reserve Herald for identity and final DMail conversion logic
Implementation Notes
Herald-Focused Changes
- Add a policy check in unsolicited inbound handling.
- Create pending-message storage.
- Integrate Drawbridge invoice creation/status checks.
- Deliver only after settlement.
- Preserve the existing token-threaded reply fast path.
archon-mail-bridge / SMTP-Focused Changes
- Add recipient policy lookup before final acceptance.
- Add payment-state tracking.
- Decide on SMTP defer/reject wording and retry semantics.
- Preserve standard threading behavior after paid admission.
Postfix-Focused Changes
- Implement a policy daemon reachable via
check_policy_service.
- Query Drawbridge-backed payment state.
- Optionally hand accepted mail to Archon via
pipe(8) or another delivery transport.
Key Open Questions
- Should unpaid first-contact mail be silently dropped, quarantined, or acknowledged with payment instructions?
- Should the challenge be exposed as an email response, a web payment page, or both?
- Should recipients opt in individually, or should the domain default to paid-first-contact?
- Should trusted DID-authenticated senders bypass payment entirely?
- Should payment attach to a sender address, a DID, a conversation, or a one-time contact token?
Final Recommendation
Implement optional L402-based paid gating for unsolicited inbound mail in the current Herald bridge first, while preserving free token-threaded replies and free trusted-contact flows.
Treat this as admission control, not content filtering.
Design the feature so that the payment and policy logic can later move to archon-mail-bridge or Postfix policy services for cleaner SMTP-edge enforcement when needed.
Sources
Proposal: L402-Based Paid Inbound Gating for the Archon DMail Gateway
Executive Summary
This proposal recommends adding L402-backed paid inbound gating to the Archon DMail gateway as an optional anti-spam and contact-control feature.
The recommended first phase is:
archon-mail-bridgeor Postfix policy delegationThis is a practical fit for Archon because the current Herald email bridge already distinguishes between token-threaded replies and unsolicited inbound mail, and Drawbridge already exposes L402/payment capabilities that can be reused as the settlement and authorization layer.
Goals
Non-Goals
Current State
Archon’s current Email ↔ Dmail Bridge design is centered on Herald as a trusted courier. The bridge currently supports:
EmailServiceInterfaceabstraction withSendGridEmailServiceas the documented implementationThe design explicitly lists rate limiting as future work, which makes paid admission control a natural extension rather than a conceptual mismatch.1
Archon also already has Drawbridge as an L402 API gateway. The sample environment file includes:
ARCHON_DRAWBRIDGE_L402_ENABLEDARCHON_DRAWBRIDGE_DEFAULT_PRICE_SATSThat confirms the project already has an L402-oriented service boundary and configuration model that can support payment-gated access flows.2
Separately, the
archon-mail-bridgeproject provides a more SMTP-native architecture, with:That project is a stronger long-term fit if the goal is true SMTP-time enforcement rather than post-accept application-layer handling.3
Problem Statement
The current DMail gateway can reject obvious abuse through simple checks, but it does not impose a meaningful economic cost on unsolicited inbound contact. Traditional content spam filtering is imperfect, and a paid-contact control can be effective even when sender identity is weak.
L402 does not classify spam content. Instead, it changes the economics of unsolicited contact by requiring payment before a message is delivered into a DMail conversation.
This makes L402 best suited for:
Proposed Feature
Add an optional L402 paid inbound policy to the Archon DMail gateway.
Recommended Default Policy
Free
Paid
name@domainRejected or Quarantined
Why This Fits the Existing Architecture
The current Herald bridge already has a clean branch point between:
That is exactly where a paid gate belongs. Free replies preserve ongoing conversations, while payment requirements are applied only to cold inbound messages.1
The current bridge also already stores mappings and token state in Herald’s database. A paid-gating feature can reuse the same general model by storing a short-lived pending inbound message record until payment clears.1
Architecture Options
Option A — Herald Webhook-Layer Paid Gating (Recommended First Phase)
Flow
alice@domain.Advantages
Limitations
This limitation follows directly from the documented SendGrid inbound parse webhook architecture used by Herald today.1
Option B —
archon-mail-bridgeSMTP-Time Paid Gating (Recommended Long-Term Path)Flow
Advantages
Limitations
This is attractive because
archon-mail-bridgealready documents an inbound SMTP listener, outbound SMTP, and local conversation storage.3Option C — Postfix Policy Service + Archon Settlement Backend (Best for Mature Mail Deployments)
Flow
check_policy_serviceasks an Archon-aware policy daemon whether the sender may proceed.Advantages
Limitations
Postfix explicitly supports delegated policy services and can make decisions at states including
RCPT,DATA, andEND-OF-MESSAGE. It also supports delivery to external commands throughpipe(8)when final delivery needs to be handed to another system.45Recommendation
Adopt a two-stage roadmap:
Stage 1
Implement Herald webhook-layer paid gating for unsolicited inbound only.
Stage 2
Move policy enforcement to
archon-mail-bridgeor Postfix if operators want true SMTP-edge behavior.This approach gives Archon a useful feature quickly without forcing an immediate redesign of the existing bridge.
Detailed Policy Design
1. Policy Decision Matrix
2. Payment Object
For unsolicited inbound mail, create a short-lived pending object containing:
3. Payment Outcomes
4. Pricing Model
Start simple:
This aligns with Drawbridge’s existing default pricing configuration model.2
DID and Identity Integration
DIDs should not be treated as a universal SMTP anti-spoofing solution, but they can still improve policy quality.
Recommended uses:
This preserves compatibility with ordinary email while letting Archon-native identity improve trust and usability.
User Experience
Recipient Experience
Sender Experience
Security Considerations
Benefits
Risks
Operational Considerations
Observability
Track:
Configuration
Suggested first-pass settings:
Rollout Strategy
Phase 0 — Internal Testing
Phase 1 — Soft Launch
Phase 2 — Expanded Recipient Controls
Phase 3 — SMTP-Edge Migration (Optional)
archon-mail-bridgeor Postfix policy servicesImplementation Notes
Herald-Focused Changes
archon-mail-bridge/ SMTP-Focused ChangesPostfix-Focused Changes
check_policy_service.pipe(8)or another delivery transport.Key Open Questions
Final Recommendation
Implement optional L402-based paid gating for unsolicited inbound mail in the current Herald bridge first, while preserving free token-threaded replies and free trusted-contact flows.
Treat this as admission control, not content filtering.
Design the feature so that the payment and policy logic can later move to
archon-mail-bridgeor Postfix policy services for cleaner SMTP-edge enforcement when needed.Sources
Footnotes
Archon Email ↔ Dmail Bridge design:
docs/email-dmail-bridge.md. Source reviewed from the current repository. See: https://raw.githubusercontent.com/archetech/archon/main/docs/email-dmail-bridge.md ↩ ↩2 ↩3 ↩4Archon sample environment file showing Drawbridge L402 settings. See: https://raw.githubusercontent.com/archetech/archon/main/sample.env ↩ ↩2
archon-mail-bridgeREADME describing bidirectional SMTP ↔ DMail bridging, SMTP listener, and SQLite-backed conversation storage. See: https://raw.githubusercontent.com/archetech/archon-mail-bridge/main/README.md ↩ ↩2Postfix SMTP access policy delegation documentation. See: https://postfix.cs.utah.edu/SMTPD_POLICY_README.html ↩
Postfix
pipe(8)documentation for delivery to external commands. See: https://manpages.ubuntu.com/manpages/jammy/man8/pipe.8postfix.html ↩