CLI Command Reference
SirrMesh provides a full-featured command-line tool for managing and maintaining the mail server.
Basic Commands
sirrmeshd
Main program command.
sirrmeshd [command] [flags]Global Options
--config string Configuration file path (default "~/.sirrmeshd/config.toml")
--debug Enable debug mode
--help, -h Show help information
--version, -v Show version informationService Management
run
Start the mail server.
sirrmeshd run [flags]Options:
--daemon Run in background
--pid-file string PID file pathExample:
sirrmeshd run --config /etc/sirrmeshd/config.tomlstop
Stop the running server.
sirrmeshd stoprestart
Restart the server.
sirrmeshd restartstatus
View server status.
sirrmeshd statusOutput:
Status: Running
PID: 12345
Uptime: 2d 5h 32m
Connections: 42
Messages Processed: 15,234User Management
user create
Create a new user.
sirrmeshd user create [flags]Options:
--username string Username (email address)
--password string Password
--quota string Storage quota (e.g., "5GB")
--blockchain string Blockchain wallet addressExample:
sirrmeshd user create \
--username [email protected] \
--password secretpass \
--quota 5GBuser delete
Delete a user.
sirrmeshd user delete --username [email protected]user list
List all users.
sirrmeshd user list [flags]Options:
--domain string Filter by domain
--format string Output format (table|json|csv)user modify
Modify user information.
sirrmeshd user modify \
--username [email protected] \
--quota 10GBuser password
Change user password.
sirrmeshd user password \
--username [email protected] \
--new-password newpassDomain Management
domain add
Add a new domain.
sirrmeshd domain add --name example.comdomain delete
Delete a domain.
sirrmeshd domain delete --name example.comdomain list
List all domains.
sirrmeshd domain listConfiguration Management
config init
Generate default configuration file.
sirrmeshd config init > config.tomlconfig verify
Verify configuration file.
sirrmeshd config verifyconfig get
Get configuration item.
sirrmeshd config get server.hostnameconfig set
Set configuration item.
sirrmeshd config set server.hostname mail.example.comDKIM Management
dkim generate
Generate DKIM key pair.
sirrmeshd dkim generate \
--domain example.com \
--selector default \
--bits 2048dkim show
Show DKIM public key record.
sirrmeshd dkim show --domain example.comOutput:
Add this TXT record to your DNS:
default._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBg..."Quota Management
quota get
View user quota.
sirrmeshd quota get --user [email protected]Output:
User: [email protected]
Quota: 5 GB
Used: 1.23 GB (24.6%)
Available: 3.77 GBquota set
Set user quota.
sirrmeshd quota set \
--user [email protected] \
--quota 10GBquota list
List all user quota usage.
sirrmeshd quota list --sort-by usedBackup and Restore
backup create
Create a backup.
sirrmeshd backup create \
--output /backups/sirrchat-$(date +%Y%m%d).tar.gz \
--compressOptions:
--user string Backup only specified user
--domain string Backup only specified domain
--exclude-attachments Exclude attachmentsbackup restore
Restore from backup.
sirrmeshd backup restore \
--input /backups/sirrchat-20250115.tar.gzbackup list
List available backups.
sirrmeshd backup list --path /backupsDatabase Management
db migrate
Run database migrations.
sirrmeshd db migratedb ping
Test database connection.
sirrmeshd db pingdb vacuum
Optimize database.
sirrmeshd db vacuumStorage Management
storage stats
View storage statistics.
sirrmeshd storage statsstorage test
Test storage connection.
sirrmeshd storage test --type s3storage migrate
Migrate storage backend.
sirrmeshd storage migrate \
--from local \
--to s3storage cleanup
Clean up expired data.
sirrmeshd storage cleanup \
--older-than 2y \
--dry-runModule Management
module list
List all modules.
sirrmeshd module listmodule enable
Enable a module.
sirrmeshd module enable spam-filtermodule disable
Disable a module.
sirrmeshd module disable spam-filtermodule reload
Reload a module.
sirrmeshd module reload --name spam-filterLog Management
logs view
View logs.
sirrmeshd logs view [flags]Options:
--lines int Number of lines to display (default 100)
--follow, -f Follow in real-time
--level string Filter by log level
--grep string Filter by keywordExamples:
sirrmeshd logs view --lines 50 --level error
sirrmeshd logs view --follow --grep "[email protected]"Monitoring Commands
stats
Display server statistics.
sirrmeshd statsOutput:
Server Statistics
-----------------
Uptime: 2d 5h 32m
Total Users: 1,234
Active Sessions: 42
Messages Today: 5,678
Storage Used: 125.5 GB
SMTP Statistics
---------------
Sent: 2,345
Received: 3,333
Rejected: 12
IMAP Statistics
---------------
Active Connections: 42
Commands: 12,345health
Health check.
sirrmeshd healthOutput:
✓ Database: OK
✓ SMTP: OK
✓ IMAP: OK
✓ Storage: OK
✓ Memory: OK (45% used)
✓ Disk: OK (32% used)Diagnostic Tools
diagnose
Run diagnostic checks.
sirrmeshd diagnosetest-smtp
Test SMTP functionality.
sirrmeshd test-smtp \
--from [email protected] \
--to [email protected] \
--subject "Test Email"test-imap
Test IMAP functionality.
sirrmeshd test-imap \
--user [email protected] \
--password passShell Completion
Generate shell completion scripts.
Bash
sirrmeshd completion bash > /etc/bash_completion.d/sirrmeshdZsh
sirrmeshd completion zsh > "${fpath[1]}/_sirrmeshd"Fish
sirrmeshd completion fish > ~/.config/fish/completions/sirrmeshd.fishEnvironment Variables
SIRRCHAT_CONFIG Configuration file path
SIRRCHAT_DEBUG Enable debug mode
SIRRCHAT_LOG_LEVEL Log level
SIRRCHAT_DATA_DIR Data directoryMore information: