CLI コマンドリファレンス
SirrMesh は、メールサーバーの管理とメンテナンスのためのフル機能のコマンドラインツールを提供します。
基本コマンド
sirrmeshd
メインプログラムコマンド。
bash
sirrmeshd [command] [flags]グローバルオプション
bash
--config string 設定ファイルパス(デフォルト "~/.sirrmeshd/config.toml")
--debug デバッグモードを有効化
--help, -h ヘルプ情報を表示
--version, -v バージョン情報を表示サービス管理
run
メールサーバーを起動。
bash
sirrmeshd run [flags]オプション:
bash
--daemon バックグラウンドで実行
--pid-file string PID ファイルパス例:
bash
sirrmeshd run --config /etc/sirrmeshd/config.tomlstop
実行中のサーバーを停止。
bash
sirrmeshd stoprestart
サーバーを再起動。
bash
sirrmeshd restartstatus
サーバーステータスを表示。
bash
sirrmeshd status出力:
ステータス: 実行中
PID: 12345
稼働時間: 2日 5時間 32分
接続数: 42
処理済みメッセージ: 15,234ユーザー管理
user create
新しいユーザーを作成。
bash
sirrmeshd user create [flags]オプション:
bash
--username string ユーザー名(メールアドレス)
--password string パスワード
--quota string ストレージクォータ(例: "5GB")
--blockchain string ブロックチェーンウォレットアドレス例:
bash
sirrmeshd user create \
--username user@example.com \
--password secretpass \
--quota 5GBuser delete
ユーザーを削除。
bash
sirrmeshd user delete --username user@example.comuser list
すべてのユーザーをリスト。
bash
sirrmeshd user list [flags]オプション:
bash
--domain string ドメインでフィルター
--format string 出力フォーマット (table|json|csv)user modify
ユーザー情報を変更。
bash
sirrmeshd user modify \
--username user@example.com \
--quota 10GBuser password
ユーザーパスワードを変更。
bash
sirrmeshd user password \
--username user@example.com \
--new-password newpassドメイン管理
domain add
新しいドメインを追加。
bash
sirrmeshd domain add --name example.comdomain delete
ドメインを削除。
bash
sirrmeshd domain delete --name example.comdomain list
すべてのドメインをリスト。
bash
sirrmeshd domain list設定管理
config init
デフォルト設定ファイルを生成。
bash
sirrmeshd config init > config.tomlconfig verify
設定ファイルを検証。
bash
sirrmeshd config verifyconfig get
設定項目を取得。
bash
sirrmeshd config get server.hostnameconfig set
設定項目を設定。
bash
sirrmeshd config set server.hostname mail.example.comDKIM 管理
dkim generate
DKIM キーペアを生成。
bash
sirrmeshd dkim generate \
--domain example.com \
--selector default \
--bits 2048dkim show
DKIM 公開鍵レコードを表示。
bash
sirrmeshd dkim show --domain example.com出力:
この TXT レコードを DNS に追加:
default._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBg..."クォータ管理
quota get
ユーザークォータを表示。
bash
sirrmeshd quota get --user user@example.com出力:
ユーザー: user@example.com
クォータ: 5 GB
使用量: 1.23 GB (24.6%)
利用可能: 3.77 GBquota set
ユーザークォータを設定。
bash
sirrmeshd quota set \
--user user@example.com \
--quota 10GBquota list
すべてのユーザーのクォータ使用量をリスト。
bash
sirrmeshd quota list --sort-by usedバックアップとリカバリー
backup create
バックアップを作成。
bash
sirrmeshd backup create \
--output /backups/sirrchat-$(date +%Y%m%d).tar.gz \
--compressオプション:
bash
--user string 特定のユーザーのみバックアップ
--domain string 特定のドメインのみバックアップ
--exclude-attachments 添付ファイルを除外backup restore
バックアップを復元。
bash
sirrmeshd backup restore \
--input /backups/sirrchat-20250115.tar.gzbackup list
利用可能なバックアップをリスト。
bash
sirrmeshd backup list --path /backupsデータベース管理
db migrate
データベースマイグレーションを実行。
bash
sirrmeshd db migratedb ping
データベース接続をテスト。
bash
sirrmeshd db pingdb vacuum
データベースを最適化。
bash
sirrmeshd db vacuumストレージ管理
storage stats
ストレージ統計を表示。
bash
sirrmeshd storage statsstorage test
ストレージ接続をテスト。
bash
sirrmeshd storage test --type s3storage migrate
ストレージバックエンドを移行。
bash
sirrmeshd storage migrate \
--from local \
--to s3storage cleanup
期限切れデータをクリーンアップ。
bash
sirrmeshd storage cleanup \
--older-than 2y \
--dry-runモジュール管理
module list
すべてのモジュールをリスト。
bash
sirrmeshd module listmodule enable
モジュールを有効化。
bash
sirrmeshd module enable spam-filtermodule disable
モジュールを無効化。
bash
sirrmeshd module disable spam-filtermodule reload
モジュールをリロード。
bash
sirrmeshd module reload --name spam-filterログ管理
logs view
ログを表示。
bash
sirrmeshd logs view [flags]オプション:
bash
--lines int 行数(デフォルト 100)
--follow, -f リアルタイムでフォロー
--level string ログレベルでフィルター
--grep string キーワードでフィルター例:
bash
sirrmeshd logs view --lines 50 --level error
sirrmeshd logs view --follow --grep "user@example.com"モニタリングコマンド
stats
サーバー統計を表示。
bash
sirrmeshd stats出力:
サーバー統計
-----------------
稼働時間: 2日 5時間 32分
総ユーザー数: 1,234
アクティブセッション: 42
今日のメッセージ: 5,678
ストレージ使用量: 125.5 GB
SMTP 統計
---------------
送信: 2,345
受信: 3,333
拒否: 12
IMAP 統計
---------------
アクティブ接続: 42
コマンド: 12,345health
ヘルスチェック。
bash
sirrmeshd health出力:
✓ データベース: OK
✓ SMTP: OK
✓ IMAP: OK
✓ ストレージ: OK
✓ メモリ: OK (45% 使用)
✓ ディスク: OK (32% 使用)診断ツール
diagnose
診断チェックを実行。
bash
sirrmeshd diagnosetest-smtp
SMTP 機能をテスト。
bash
sirrmeshd test-smtp \
--from sender@example.com \
--to recipient@example.com \
--subject "Test Email"test-imap
IMAP 機能をテスト。
bash
sirrmeshd test-imap \
--user user@example.com \
--password passシェル補完
シェル補完スクリプトを生成。
Bash
bash
sirrmeshd completion bash > /etc/bash_completion.d/sirrmeshdZsh
bash
sirrmeshd completion zsh > "${fpath[1]}/_sirrmeshd"Fish
bash
sirrmeshd completion fish > ~/.config/fish/completions/sirrmeshd.fish環境変数
bash
SIRRCHAT_CONFIG 設定ファイルパス
SIRRCHAT_DEBUG デバッグモードを有効化
SIRRCHAT_LOG_LEVEL ログレベル
SIRRCHAT_DATA_DIR データディレクトリ詳細情報: