mail

package
v0.115.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mail is Caprock Mail: an IMAP/SMTP client that keeps every inbox the user adds in one local database (mail.db, beside Caprock's own) and serves it to the dashboard under /v1/mail.

It is an integration the user switches on by adding an account (ADR-047): until then nothing is opened, no goroutine runs and nothing leaves the machine. Once an account exists, Caprock talks only to the IMAP and SMTP servers the user typed in, and — when local AI is turned on — to the model server at the address in Mail's settings (loopback by default).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service owns Mail's database and sync engine, both opened on first use.

func New

func New(dataDir string, log *slog.Logger) *Service

New prepares Mail under dataDir. If Mail was used before (mail.db exists) its accounts start syncing at once; otherwise nothing happens until the dashboard asks.

CAPROCK_MAIL_DEMO=1 replaces everything with two sample accounts on in-process fake servers and a throwaway database, for screenshots and for trying the screen without a real account.

func (*Service) Close

func (s *Service) Close()

Close stops syncing and closes the database.

func (*Service) Handler

func (s *Service) Handler() http.Handler

Handler serves /v1/mail/*. Caprock's router puts it behind the same CSRF guard and device pairing as every other /v1 route.

Directories

Path Synopsis
Package ai talks to a local model through the OpenAI-compatible API that Ollama, LM Studio and llama.cpp all serve.
Package ai talks to a local model through the OpenAI-compatible API that Ollama, LM Studio and llama.cpp all serve.
Package engine talks to mail servers: it keeps the local copy in step with IMAP, applies the user's actions there, and sends over SMTP.
Package engine talks to mail servers: it keeps the local copy in step with IMAP, applies the user's actions there, and sends over SMTP.
Package fakemail runs an in-memory IMAP and SMTP server on loopback, for tests and for the demo mode that previews the client without a real account.
Package fakemail runs an in-memory IMAP and SMTP server on loopback, for tests and for the demo mode that previews the client without a real account.
Package store owns the SQLite database.
Package store owns the SQLite database.
Package providers knows the server settings of common mail hosts, so adding an account is an address and a password.
Package providers knows the server settings of common mail hosts, so adding an account is an address and a password.
Package secrets keeps account passwords out of the database: in the OS keychain (macOS Keychain, Windows Credential Manager, Secret Service).
Package secrets keeps account passwords out of the database: in the OS keychain (macOS Keychain, Windows Credential Manager, Secret Service).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL