Skip to main content

Installation

Get started with Fumi by installing it with Bun.

Prerequisites

Fumi requires Bun 1.0.0 or higher. If you don’t have Bun installed, visit bun.sh for installation instructions.
Fumi is built specifically for Bun and takes advantage of Bun’s native performance. It does not support Node.js.

Install Fumi

Install Fumi using Bun’s package manager:
bun add @puiusabin/fumi
This will install the latest version of Fumi and its dependency bun-smtp.

Verify Installation

Create a simple test file to verify your installation:
1

Create a test file

Create a new file called test.ts:
test.ts
import { Fumi } from "@puiusabin/fumi";

const app = new Fumi({ authOptional: true });

app.onConnect(async (ctx, next) => {
  console.log(`Connection from ${ctx.session.remoteAddress}`);
  await next();
});

console.log("Starting Fumi SMTP server on port 2525...");
await app.listen(2525);
console.log("Server is running!");
2

Run the test server

Run your test file with Bun:
bun test.ts
You should see:
Starting Fumi SMTP server on port 2525...
Server is running!
3

Test the connection

In another terminal, test the server with telnet:
telnet localhost 2525
You should receive a 220 banner response from the SMTP server. Type QUIT to close the connection.
If you see “Connection from 127.0.0.1” in your server logs, your installation is working correctly!

TypeScript Support

Fumi is written in TypeScript and includes complete type definitions. No additional @types packages are needed. For the best development experience, ensure you have TypeScript 5 or higher:
bun add -d typescript

Project Structure

A typical Fumi project structure looks like this:
my-smtp-server/
├── src/
│   ├── index.ts          # Main server entry point
│   ├── plugins/          # Custom plugins
│   └── handlers/         # Middleware handlers
├── package.json
└── tsconfig.json

Next Steps

Quick Start

Build your first complete SMTP server

Configuration

Learn about available configuration options

Build docs developers (and LLMs) love