Version of netviel that works
Find a file
Emil Lerch 0b804a0d63
All checks were successful
Generic zig build / build (push) Successful in 52s
add authn
2025-10-15 22:41:44 -07:00
.gitea/workflows change ntfy action url 2025-10-15 17:56:54 -07:00
mail add attachment functionality 2025-10-15 14:12:13 -07:00
src add authn 2025-10-15 22:41:44 -07:00
static add authn 2025-10-15 22:41:44 -07:00
.dockerignore add dockerfile multi-stage build 2025-10-15 17:32:15 -07:00
.envrc committing with one failing test, because now we need to go read files 2025-04-19 12:55:02 -07:00
.gitignore add authn 2025-10-15 22:41:44 -07:00
.mise.toml upgrade to zig 0.15.2 2025-10-15 12:27:04 -07:00
.pre-commit-config.yaml upgrade to zig 0.15.2 2025-10-15 12:27:04 -07:00
build.zig always link gmime 2025-10-15 17:20:58 -07:00
build.zig.zon add initial backend web routes 2025-10-15 14:50:37 -07:00
Dockerfile add dockerfile multi-stage build 2025-10-15 17:32:15 -07:00
flake.lock add nix flake, license, etc 2024-07-16 10:09:39 -07:00
flake.nix add beginning of email parsing (tests failing) 2025-08-15 16:39:01 -07:00
LICENSE add nix flake, license, etc 2024-07-16 10:09:39 -07:00
PLAN.md update README 2025-10-15 15:28:47 -07:00
README.md add authn 2025-10-15 22:41:44 -07:00

Zetviel

A web-based email client for notmuch, written in Zig.

As some background, I've had some issues with the very usable netviel. I wanted to address those issues, but also simplify the deployment. And, I like Zig, so I decided this was small enough I'd just re-write the thing to make my own.

Features

  • REST API for notmuch queries
  • Thread and message viewing
  • Attachment handling
  • Basic authentication for API routes
  • Security headers for safe browsing
  • Configurable port

Building

If you have notmuch installed (libnotmuch-dev on a debian-based system), zig build is all you need. If you are using nix, you can nix develop, which will install the necessary notmuch header/library, and the build system will detect and use that. Again, zig build will work in that instance, but you must nix develop first.

Usage

# Start server on default port (5000)
zetviel

# Start server on custom port
zetviel --port 8080

# Show help
zetviel --help

# Show version
zetviel --version

Configuration

  • NOTMUCH_PATH environment variable: Path to notmuch database (default: mail)
  • ZETVIEL_CREDS environment variable: Path to credentials file (default: .zetviel_creds)
  • --port: HTTP server port (default: 5000)

Authentication

Zetviel requires basic authentication for all API routes. Create a credentials file with:

echo 'username' > .zetviel_creds
echo 'password' >> .zetviel_creds

Or set a custom path:

export ZETVIEL_CREDS=/path/to/credentials

The credentials file should contain two lines:

  1. Username
  2. Password

Static files (HTML, CSS, JS) are served without authentication.

API Endpoints

  • GET /api/query/<query> - Search threads using notmuch query syntax
  • GET /api/thread/<thread_id> - Get messages in a thread
  • GET /api/message/<message_id> - Get message details with content
  • GET /api/attachment/<message_id>/<num> - Get attachment metadata
  • GET /api/auth/status - Check authentication status

Security

WARNING: Zetviel binds to 0.0.0.0 by default, making it accessible on all network interfaces. While basic authentication is required for API routes, this is intended for local or trusted network use only. Do not expose Zetviel directly to the internet without additional security measures such as:

  • Running behind a reverse proxy with HTTPS
  • Using a VPN or SSH tunnel
  • Implementing additional authentication layers
  • Restricting access via firewall rules