mailclients

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package mailclients launches third-party terminal email clients — himalaya (https://github.com/pimalaya/himalaya) and meli (https://meli-email.org) — against a member's AgentBBS mailbox, as alternatives to the built-in AgentMail reader (internal/mailbox).

Like the built-in client, these run ON THE HOST, not inside the member's pod: AgentBBS mailboxes are opened with a single Dovecot master-user secret and submitted through the loopback relay, and neither of those must ever leak into a pod (see docs/mail.md). We generate a throwaway per-session config that points the client at exactly the same IMAP/SMTP paths the built-in client uses, attach the client to the SSH PTY, and delete the config on exit.

Client config schemas drift between releases, so every field the default template renders is also overridable: set AGENTBBS_HIMALAYA_CONFIG_TEMPLATE / AGENTBBS_MELI_CONFIG_TEMPLATE to a template path to replace the built-in config wholesale, and AGENTBBS_HIMALAYA_ARGS / AGENTBBS_MELI_ARGS to change the argv. Placeholders available to a template are documented on Backend.

Index

Constants

This section is empty.

Variables

View Source
var Himalaya = Client{
	// contains filtered or unexported fields
}

Himalaya is the pimalaya CLI email client.

View Source
var Meli = Client{
	// contains filtered or unexported fields
}

Meli is the meli-email.org full-screen TUI email client.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Name        string // bare handle
	Address     string // full email address
	DisplayName string // defaults to Name when empty

	IMAPHost      string
	IMAPPort      int
	IMAPPlaintext bool // dial IMAP without TLS (loopback → Dovecot master login)

	SMTPHost string
	SMTPPort int
	// SMTPPlaintext is true for the unauthenticated loopback relay (no STARTTLS).
	SMTPPlaintext bool

	Login    string // IMAP login (may be "<addr>*<master>")
	Password string // master secret
}

Backend is the resolved connection the launched client is pointed at. It mirrors mailbox.IMAPConfig: the login is the Dovecot master-user login ("<addr>*<master>"), the password is the master secret, and SMTP is the unauthenticated loopback relay. The caller builds this from the same env the built-in client reads so all three clients behave identically.

Template placeholders (for AGENTBBS_*_CONFIG_TEMPLATE overrides):

{{name}}            bare handle, e.g. alice
{{address}}         full address, e.g. alice@bbs.profullstack.com
{{display_name}}    display name (defaults to {{name}})
{{login}}           IMAP login (master-user form)
{{password}}        IMAP/SMTP password (master secret)
{{imap_host}}       IMAP host
{{imap_port}}       IMAP port
{{imap_encryption}} "none" when plaintext, else "tls"
{{smtp_host}}       SMTP host
{{smtp_port}}       SMTP port
{{smtp_encryption}} "none" when the relay is loopback/plaintext, else "start-tls"

type Client

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

Client identifies one of the supported third-party clients.

func (Client) Available

func (c Client) Available() bool

Available reports whether the client binary can be found, so the hub can lock the entry with a helpful reason instead of failing on launch.

func (Client) Name

func (c Client) Name() string

Name is the client's short name ("himalaya" / "meli").

func (Client) Run

func (c Client) Run(s ssh.Session, be Backend) error

Run generates a throwaway config for be, launches the client attached to the SSH session's PTY, and cleans up on exit. A PTY is required (ssh -t).

func (Client) Title

func (c Client) Title() string

Title is the client's display title, e.g. "Himalaya".

Jump to

Keyboard shortcuts

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