Built-in MTA · Webmail · SMTP Auth · DKIM

Your Email.
Your Server.

Onifast Mail is a lightweight, self-hosted mail server and webmail built directly into the Onifast ecosystem. No third-party SaaS, no per-mailbox fees — just your domain, your data.

Get Onifast Panel Setup Guide
mail.example.com
Inbox 4
Sent
Outbox
Archive
Trash
Addresses
hello@example.com
no-reply@example.com
A
alice@agency.com
10:42
Project proposal — Q3 2025
G
github@noreply.com
09:17
[onifast/panel] PR #42 merged
S
support@stripe.com
Tue
Your invoice is ready
M
mike@client.io
Mon
Re: Server migration timeline
2ports
SMTP on 25 & 587
0$
Per-mailbox cost
Addresses per domain
10MB
Max message size
SQLite
Zero-config storage
What's included

Everything a mail server needs

Onifast Mail covers the full email lifecycle — receiving, storing, sending, and managing — out of the box.

SMTP Receiving (Port 25 & 587)
Accepts inbound mail on both port 25 (MX delivery) and 587 (authenticated submission). Binds to all interfaces for full flexibility.
Outbound Mail with MX Lookup
Queued outbox processor delivers mail directly via MX record lookup or through a configured SMTP relay. Retries up to 3 times on failure.
Browser Webmail Client
Clean, dark-themed webmail interface with inbox, sent, outbox, and archive folders. Compose, reply, and manage all from the browser.
SMTP Authentication
Uses Onifast Panel user accounts for SMTP AUTH. No separate password database — panel users authenticate for outbound mail relay.
DKIM Signing
Built-in DKIM key management and signing support. Configure per-domain DKIM to improve deliverability and pass email authentication checks.
Multiple Mail Addresses
Create unlimited email addresses per domain. Each address maps to an Onifast user account and can have a custom display name.
Email Forwarding
Set any address to automatically forward incoming mail to an external destination. Forwarded mail is queued in the outbox processor.
Attachment Support
Send and receive emails with attachments. Full MIME parsing handles multipart messages, quoted-printable, and base64-encoded content.
SQLite + .eml Storage
All mail is indexed in a WAL-mode SQLite database for fast queries. Raw .eml files are also saved to disk in the user's home directory.
Mail Folders (CC / BCC)
Inbox, Sent, Outbox, Archive, and Trash folder support. Outbound mail supports CC and BCC fields for proper RFC-compliant sending.
SSO from Onifast Panel
One-click single sign-on from the panel dashboard. No need to log in separately — click the webmail link and you're in instantly.
Anti-Relay Protection
Unauthenticated relay to external domains is blocked with a proper SMTP 554 error. Only authenticated panel users can send outbound mail.
Outbox Retry Queue
Failed outbound emails are retried automatically every 10 seconds, up to 3 attempts. Last error is stored per message for easy debugging.
REST API
Full HTTP API for listing, reading, moving, sending, and managing mail addresses — accessible via the Onifast Panel proxy on port 4031.
Multi-Domain Support
Manage mail for multiple domains on the same server. Each domain has its own addresses, and domain list is driven by your panel config.

How inbound &
outbound mail works

Every email goes through a clear pipeline — from SMTP receive to SQLite storage and outbox delivery.

  • Inbound: MX delivers to port 25 → MIME parsed → stored in SQLite + .eml file
  • Forwarding: matched address triggers outbox queue automatically
  • Outbound: authenticated user submits on 587 → queued in outbox → sent via MX or relay
  • Sent copy saved to "sent" folder for the authenticated user
  • PHP mail() supported via msmtp bridge or direct SMTP on 127.0.0.1:587
  • All delivery results tracked per outbox row (pending / sent / failed)
mail flow — onifast-mail
# Inbound path (MX → Port 25)
Internet → DNS MX → :25 (SMTP)
         → MIME parse
         → mail_addresses lookup
         → save .eml + SQLite row
         → check forward_to → queue outbox

# Outbound path (Port 587)
App/PHP → :587 SMTP AUTH (panel user)
        → Rcpt check (local or relay)
        → insert outbox row
        → processOutbox() every 10s
          → MX lookup OR SMTP relay
          → mark sent / retry on fail

# PHP mail() bridge
sendmail_path = "/usr/bin/msmtp -t"
host = 127.0.0.1  port = 25
      
php — PHPMailer direct SMTP
use PHPMailer\PHPMailer\PHPMailer;

$mail = new PHPMailer(true);

// Connect to local onifast-mail
$mail->isSMTP();
$mail->Host       = '127.0.0.1';
$mail->SMTPAuth   = true;
$mail->Username   = 'your_panel_user';
$mail->Password   = 'your_password';
$mail->Port       = 587;

$mail->setFrom('hello@yourdomain.com');
$mail->addAddress('user@external.com');

$mail->isHTML(true);
$mail->Subject = 'Hello from Onifast Mail!';
$mail->Body    = '<p>Sent via local MTA.</p>';
$mail->send();
      

Works with any
PHP application

Integrate Onifast Mail into WordPress, Laravel, or any PHP app in two ways.

  • PHPMailer / SMTP (Recommended)
    Connect directly to 127.0.0.1:587 with your panel credentials. Handles errors synchronously.
  • msmtp Bridge
    Install msmtp, set sendmail_path in php.ini. PHP's native mail() function routes through onifast-mail on port 25.
  • REST API
    POST to /api/mail/send via the panel proxy (port 4031). Suitable for server-side scripts and automation.
Setup

Enabling Onifast Mail

Mail is included in Onifast Panel Pro and above. Enable it in a few clicks.

1
Install Onifast Panel (Pro+)
Onifast Mail ships with all panel installations. No separate download needed.
wget -qO- https://download.onifast.com/latest/install.sh | sudo bash
2
Add your MX DNS record
Point your domain's MX record to your server so inbound mail arrives at port 25.
MX example.com → mail.example.com (priority 10)
3
Create mail addresses in the panel
Go to Panel → Mail → Addresses and add addresses for your domain. Assign each to a user.
4
Configure DKIM & open webmail
Generate a DKIM key from Panel → Mail → DKIM, add the TXT record to DNS, then click Open Webmail to SSO in.

Email on your terms.
No SaaS. No subscriptions.

Get Onifast Panel and have your own mail server running in minutes.

Get Onifast Panel Onifast.com