Repository navigation
Administration
admincmdN= in goodmail.conf turns on ⚙ → Administration for people who administer mail domains.

- Domain administrators (their own domains only): create, disable, rename, delete mailboxes; reset passwords; forward a mailbox's mail (Edit → Forward mail to, one address per line, with Also keep a copy in this mailbox); and manage aliases, including a catch-all (an alias with an empty name: "everything else" on the domain goes to the destinations you list).
- The main administrator (superadmin) also has the Domains tab: add, edit and delete domains (only when empty) and choose who administers each. Limits for mailboxes and aliases per domain are respected.

As with passwords, goodmail does not touch the mail database itself. It runs the command (split into arguments, never through a shell), writes one JSON line to its stdin, for example {"op":"mailbox.create","caller":"user@example.com",…}, and the command answers with one JSON line: {"ok":true,…} or {"error":"text shown to the user"}.
Operations: whoami, domain.get, mailbox.create, mailbox.update (name, active, password, forwards and keep-a-copy), mailbox.delete, alias.save, alias.delete, and for the main administrator domain.list, domain.save, domain.delete and admins.set.
The command decides who may do what, on every call. goodmail only says which mailbox the user signed in with, so a bug in the web interface cannot widen anyone's rights. Nothing is shown to people who are not administrators.
For Postfix + Dovecot + PostfixAdmin, using PostfixAdmin's own tables and log. A person is a domain administrator when there is an active row in admin whose username is their mailbox address, linked to their domains in domain_admins (superadmin = 1 or ALL means every domain).
Install it like goodmail-setpw: a root-owned script, a forced-command SSH user with command="sudo -n /usr/local/sbin/goodmail-admin",from="<web server IP>",no-pty,no-port-forwarding <public key>, and one sudoers line. It needs python3 with bcrypt and the mysql client as root.
Add a person with:
INSERT INTO admin (username,password,superadmin,created,modified,active)
VALUES ('person@example.com','*',0,NOW(),NOW(),1);(the * password means no separate PostfixAdmin login), plus a row in domain_admins per domain.
- Nobody can disable or delete their own mailbox, or a domain's last mailbox.
- Administrators without two-step sign-in get a warning.
- Deleting a mailbox can also remove its mail files: they are moved aside to
/var/vmail/_deleted/(root-only, so a mistake can be undone) rather than erased; otherwise they stay where they are. - Changes are written to PostfixAdmin's
logtable, so both tools stay in step.
Postfix looks an address up in the alias table by the full address first, then by @domain. A catch-all alias @example.com therefore receives mail for addresses that are neither a mailbox nor a named alias. It also collects spam sent to guessed addresses, so point it at a dedicated mailbox.
goodmail
Using it
Security
Running it