Pepsi Manual¶
Pepsi is an e-mail forwarding pipeline and crypto gateway written in Rust. It receives mail over SMTP, authenticates it at the boundary, and then advances each message through a configurable chain of small stage programs — ARC sealing, SRS envelope rewriting, end-to-end encryption and decryption, DKIM signing, bounce generation and delivery (direct-to-MX, via a smarthost, or locally) — that together re-send the mail while preserving the authentication verdicts the final receiver needs.
Unlike a classical store-and-forward MTA, Pepsi is structured as a series of independent programs chained over a single shared database table. Each processing step is its own program, so the pipeline can be reordered, individual steps replaced, and new behaviour added by dropping in another program — without touching the rest of the system.
Start with Introduction, which says what Pepsi is, lists its key
features, compares it with the established MTAs and explains how the rest of
this manual is organised. Getting started on a cheap VPS is the walkthrough from DNS
to a first received e-mail, and The Wizard shows the pipelines
pepsi-setup --wizard builds and what each of its questions decides.
Contents
- 1. Introduction
- 2. Getting started on a cheap VPS
- 2.1. What we will build
- 2.2. Prerequisites
- 2.3. Step 1 — Delegate DNS and place the base records
- 2.4. Step 2 — Install Pepsi
- 2.5. Step 3 — Prepare the system
- 2.6. Step 4 — Write the configuration
- 2.7. Step 5 — Provision the schema, keys and certificate
- 2.8. Step 6 — Publish the remaining records and verify
- 2.9. Step 7 — Start the services
- 2.10. Step 8 — Send the first e-mail
- 2.11. Step 9 — Open the console (optional)
- 2.12. Sending mail too: add a submission port
- 2.13. Troubleshooting
- 2.14. Next steps
- 3. Installation
- 4. Debian packages
- 5. The Wizard
- 6. Configuration
- 7. Supported Features
- 7.1. Inbound SMTP reception
- 7.2. Trace headers
- 7.3. Client authentication
- 7.4. Message submission
- 7.5. Boundary authentication
- 7.6. Authenticated Received Chain (ARC)
- 7.7. Sender Rewriting Scheme (SRS)
- 7.8. End-to-end encryption and signing
- 7.9. Server-side decryption and verification
- 7.10. Key management, discovery and publication
- 7.11. The secure-link fallback
- 7.12. Outbound DKIM signing
- 7.13. Delivery Status Notifications
- 7.14. Internationalised and 8-bit content
- 7.15. Outbound relay
- 7.16. Local delivery
- 7.17. Operational features
- 7.18. Feature stability
- 8. SMTP Protocol Extensions
- 9. Key management
- 9.1. Three kinds of material
- 9.2. Custody: how a private key is stored
- 9.3. The privilege boundary
- 9.4. Signing and encryption are separate
- 9.5. Creating identities
- 9.6. Publishing our users’ keys
- 9.7. Backing up and rotating the key-encryption key
- 9.8. Peer keys
- 9.9. Finding a correspondent’s key
- 9.10. A CLI walk-through
- 9.11. Configuration summary
- 9.12. See also
- 10. The secure-link fallback portal
- 11. Client interoperability
- 12. Security model
- 12.1. What Pepsi assumes
- 12.2. The privilege split
- 12.3. The private-key custody boundary
- 12.4. An attacker who has the database
- 12.5. An attacker who has the configuration file
- 12.6. An attacker who compromises a stage worker
- 12.7. Specific defences
- 12.8. What Pepsi does not defend against
- 12.9. Reporting a vulnerability
- 12.10. See also
- 13. Microsoft Exchange as a gateway
- 13.1. Topologies
- 13.2. The routing decision
- 13.3. Exchange Online: the tenant endpoint
- 13.4. Address family selection
- 13.5. Loop prevention
- 13.6. Exchange connector configuration
- 13.7. The Outlook add-in
- 13.8. The
X-Pepsi-*header contract - 13.9. Identity auto-provisioning
- 13.10. Troubleshooting
- 13.11. What Pepsi does not do
- 14. The administrative API
- 14.1. Where it is served
- 14.2. Authentication
- 14.3. Authorisation: scopes
- 14.4. Conventions
- 14.5. Pagination
- 14.6. Endpoints
- 14.7. Two things this server deliberately cannot do
- 14.8. Correspondent keys
- 14.9. Secure links
- 14.10. DNS records
- 14.11. Online setup
- 14.12. Hardening
- 14.13. The audit log
- 14.14. The mail log (off by default)
- 14.15. Bootstrapping
- 14.16. The browser console
- 15. The administration console
- 16. Architecture
- 17. The message state
- 18. Extending the Pipeline
- 18.1. When a stage is the right tool
- 18.2. Anatomy of a stage crate
- 18.3. The body
- 18.4. Terminal helpers (choose exactly one)
- 18.5. Rules the stages live by
- 18.6. Wiring it in
- 18.7. Testing a stage
- 18.8. Adding support for migrating from another MTA
- 18.9. Integrating an external credential-refresh service
- 18.10. Keeping the feature-stability table current
- 19. Test Suite
- 20. Benchmark Suite
- 21. Performance
- 22. pepsi-ingress
- 23. pepsi-dispatch
- 24. pepsi-httpd
- 25. pepsi-stage-arc
- 26. pepsi-stage-srs
- 27. pepsi-stage-encrypt
- 28. pepsi-stage-decrypt
- 29. pepsi-stage-dkim-sign
- 30. pepsi-stage-bounce
- 31. pepsi-stage-aliases
- 32. pepsi-stage-relay-to-internet
- 33. pepsi-stage-relay-to-smarthost
- 34. pepsi-stage-relay-to-maildir
- 35. pepsi-stage-dot-forward
- 36. pepsi-stage-relay-to-lmtp
- 37. pepsi-stage-discard
- 38. pepsi-stage-anti-spam
- 39. pepsi-stage-auto-pay
- 40. pepsi-stage-check-whitelist
- 41. pepsi-stage-auto-whitelist
- 42. pepsi-stage-autocrypt-learn
- 43. pepsi-stage-detect-language
- 44. pepsi-detect-language
- 45. pepsi-stage-block-language
- 46. pepsi-stage-vacation
- 47. pepsi-stage-edit-settings
- 48. pepsi-stage-if
- 49. pepsi-stage-milter
- 50. pepsi-stage-route
- 51. pepsi-stage-vks-confirm
- 52. pepsi-stage-secure-link
- 53. pepsi-setup
- 54. pepsi-queue
- 55. pepsi-status
- 56. pepsi-sendmail
- 57. pepsi-whitelist
- 58. pepsi-keys
- 59. pepsi-keydisc
- 60. pepsi-settings
- 61. pepsi-tlsrpt
- 62. pepsi-secure-link
- 63. pepsi-failure-bouncer
- 64. pepsi-quota
- 65. pepsi-helper-token-refresh
- 66. pepsi-telemetry
- 67. pepsi-telemetry-client
- 68. pepsi-config
- 69. Feature stability
- 70. Manual pages
- 71. RFC Index