A POP3 server implementation in idiomatic Go, focused solely on the POP3 protocol with SSL/TLS support. Message storage and authentication are delegated to external modules via interfaces.
| RFC | Title | Description |
|---|---|---|
| RFC 1939 | Post Office Protocol - Version 3 | Core POP3 specification defining commands, states, and responses |
| RFC 2449 | POP3 Extension Mechanism | CAPA command and extension framework (TOP, UIDL, etc.) |
| RFC 2595 | Using TLS with IMAP, POP3 and ACAP | STARTTLS extension for upgrading connections |
| RFC 8314 | Cleartext Considered Obsolete | Implicit TLS on port 995, modern security requirements |
| RFC 5034 | POP3 SASL Authentication | SASL authentication mechanism for POP3 |
| RFC 1734 | POP3 AUTHentication command | Original AUTH command (superseded by RFC 5034) |
AUTHORIZATION State:
USER- Specify usernamePASS- Specify passwordAPOP- APOP authentication (MD5-based challenge-response)QUIT- End session
TRANSACTION State:
STAT- Get mailbox status (message count and size)LIST- List message sizesRETR- Retrieve a messageDELE- Mark message for deletionNOOP- No operation (keep-alive)RSET- Reset deletion marks
UPDATE State:
QUIT- Commit deletions and close connection
CAPA- Capability advertisementTOP- Retrieve message headers plus n lines of bodyUIDL- Unique-ID listing for message tracking
- Implicit TLS (port 995) - Direct TLS connection per RFC 8314
- STARTTLS (port 110) - Upgrade plaintext to TLS per RFC 2595
- SASL Authentication - Extensible authentication framework per RFC 5034
Prometheus metrics endpoint for monitoring:
- Connection counts (active, total)
- Command counters (by command type)
- Authentication success/failure rates
- Message retrieval statistics
- Error rates
- TLS/plaintext connection ratios
This module is responsible for:
- POP3 protocol parsing and response generation
- Connection state management (AUTHORIZATION, TRANSACTION, UPDATE)
- TLS/SSL handling (both implicit and STARTTLS)
- Session management
This module imports interfaces from external modules:
- Message Storage - Mailbox interface for retrieving, listing, and deleting messages
- Authentication - Authenticator interface for validating user credentials
Interface definitions and implementations live in separate repositories, keeping this module focused purely on the POP3 protocol.
- Go 1.23 or later
- Task - A task runner / simpler Make alternative
- golangci-lint - Go linters aggregator
- govulncheck - Go vulnerability checker
Install Task following the installation instructions.
Install Go development tools:
task install:depsRun task --list to see all available tasks:
| Task | Description |
|---|---|
task build |
Build the Go binary |
task lint |
Run golangci-lint |
task vulncheck |
Run govulncheck for security vulnerabilities |
task test |
Run tests |
task test:coverage |
Run tests with coverage report |
task all |
Run all checks (build, lint, vulncheck, test) |
task clean |
Clean build artifacts |
task install:deps |
Install development dependencies |
task hooks:install |
Configure git to use project hooks |
This project includes a pre-push hook that runs all checks before pushing. To enable it:
task hooks:installThis configures git to use the .githooks directory for hooks.
See LICENSE for details.