Documentation
¶
Overview ¶
Package mailu provisions member mailboxes on the self-hosted Mailu stack via its admin REST API. Every verified AgentBBS member gets a real mailbox at <name>@<domain> (e.g. alice@bbs.profullstack.com); the agentbbs gateway then opens it over IMAP with the Dovecot master user, so members never manage an IMAP/SMTP password. Mailbox creation is the one thing that must happen up front, which is what EnsureUser does (idempotently).
The Mailu admin API listens on the loopback HTTP front (default http://127.0.0.1:8080) and authenticates with the token set as API_TOKEN in mailu.env. When no token is configured Configured() reports false and callers skip provisioning (the address is still shown).
Config (env):
AGENTBBS_MAIL_ADMIN_URL Mailu admin base URL (default http://127.0.0.1:8080) AGENTBBS_MAIL_API_TOKEN Mailu API token (from mailu.env API_TOKEN) AGENTBBS_MAIL_QUOTA_BYTES per-mailbox quota in bytes (default 1 GiB)
Index ¶
Constants ¶
const DefaultQuotaBytes = 1 << 30
DefaultQuotaBytes is the per-mailbox storage quota when unset (1 GiB).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to the Mailu admin REST API.
func (*Client) Configured ¶
Configured reports whether mailboxes can actually be provisioned.
func (*Client) EnsureUser ¶
EnsureUser creates email@... if it doesn't exist. It is idempotent: an existing mailbox (or an "already exists" create response) is success. The generated password is unused by members — the gateway master user opens every mailbox — but Mailu requires one at creation time.
func (*Client) SetPassword ¶
SetPassword sets the mailbox password (so the member can log into webmail). The gateway opens mailboxes via the Dovecot master user and never needs this, but webmail (Roundcube) requires the member to have a known password.