NanumOS

Mail server

A mail server that runs on NanumOS itself: it receives mail for your own domain, keeps it in your mailboxes, lets a mail program read it, and sends your people's mail on to other mail servers. It is tested in closed test networks against well-known mail servers; using it for real mail on the internet needs a few settings of your own first (see the questions below).

What it is

Like a post office with a counter and a letter box for every person. The counter takes in letters for the addresses it serves and turns away everything else; the letter box is where you read yours with any mail program. The post office also has a van: letters your people hand in for other towns are driven to the post office of that town, and if it is closed the van tries again later.

What to do now: nothing, unless you are trying it out. In a test setup, follow the steps below.

How to use it

  1. Write the settings — a file /etc/mailsrv.conf with at least domain=example.test and hostname=mx.example.test. A server without a domain does not start.
  2. Check — fetch --mailsrvd check reads the settings and keys and says what would run. To sign outgoing mail, fetch --mailsrvd dkim-keygen /var/lib/mailsrv/dkim.pem makes a key and prints the one line to publish in your domain's DNS; then add dkim=example.test:mail:/var/lib/mailsrv/dkim.pem to the settings.
  3. Start — as a service (service mail start, see the technical details) or by hand: fetch --mailsrvd run.
  4. Read mail — point a mail program at the server's IMAP port (143). Passwords are accepted only over an encrypted connection (STARTTLS on 143, or IMAPS on 993) once a certificate folder is set (tls_dir); a test setup without one has to say allow_plain=1, and Settings says so while it is on.

In Settings › Diagnostics the row 「메일 서버」 (mail server) shows the ports, how many letters wait in the queue and when the server last reported.

How it works

What this takes

Technical details
  • Command: fetch --mailsrvd [-c CONF] run|useradd ADDR|check|queue|dkim-keygen KEYFILE [BITS]. In a build without MAILSRV=1 the command says it is not in this build.
  • -m 256 gives the server room for big letters (a NanumOS program has 16 MB unless it asks); without it a big letter waits in the queue instead of going out.
  • Ports: SMTP 25, submission 587, IMAP 143 (set any to 0 to turn it off). With tls_dir set: STARTTLS on 25/587/143 and IMAPS on 993.
  • Limits: 25 MB a letter, 100 recipients, 10 errors a session, 64 connections, 8 per address, 5 wrong passwords in 10 minutes lock an address out for a while.
  • Sending (settings, defaults in brackets): outbound (1; 0 = refuse other domains), out_conn (20 connections), out_conn_domain (5 per domain), out_rate_domain (600 new letters a minute per domain), retry_base (300 s), retry_max (4 h), queue_lifetime (5 days), out_tls / out_tls_domain=DOMAIN:may|encrypt|none (may: encrypt when offered; encrypt: never send that domain anything unencrypted).
  • Encryption when sending is TLS 1.2 and opportunistic (the other server's certificate is not checked, as mail servers do without MTA-STS or DANE; those come later).
  • Per-recipient answers: queue/new/<id>.s; the state file counts out_sent, out_deferred, out_failed, out_dsn.
  • Files: /var/lib/mailsrv/users, mail/<user>/{new,cur,tmp} (Maildir), queue/, rejected/, state.
  • Contract and tests: docs/contracts/MAILSRV.md, tests/test_mailsrv.py, tests/test_mailsrv_out.py, and the lab with real mail servers (Postfix, maddy) tests/mailsrv_e2e.py.

Common questions

NanumOS 0.1.8349 · 2026-11-16