Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

infodancer/pop3d

Repository files navigation

pop3d

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.

Relevant RFCs

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)

Intended Features

Core POP3 Commands (RFC 1939)

AUTHORIZATION State:

  • USER - Specify username
  • PASS - Specify password
  • APOP - APOP authentication (MD5-based challenge-response)
  • QUIT - End session

TRANSACTION State:

  • STAT - Get mailbox status (message count and size)
  • LIST - List message sizes
  • RETR - Retrieve a message
  • DELE - Mark message for deletion
  • NOOP - No operation (keep-alive)
  • RSET - Reset deletion marks

UPDATE State:

  • QUIT - Commit deletions and close connection

Extensions (RFC 2449)

  • CAPA - Capability advertisement
  • TOP - Retrieve message headers plus n lines of body
  • UIDL - Unique-ID listing for message tracking

Security

  • 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

Observability

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

Architecture

Scope Boundaries

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.

Prerequisites

Installing Dependencies

Install Task following the installation instructions.

Install Go development tools:

task install:deps

Development

Available Tasks

Run 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

Git Hooks

This project includes a pre-push hook that runs all checks before pushing. To enable it:

task hooks:install

This configures git to use the .githooks directory for hooks.

License

See LICENSE for details.

About

Merged into the infodancer/maildancer monorepo (2026). Archived — full history preserved there.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages