9biff is a lightweight Go daemon that monitors an IMAP4 mailbox for new messages and writes formatted notifications to configurable 9P endpoints.
  • Go 98.3%
  • Makefile 1.4%
  • Dockerfile 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Mike 'Fuzzy' Partin ce30a19d38
All checks were successful
Test and Release / test (pull_request) Successful in 1m53s
Test and Release / lint (pull_request) Successful in 2m43s
feat: add {{.To}} template variable for notification rendering
2026-06-30 19:07:15 -07:00
.forgejo/workflows feat: add ci/cd workflows and project configuration files 2026-06-29 04:35:15 -07:00
cmd/9biff feat: add multi-account support with per-account endpoints 2026-06-30 18:59:04 -07:00
internal feat: add {{.To}} template variable for notification rendering 2026-06-30 19:07:15 -07:00
pkg feat: add {{.To}} template variable for notification rendering 2026-06-30 19:07:15 -07:00
vendor feat: add imap and message libraries for email handling 2026-06-29 05:05:52 -07:00
.gitignore feat: persist last seen UID to disk across restarts 2026-06-30 04:29:18 -07:00
.golangci.yml feat: add ci/cd workflows and project configuration files 2026-06-29 04:35:15 -07:00
.goreleaser.yml feat: add observability, security hardening, performance, and release pipeline 2026-06-29 05:53:52 -07:00
.pre-commit-config.yaml feat: add ci/cd workflows and project configuration files 2026-06-29 04:35:15 -07:00
9biff.service feat: add integration tests, documentation, and build packaging 2026-06-29 05:47:11 -07:00
config.example.yaml feat: add multi-account support with per-account endpoints 2026-06-30 18:59:04 -07:00
Dockerfile feat: add integration tests, documentation, and build packaging 2026-06-29 05:47:11 -07:00
go.mod feat: add imap and message libraries for email handling 2026-06-29 05:05:52 -07:00
go.sum feat: add imap and message libraries for email handling 2026-06-29 05:05:52 -07:00
Makefile feat: add observability, security hardening, performance, and release pipeline 2026-06-29 05:53:52 -07:00
README.md feat: add integration tests, documentation, and build packaging 2026-06-29 05:47:11 -07:00
ROADMAP.md docs: mark Phase 7 production readiness tasks as complete 2026-06-29 05:54:09 -07:00

9biff

IMAP-to-9P notification bridge. Monitor an IMAP mailbox and write new message notifications to 9P file endpoints.

Quick Start

go build ./cmd/9biff
cp config.example.yaml config.yaml
# Edit config.yaml with your IMAP credentials and 9P endpoints
./9biff -config config.yaml

Configuration

9biff supports YAML, JSON, and TOML configuration files. Format is auto-detected from the file extension.

Field Type Required Default Description
imap.host string yes IMAP server hostname
imap.port int yes 993 IMAP server port
imap.tls string yes tls TLS mode: tls, starttls, none
imap.username string yes IMAP login username
imap.password string yes IMAP login password
mailbox string no INBOX Mailbox to monitor
interval duration no 60s Poll interval
template string no {{.FromName}} <{{.From}}> - {{.Subject}} Global default template
endpoints array yes List of 9P endpoints
batch.enabled bool no false Enable message batching
batch.size int no 10 Max messages per batch
batch.timeout duration no 5s Max wait before flushing batch

Endpoint Fields

Field Type Required Default Description
url string yes 9P server URL (tcp://host:port or unix:///path)
template string no Per-endpoint template override
file_path string no / File path within 9P filesystem
timeout duration no 30s Connection timeout
overwrite bool no false Overwrite file instead of appending

Environment Variable Overrides

All config values can be overridden via environment variables:

Variable Config Field
9BIFF_IMAP_HOST imap.host
9BIFF_IMAP_PORT imap.port
9BIFF_IMAP_TLS imap.tls
9BIFF_IMAP_USERNAME imap.username
9BIFF_IMAP_PASSWORD imap.password
9BIFF_MAILBOX mailbox
9BIFF_INTERVAL interval
9BIFF_TEMPLATE template

Template Syntax

Notifications are rendered using Go's text/template syntax. Available template fields:

Field Type Description
.From string Sender email address
.FromName string Sender display name
.Subject string Email subject
.Timestamp time.Time Message date/time
.MessageID string Unique message identifier
.Snippet string First 200 characters of body
.Body string Full plain text body

Template Functions

Function Description Example
truncate N Truncate to N chars {{truncate 50 .Subject}}
timefmt "layout" Format timestamp {{timefmt "15:04" .Timestamp}}
upper Uppercase {{upper .Subject}}
lower Lowercase {{lower .From}}

Template Examples

# Default
{{.FromName}} <{{.From}}> - {{.Subject}}

# With timestamp
[{{timefmt "2006-01-02 15:04:05" .Timestamp}}] {{.From}} - {{.Subject}}

# Full detail
From: {{.FromName}} <{{.From}}>
Subject: {{.Subject}}
Date: {{timefmt "2006-01-02 15:04:05" .Timestamp}}
{{truncate 100 .Snippet}}

# Just subject
{{.Subject}}

Command-Line Flags

Flag Description
-config <path> Path to configuration file (default: config.yaml)
-version Display version and exit

License

MIT