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 ¶
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.
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). |