A carrier-grade XMPP server written in Zig https://www.xmppd.org/
  • Zig 91.4%
  • Python 7.8%
  • Shell 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Daniel Morante 80a5a7f65e T156: bump MAX_IPC_CLIENTS 16→80; reject pre-auth SM enable with <failed/>
- T156: IPC client pool exhaustion — 16 slots could be consumed by
  workers >= 16, locking out xmppctl. Bumped to 80 (64 worker cap +
  16 headroom for xmppctl/s2s/monitoring).
- XEP-0198 compliance: send <failed condition='unexpected-request'/>
  when client sends <enable/> before resource bind instead of silently
  ignoring. SINT testEnableBeforeLogin now passes.
- SINT XEP-0198 score: 10/10 (was 9/10).
2026-07-16 00:07:59 -04:00
benchmarks/tsung benchmarks: add throughput test (100 users, 100 msgs, 0.05s thinktime) 2026-06-10 16:17:58 -04:00
config feat(v1a): thread-per-core — SO_REUSEPORT multi-socket + worker threads 2026-06-07 22:54:42 -04:00
doc T157: add [oidc] import_avatar config gate; T158: SM detach-timer unit tests 2026-07-02 01:04:46 -04:00
etc/rc.d Phase 12: privilege separation — master runs as root, children drop to configured user 2026-06-07 01:39:05 -04:00
lib T158: advertise XEP-0077 IBR in stream features + disco#info; fix SM resume dangling JID 2026-07-02 02:44:36 -04:00
src T156: bump MAX_IPC_CLIENTS 16→80; reject pre-auth SM enable with <failed/> 2026-07-16 00:07:59 -04:00
test/integration fix: SM resume silently dropped at features_bind, stream ID reuse (RFC 6120) 2026-07-01 22:15:54 -04:00
.gitignore Fix interop: vCard, IQ from, MUC stability, TLS drain, OIDC auth 2026-06-13 03:13:53 -04:00
build.zig v0.8.0 WIP: SM resume fix, quick-win XEPs, Entity Capabilities 2026-06-19 02:19:52 -04:00
build.zig.zon Phase 5: Storage trait interface + LMDB backend (10a + 10b) 2026-06-03 19:28:14 -04:00
CHANGELOG.md doc: CHANGELOG for v0.6.0 2026-06-14 18:19:56 -04:00
LICENSE Initial scaffold + XMPP protocol library (Phase 1) 2026-06-01 15:46:04 -04:00
README.md README: update RFC 6121 compliance notes, retract v0.6.0 tag 2026-06-13 18:42:26 -04:00
ROADMAP.md T157: add [oidc] import_avatar config gate; T158: SM detach-timer unit tests 2026-07-02 01:04:46 -04:00

xmppd

A carrier-grade XMPP server written in Zig, inspired by Postfix's architecture.

License

Overview

xmppd is a modern XMPP server designed for carrier-grade deployments. It draws architectural inspiration from Postfix — separation of concerns, privilege separation, sensible defaults — while leveraging Zig's async I/O and compile-time polymorphism for performance at scale.

Key Features (planned)

  • Hybrid process model — master daemon supervises isolated components
  • Async I/O — kqueue/kevent event loop handles millions of concurrent connections
  • DANE-first — TLSA certificate validation as primary trust path for S2S federation
  • Pluggable storage — RocksDB (default), PostgreSQL, MariaDB, LDAP
  • Pluggable auth — internal, LDAP, OIDC, PAM
  • Postfix admin UX — one package, one config, one service

Target Platforms

  • Primary: FreeBSD (kqueue)
  • Secondary: Linux (epoll, post-MVP)

Standards Compliance

Standard Description Support Tested
RFC 6120 XMPP Core (STARTTLS, SASL, resource binding) Full E2E, Unit
RFC 6121 XMPP IM (roster, presence, messaging) Partial¹ Interop, E2E, Unit
XEP-0030 Service Discovery Full Interop
XEP-0045 Multi-User Chat Partial² Interop, E2E, Unit
XEP-0054 vCard-temp Full Interop
XEP-0077 In-Band Registration Full E2E, Unit
XEP-0084 User Avatar (via PEP) Full E2E
XEP-0085 Chat State Notifications Full Interop
XEP-0092 Software Version Full Interop
XEP-0160 Offline Message Storage Full E2E, Unit
XEP-0163 Personal Eventing Protocol Partial³ E2E
XEP-0184 Message Delivery Receipts Pass-through E2E
XEP-0191 Blocking Command Full E2E, Unit
XEP-0198 Stream Management Partial⁴ E2E
XEP-0199 XMPP Ping Full Interop
XEP-0220 Server Dialback Partial E2E
XEP-0280 Message Carbons Full E2E, Unit
XEP-0308 Last Message Correction Pass-through E2E
XEP-0313 Message Archive Management Full E2E, Unit
XEP-0359 Unique and Stable Stanza IDs Full Unit
XEP-0440 SASL Channel-Binding Type Negotiation Full Unit

Interop = automated smack-sint-server-extensions v1.7.2 (495 tests available), E2E = verified with Gajim, Conversations, and/or Dino, Unit = Zig unit tests (738 tests), Pass-through = server forwards stanzas without interpretation; no server-side logic required.

¹ Multi-resource routing (§8.5) implemented: priority-based delivery, full JID forwarding, chat fallback. Roster push notifications after subscription changes not yet implemented. Roster set validation (multi-item, unauthorized, duplicate groups) incomplete.

² MUC core functionality works (join, part, groupchat, kick, ban, history, MAM, disco). Missing: room configuration forms (XEP-0045 §10), invitations (§7.8), voice requests.

³ PEP supports publish, subscribe, auto-subscribe, auto-create, persistent items, and avatar metadata notifications. Not a full XEP-0060 PubSub service.

⁴ SM supports enable, ack requests (<r/>), and ack responses (<a/>). Session resume is not implemented — sessions cannot be resumed after disconnection.

Building

Requires Zig 0.15.2+.

zig build

Run tests:

zig build test

Project Structure

lib/          XMPP protocol library (reusable)
  xml/        Streaming XML parser (XMPP subset)
  xmpp/       Stanza types, JID, protocol state machine
  sasl/       SASL mechanisms (SCRAM-SHA-256, PLAIN, EXTERNAL)
  tls/        STARTTLS + DANE/TLSA
  dns/        SRV, TLSA record resolution
src/          Server daemons
  master/     Master process supervisor
  core/       C2S listener, stanza router, presence engine
  auth/       Authentication daemon
  store/      Storage daemon + backends
  s2s/        S2S federation daemon
  muc/        Multi-User Chat service
  ctl/        xmppctl admin CLI
config/       Sample configuration
doc/          Documentation
test/         Integration and compliance tests

License

BSD-2-Clause. See LICENSE.

Copyright (c) 2026, Daniel Morante.