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

SettingDefault
SMTP hostlocalhost (binds 127.0.0.1 and ::1)
SMTP port1025
HTTP API hostlocalhost (binds 127.0.0.1 and ::1)
HTTP API port8025
Recipient domainlocal.test
Retained messages100
Maximum message size5242880 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 size

The 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.test

Point 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.