Vibeleaderboard
Index / tool
Visit imapkit.com
Category
Developer Tools
Rank
No. 1357Tools index

Previous survey · No. 1343 ·

Pricing
Open Source
Type
TOOL
Use case
Software Testing & Quality
Interfaces
CLI · API
GitHub
77 stars
Latest release
v5.3.2
Date

About

ImapKit is a scriptable IMAP server that runs in memory inside a test suite, so mail client code can be tested against real IMAP over a socket. It enforces the RFCs strictly, supports over 50 extensions, and lets tests add messages, change flags and script faults such as delayed responses or dropped connections. It can also run as a command with a REST API for use from Python, Go or other languages.

At a glance

ImapKit is an in-memory IMAP server for client tests. It is worth trying if you need repeatable cases for mailbox changes or connection failures. A test can seed messages, change server state and watch what the client does over an IMAP connection.

Good fit

Developers testing how a mail client handles synchronization, reconnects and protocol errors.

Consider something else when

Skip it for production mail storage or if you only need to test sending email over SMTP.

Start here

Open Try it live, select the built-in LOGIN command and then SELECT INBOX. Look for the message count and UIDVALIDITY in the response. For a client test, seed a mailbox and check what the client does when its saved UIDVALIDITY changes.

Cost and requirements

MIT-licensed. The browser demo needed no account. Use the npm package inside a JavaScript test or run the CLI and control it over HTTP from another language.

Limits to know

The in-memory fixture is temporary. Strict protocol behavior and optional quirks help reproduce cases, but a passing test still leaves provider-specific behavior to verify separately.

Sources checked 2026-11-05. Source-based assessment.

Read the source review

What it does

A fake mail server for testing email client code. It speaks IMAP (the protocol mail apps use to read mailboxes) over a real socket, but keeps every mailbox and message in memory, loaded from a JSON object, so each new instance starts from an identical state and nothing touches disk. Your test starts one, points the client at it, then checks the result. Each protocol extension is a plugin you switch on per instance, and the server can be told to misbehave on cue, for example by holding a response back or cutting the connection mid-reply.

Why it's ranked here

Its value is pedantry. The README lists more than twenty classes of client mistakes it answers with an error, most tied to a numbered section of the relevant standard, such as a bare line feed where a carriage return and line feed are required, or data sent before the server invited it. Lenient production servers accept those silently. Add an MIT license, a single runtime dependency, and presets that reproduce documented bugs from Microsoft 365, Yahoo and Apache James, and it is a serious tool for anyone shipping an IMAP client.

What's good

Fault injection is precise and repeatable. Rules can fire on the nth matching event, on a random chance drawn from a seeded generator, or after a set quiet period, and a misspelled rule option raises an error instead of silently never firing. A control interface lets a test add messages, change flags or drop a session while clients stay connected, and those clients see the change exactly as if another session made it. A snapshot call returns the whole mail store in the startup format, so a failing state can be saved and replayed.

Tradeoffs

It models one user. Every client shares the same account even when they log in with different credentials, so multi-tenant behavior is out of scope. Strictness cuts both ways: a client that works against lenient real servers may fail here first, which is intended but can surface errors your users never hit. The bundled SMTP listener needs a separate optional package. XOAUTH2 access tokens never expire, so expiry handling needs a scripted fault to exercise. The browser build drops compression, and its in-memory STARTTLS only marks the link as encrypted.

How to use it well

Use it in the test suite of anything that talks IMAP: a mail client, a sync engine, an email agent. Start a fresh instance per test, since changes made over the protocol live only in that instance. Turn on only the extensions your client claims to support, then add the quirk presets for servers you care about, like the throttling one that refuses one command in ten. Teams outside Node can run the command line version with the HTTP control interface enabled. It does not cover sending mail, multi-user permission setups, or production use.

Technical notes+

src/index.ts default-exports a factory over IMAPServer from src/server.ts and re-exports quirks, storageSchema and the ScriptRule types. src/server.ts caps command lines at 1 MiB (MAX_LINE_LENGTH), literals at 64 MiB after login (MAX_LITERAL_SIZE, overridable via maxLiteralSize) and 64 KiB before login. src/commands/index.ts registers 26 base command handlers; src/plugins/index.ts registers 55 plugins, including imap4rev2, qresync, uidonly and xoauth2. src/script.ts validates rules against a KEYS table that maps each option to the events it applies to and throws TypeError on any mismatch. src/quirks.ts defines six presets: james-fetchgroup, james-late-fetch, yahoo-quoted-sections, m365-throttle, no-uidplus, no-move. src/rest.ts is built on node:http, binds 127.0.0.1 by default, requires a bearer token on any other address, refuses non-loopback Host headers without one, sends no CORS headers, and streams events as Server-Sent Events with protocol trace opt-in. src/store-operations.ts shares expunge and flag logic between commands and src/control.ts, and documents DEFAULT_SESSION_TIMEOUT as stored but never used. package.json declares one runtime dependency (imap-handler), smtp-server as an optional peer, and a 94 percent line-coverage threshold in its coverage script.

Observed

License
MIT (LICENSE, package.json)
Language
TypeScript, shipped as ES modules and CommonJS with type declarations
Runtime
Node.js 20 or newer (package.json engines); README states it also runs on Bun and Deno
Interfaces
Library factory, imapkit command line tool, opt-in REST control API, browser bundle
Runtime dependencies
One: imap-handler (package.json)
Optional dependency
smtp-server, declared as an optional peer dependency for the SMTP listener
Storage
In memory only, loaded from a JSON storage object; nothing is written to disk (README)
User model
Single user account shared by all connections (README Scope section)
REST API exposure
Off by default, binds 127.0.0.1, bearer token required on other addresses (src/rest.ts)
Quirk presets
Six named presets in src/quirks.ts reproducing Apache James, Yahoo and Microsoft 365 behavior, plus servers without UIDPLUS or MOVE
Package name history
Previously published as hoodiecrow-imap (README)

Read from README.md, package.json, LICENSE, src/index.ts, src/server.ts, src/commands/index.ts, src/plugins/index.ts, src/control.ts, src/rest.ts, src/quirks.ts, src/script.ts, src/framing.ts, src/store-operations.ts.

Tags

imaptestingemailnodejsmock-servermail-client

Tech Stack

Node.jsTypeScript

Media

ImapKit

Comments (0)

No comments yet

Editorially curated, with community endorsements as a secondary signal. Corrections welcome.