The same program is the server and a handful of commands. Commands read /etc/mailrust/mailrust.env, so they find the data folder by themselves.
Commands
| Command | What it does |
|---|---|
mailrust | Runs the server; the same as mailrust serve. The service does this |
mailrust setup-link | Prints the first-run link, while there is no administrator yet |
mailrust passwd | Sets a person's password and signs them out everywhere |
mailrust assist | Gives a person a key for the writing assistant |
mailrust license | Shows the edition and the license |
mailrust license set KEY | Installs a license key; the key can also come on standard input |
mailrust license trial | Starts the 14-day Business trial |
mailrust update | Installs the new version and restarts the service |
mailrust update --check | Only tells whether there is a new version |
mailrust version | Prints the program version and the database schema |
mailrust help | Lists the commands and the main settings |
Whose data
Commands that open the database run as the user who owns the data folder. The installer creates the user mailrust, so:
sudo -u mailrust mailrust setup-link
Run as root, such a command refuses and names the right user. mailrust update is the exception: it replaces the program and restarts the service, so it runs as root.
Set a password
The login and the new password come from the environment, never from the command line, which other users of the server can see.
sudo -u mailrust env MAILRUST_USER=anna MAILRUST_PASS='a long new password' mailrust passwd
The person's open sessions are closed.
Give someone the writing assistant
People can add a key themselves in their settings. When an administrator hands out the key instead:
sudo -u mailrust env MAILRUST_USER=anna MAILRUST_ASSIST_PROVIDER=anthropic \
MAILRUST_ASSIST_KEY_FILE=/root/anna.key mailrust assist
| Setting | What it is |
|---|---|
MAILRUST_USER | The person's login |
MAILRUST_ASSIST_PROVIDER | anthropic, openai, gemini, xai, deepseek, mistral, groq, openrouter or custom |
MAILRUST_ASSIST_KEY_FILE | File with the key; or MAILRUST_ASSIST_KEY with the key itself |
MAILRUST_ASSIST_MODEL | A model of that provider; optional |
MAILRUST_ASSIST_ADDRESS | For custom: the address of a service compatible with the OpenAI API |
The key is checked with a test request before it is saved, and it is stored encrypted.
Version
mailrust version
mailrust 0.9.0 (schema 64)