Getting started
Configuration
Configure local hosts, ports, recipient domains, and resource limits.InboxTap has explicit CLI flags and programmatic server options. It does not read a configuration file in v1.4.1.
Defaults
| Setting | Default |
|---|---|
| SMTP host | localhost (binds 127.0.0.1 and ::1) |
| SMTP port | 1025 |
| HTTP API host | localhost (binds 127.0.0.1 and ::1) |
| HTTP API port | 8025 |
| Recipient domain | local.test |
| Retained messages | 100 |
| Maximum message size | 5242880 bytes (5 MiB) |
CLI options
--smtp-host <host> SMTP host
--smtp-port <port> SMTP port, 0–65535
--api-host <host> HTTP API host
--api-port <port> HTTP API port, 0–65535
--domain <domain> Test recipient domain
--max-messages <count> Messages retained in memory
--max-message-size <bytes> Maximum accepted SMTP message sizeThe optional start word is accepted, so inboxtap and inboxtap start are equivalent.
Run multiple instances
Choose distinct ports and, optionally, a distinct recipient domain:
inboxtap --smtp-port 2025 --api-port 9025 --domain mail.local.testPoint the application at SMTP port 2025 and create the client with the matching API base URL:
const inboxTap = new InboxTapClient({ baseUrl: "http://localhost:9025" });Programmatic server
Tests can import the server and request ephemeral ports with 0:
import { InboxTapServer } from "inboxtap";
const server = await new InboxTapServer({
apiPort: 0,
smtpPort: 0,
maxMessages: 50,
}).start();
console.log(server.apiUrl);
await server.stop();The bound ports are available on server.apiPort and server.smtpPort after start() resolves.