wildduck/docs
titanism 70aed51373
fix(connection-management): implement connection management, POP3 timeout fixes, and comprehensive documentation (#835)
* feat: implement connection management, POP3 timeout fixes, and comprehensive documentation

- feat(imap,pop3): add onConnect and onClose handlers (closes #721)
  * Implement onConnect handlers for connection filtering and rate limiting
  * Implement onClose handlers for custom cleanup logic
  * Add support for IP blocking and connection overflow prevention
  * Enable custom connection management and monitoring
  * Maintain full backward compatibility

- feat(pop3): reset socket timeout after each command processing (closes #709)
  * Add timeout reset in processQueue() after successful command execution
  * Add timeout reset for continue data processing
  * Prevents active POP3 connections from timing out unexpectedly
  * Maintains backward compatibility with existing timeout settings

- docs: add comprehensive documentation with proper navigation (related to #770)
  * Add Connection Management guide with implementation examples
  * Add CONDSTORE Extension guide with RFC 4551 compliance details
  * Update README with Recent Improvements section
  * Add proper sidebar navigation links for discoverability
  * Add cross-references in protocol support documentation
  * Ensure GitHub pages compatibility and multiple discovery paths
  * Fix documentation accuracy to match actual codebase implementation

- test: add comprehensive test coverage for new features
  * Add IMAP onConnect/onClose handler tests (7 tests)
  * Add POP3 onConnect/onClose handler tests (9 tests)
  * Add POP3 timeout reset functionality tests (3 tests)
  * Fix test file path issues for proper execution
  * All 19 tests passing with full coverage
  * Perfect ESLint compliance across all test files

- refactor: enhance features documentation
  * Add Advanced Connection Management
  * Add Smart POP3 Timeout Handling
  * Add CONDSTORE Extension Support
  * Update main project README with practical examples

- fix: correct test file paths for proper execution
  * Fix hardcoded absolute paths in POP3 timeout tests
  * Use relative paths for better portability
  * Apply whitespace cleanup across all JS and MD files

Related to #770 (CONDSTORE functionality verified and documented accurately)

* fix: fixed tests via server.listen(0) approach

* fix: implemented changes from @NickOvt per #835

- Added `const TEST_PORT = 0;` to all appropriate test files where `.listen(0` was used
- Replaced all instances of `.listen(0, with .listen(TEST_PORT,`
- Added abrupt connection close test via `"should handle abrupt connection close properly"` which verifies both onConnect and onClose handlers are called (for both IMAP and POP3)
- Added async handler test via `"should work with async onConnect handler"` which simulates Redis or other async operations (for both IMAP and POP3)
- Simplified CONDSTORE documentation
- Removed redundant RFC explanations
- Removed AI-written style phrases like "use WeakMap ... etc. etc."
2025-07-23 10:46:13 +03:00
..
additional-software fix(connection-management): implement connection management, POP3 timeout fixes, and comprehensive documentation (#835) 2025-07-23 10:46:13 +03:00
api fix: ZMS-210 API and docs fallback values updates (#802) 2025-04-08 14:45:39 +03:00
general fix(connection-management): implement connection management, POP3 timeout fixes, and comprehensive documentation (#835) 2025-07-23 10:46:13 +03:00
in-depth fix(connection-management): implement connection management, POP3 timeout fixes, and comprehensive documentation (#835) 2025-07-23 10:46:13 +03:00
.nojekyll Combine readme and wiki onto centralized docs 2020-05-02 17:38:12 +02:00
_sidebar.md fix(connection-management): implement connection management, POP3 timeout fixes, and comprehensive documentation (#835) 2025-07-23 10:46:13 +03:00
api-error-codes.md fix(typos): fixed typos ZMS-167 (#740) 2024-10-14 10:37:58 +03:00
index.html fix: Update all urls in all files to point to new repo url. ZMS-180 (#791) 2025-03-10 11:21:48 +02:00
README.md fix(connection-management): implement connection management, POP3 timeout fixes, and comprehensive documentation (#835) 2025-07-23 10:46:13 +03:00

WildDuck Mail Server

WildDuck is a scalable no-SPOF IMAP/POP3 mail server. WildDuck uses a distributed database (sharded + replicated MongoDB) as a backend for storing all data, including emails.

WildDuck tries to follow Gmail in product design. If there's a decision to be made then usually the answer is to do whatever Gmail has done.

Recent Enhancements

WildDuck has been enhanced with several new features for improved connection management and protocol support:

  • Connection Management - Advanced onConnect and onClose handlers for IMAP and POP3 servers, enabling custom connection filtering, rate limiting, and monitoring
  • CONDSTORE Extension - Full RFC 4551 CONDSTORE implementation for efficient email synchronization with conditional STORE operations
  • Smart POP3 Timeout Handling - Automatic timeout reset during active command processing to prevent unexpected disconnections

Contact

Gitter chat

Requirements

  • MongoDB to store all data
  • Redis for pubsub and counters
  • Node.js at least version 10.0.0

Optional requirements

  • Redis Sentinel for automatic Redis failover
  • Build tools to install optional dependencies that need compiling

WildDuck can be installed on any Node.js compatible platform.

No-SPOF architecture

Every component of the WildDuck mail server can be replicated which eliminates potential single point of failures.

Storage

Attachment de-duplication and compression gives up to 56% of storage size reduction.

Goals of the Project

  1. Build a scalable and distributed IMAP/POP3 server that uses clustered database instead of single machine file system as mail store
  2. Allow using internationalized email addresses
  3. Provide Gmail-like features like pushing sent messages automatically to Sent Mail folder or notifying about messages moved to Junk folder so these could be marked as spam
  4. Provide parsed mailbox and message data over HTTP. This should make creating webmail interfaces super easy, no need to parse RFC822 messages to get text content or attachments

Future considerations

  • Optimize FETCH queries to load only partial data for BODY subparts

  • Parse incoming message into the mime tree as a stream. Currently the entire message is buffered in memory before being parsed.

  • Maybe allow some kind of message manipulation through plugins

  • WildDuck does not plan to be the most feature-rich IMAP client in the world. Most IMAP extensions are useless because there aren't too many clients that are able to benefit from these extensions. There are a few extensions though that would make sense to be added to WildDuck:

    • IMAP4 non-synchronizing literals, LITERAL- (RFC7888). Synchronized literals are needed for APPEND to check mailbox quota, small values could go with the non-synchronizing version.
    • LIST-STATUS (RFC5819)
    • What else? (definitely not NOTIFY nor QRESYNC)

License

WildDuck Mail Agent is licensed under the European Union Public License 1.2 or later.