Table of contents
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Operations — 運用 Runbook
毎日使うコマンド集。正本ドキュメントはリポジトリ側(README.md, QUEUE-COLLECTION-DOCS.md 等)。
SSH(ロケール対策必須)
ssh old
ssh mox # LC_ALL 警告が出る場合は下記ラッパー
ssh npm
# リモート実行テンプレ
ssh mox 'env LANG=C LC_ALL=C bash --login -c "コマンド"'
恒久対策: /root/.bashrc 等に export LANG=en_US.UTF-8 / LC_ALL=en_US.UTF-8 追記。
Mox CLI
/usr/local/bin/mox version
/usr/local/bin/mox help [$command]
# 管理者・アカウント
mox setadminpassword
mox setaccountpassword $addr
mox config account list
mox config alias list m-seed.biz
mox config domain add m-seed.biz admin
# インポート/エクスポート
mox import maildir $account $mailbox $maildirpath
mox export maildir [-single] $dstdir $accountpath [$mailbox]
# サービス・メンテ
mox serve
mox stop
mox recalculatemailboxcounts admin
mox checkupdate
注意: mox import の第4引数は new/cur/tmp が直下にあるパスを指定。DataDir(/var/lib/mox/)配下に置くこと。
キュー監視・回収
collect-queue.sh+queue-collect.conf— キュー回収スクリプトqueue_to_maildir.py— キュー→Maildir変換QUEUE-COLLECTION-DOCS.mdが仕様書
ssh old 'mailq' # 旧キュー枯渇確認(切替前は 0 に)
tail -F /var/log/mox.log # mox側監視(要実機パス確認)
バックアップ/リストア
- Proxmox 日次×2世代(VM単位、短期障害復旧用)
- 長期保存の正本は mox現用ストレージ
- 1通単位の復元は対象外
TLS・DNS定期確認
dig MX m-seed.biz @8.8.8.8
dig TXT _dmarc.m-seed.biz
openssl s_client -connect mail.m-seed.biz:993 -servername mail.m-seed.biz
openssl s_client -starttls smtp -connect mail.m-seed.biz:587 -servername mail.m-seed.biz
SPF/DKIM/DMARC の正本は Network、切替当日の手順は Migration のチェックリスト参照。
パスワード
- 管理者ヒント
admin@123—/etc/mox/adminpasswdのbcryptハッシュは未検証扱い。初回ログイン時に確認・リセット - リセット:
mox setadminpasswordまたはmox setaccountpassword