Running mailrust

Command line

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

CommandWhat it does
mailrustRuns the server; the same as mailrust serve. The service does this
mailrust setup-linkPrints the first-run link, while there is no administrator yet
mailrust passwdSets a person's password and signs them out everywhere
mailrust assistGives a person a key for the writing assistant
mailrust licenseShows the edition and the license
mailrust license set KEYInstalls a license key; the key can also come on standard input
mailrust license trialStarts the 14-day Business trial
mailrust updateInstalls the new version and restarts the service
mailrust update --checkOnly tells whether there is a new version
mailrust versionPrints the program version and the database schema
mailrust helpLists 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
SettingWhat it is
MAILRUST_USERThe person's login
MAILRUST_ASSIST_PROVIDERanthropic, openai, gemini, xai, deepseek, mistral, groq, openrouter or custom
MAILRUST_ASSIST_KEY_FILEFile with the key; or MAILRUST_ASSIST_KEY with the key itself
MAILRUST_ASSIST_MODELA model of that provider; optional
MAILRUST_ASSIST_ADDRESSFor 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)