Skip to content

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.toml

stop

실행 중인 서버 중지.

bash
sirrmeshd stop

restart

서버 재시작.

bash
sirrmeshd restart

status

서버 상태 보기.

bash
sirrmeshd status

출력:

상태: 실행 중
PID: 12345
업타임: 2d 5h 32m
연결: 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 5GB

user delete

사용자 삭제.

bash
sirrmeshd user delete --username user@example.com

user 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 10GB

user password

사용자 비밀번호 변경.

bash
sirrmeshd user password \
  --username user@example.com \
  --new-password newpass

도메인 관리

domain add

새 도메인 추가.

bash
sirrmeshd domain add --name example.com

domain delete

도메인 삭제.

bash
sirrmeshd domain delete --name example.com

domain list

모든 도메인 목록 보기.

bash
sirrmeshd domain list

설정 관리

config init

기본 설정 파일 생성.

bash
sirrmeshd config init > config.toml

config verify

설정 파일 검증.

bash
sirrmeshd config verify

config get

설정 항목 가져오기.

bash
sirrmeshd config get server.hostname

config set

설정 항목 설정.

bash
sirrmeshd config set server.hostname mail.example.com

DKIM 관리

dkim generate

DKIM 키 쌍 생성.

bash
sirrmeshd dkim generate \
  --domain example.com \
  --selector default \
  --bits 2048

dkim show

DKIM 공개 키 레코드 표시.

bash
sirrmeshd dkim show --domain example.com

출력:

DNS에 다음 TXT 레코드를 추가하세요:

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 GB

quota set

사용자 쿼터 설정.

bash
sirrmeshd quota set \
  --user user@example.com \
  --quota 10GB

quota 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.gz

backup list

사용 가능한 백업 목록 보기.

bash
sirrmeshd backup list --path /backups

데이터베이스 관리

db migrate

데이터베이스 마이그레이션 실행.

bash
sirrmeshd db migrate

db ping

데이터베이스 연결 테스트.

bash
sirrmeshd db ping

db vacuum

데이터베이스 최적화.

bash
sirrmeshd db vacuum

스토리지 관리

storage stats

스토리지 통계 보기.

bash
sirrmeshd storage stats

storage test

스토리지 연결 테스트.

bash
sirrmeshd storage test --type s3

storage migrate

스토리지 백엔드 마이그레이션.

bash
sirrmeshd storage migrate \
  --from local \
  --to s3

storage cleanup

만료된 데이터 정리.

bash
sirrmeshd storage cleanup \
  --older-than 2y \
  --dry-run

모듈 관리

module list

모든 모듈 목록 보기.

bash
sirrmeshd module list

module enable

모듈 활성화.

bash
sirrmeshd module enable spam-filter

module disable

모듈 비활성화.

bash
sirrmeshd module disable spam-filter

module 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

출력:

서버 통계
-----------------
업타임: 2d 5h 32m
전체 사용자: 1,234
활성 세션: 42
오늘의 메시지: 5,678
사용된 스토리지: 125.5 GB

SMTP 통계
---------------
발송: 2,345
수신: 3,333
거부: 12

IMAP 통계
---------------
활성 연결: 42
명령: 12,345

health

헬스 체크.

bash
sirrmeshd health

출력:

✓ 데이터베이스: OK
✓ SMTP: OK
✓ IMAP: OK
✓ 스토리지: OK
✓ 메모리: OK (45% 사용)
✓ 디스크: OK (32% 사용)

진단 도구

diagnose

진단 검사 실행.

bash
sirrmeshd diagnose

test-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/sirrmeshd

Zsh

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    데이터 디렉터리

자세한 정보:

Released under the GPL 3.0 License.