제 19장 컴플라이언스, 스토리지 및 운영 Admin: #pAlerts

운영 대시보드, 알림 및 실시간 텔레메트리

작업 대시보드(#pOps)는 실시간 및 24시간 기록으로 분당 송수신 메일 수, 지연 및 반송 메일, 스팸률, 로그인 실패 횟수, 큐 크기 및 가장 오래된 메시지의 경과 시간, 프로토콜별 활성 연결, CPU, 메모리, 여유 디스크 공간, 데이터베이스 크기, 인증서 만료일 및 클러스터 노드를 표시합니다. 알림(#pAlerts)은 이메일, 웹훅, SMS, 텔레그램, 시그널 또는 왓츠앱을 통해 위반 사항을 보고합니다. 외부 도구는 /metrics(Prometheus), OpenTelemetry 또는 실시간 이벤트 스트림(Server-Sent Events)을 통해 동일한 데이터를 읽습니다.

운영 팁 및 아키텍처 참고 사항

첫 시작 시 nextxch는 타겟이 없는 5개의 규칙(큐 정체, 디스크 거의 참, 인증서 만료, 다수의 로그인 실패, 다수의 반송)을 생성합니다. 이들은 기록에 나타납니다. 알림을 받으려면 대상(Targets) 아래에 이메일 주소나 웹훅을 추가하고 규칙에서 체크 표시를 하세요. 기록은 재시작 후에도 유지됩니다(Ops:PersistHistory = false는 이를 끕니다).

모니터링 도구를 위한 실시간 이벤트 스트림

관리자 API와 동일한 인증(X-Api-Key, Bearer 또는 Basic을 통한 관리자의 API 키). 테넌트 관리자는 자신의 테넌트만 볼 수 있습니다. 필터: types, direction, status, q; maxRate는 초당 이벤트 수를 제한하며(기본값 20, 최대 200), 초과분은 드롭된 이벤트로 보고됩니다.

참조 / 구성
curl -N -H "X-Api-Key: $NEXTXCH_KEY" \
  "https://mail.company.com/api/admin/telemetry/stream?types=delivery,rejection,auth-failure&maxRate=50"

event: delivery
data: {"at":"2026-11-02T08:15:01Z","direction":"Outbound","status":"Delivered","from":"billing@company.com","to":"customer@example.com","code":250,...}

event: auth-failure
data: {"account":"info@company.com","protocol":"IMAP","remoteIp":"203.0.113.7","reason":"invalid password"}

# Types: delivery, rejection, auth-failure, filter, alert, queue

프로토콜 로그: 파일 및 설정

데이터 디렉토리의 범주 및 일자별 탭 구분 파일 1개; SMTP AUTH LOGIN의 사용자 이름과 비밀번호는 [REDACTED]로 기록됩니다. 설정은 logging-settings.json 또는 GET/PUT /api/admin/protocol-log/settings를 통해 관리합니다.

참조 / 구성
{DataDirectory}/logs/protocol/mapi-2026-11-11.log
{DataDirectory}/logs/protocol/jmap-2026-11-11.log
# columns (tab): UTC time (yyyy-MM-ddTHH:mm:ss.fffZ), session, IP, direction, text

# {DataDirectory}/logging-settings.json
{
  "Enabled": true,
  "RetentionDays": 30,
  "Categories": { "application": true, "smtp": true, "smtp-out": true, "delivery": true, "auth": true,
                  "imap": false, "mapi": true, "jmap": true, "webdav": false }
}
# Categories: application, smtp, smtp-out, delivery, auth, imap, pop3, activesync, ews, mapi, jmap, webdav

설정, 기본값 및 모범 사례

설정 / 위치 설명 기본값 프로덕션 모범 사례
Alarmregel 메트릭, 조건(>, >=, <, <=), 임계값 및 지속 시간(분 단위). 알림은 중단 없이 해당 조건이 지속될 때만 발생합니다. 5 min 짧은 스파이크 무시: 속도(분당)의 경우 최소 5분, 인증서 만료의 경우 0분.
Abklingzeit, Wiederholung, Entwarnung 쿨다운은 동일한 규칙의 두 메시지 사이의 최소 시간이며, 반복은 알림이 활성화되어 있는 동안 상기시키고, 복원은 종료를 보고합니다. 60 min / aus / an 값이 변동될 때마다 불필요한 호출(paging)이 발생하지 않도록 쿨다운을 30분 이상으로 유지하십시오.
Ziele 이메일(설정을 저장한 관리자가 발신자), 알림의 채널을 통한 웹훅(nextxch.alert 유형의 JSON, X-Nextxch-Signature: sha256=... 서명됨), SMS, 텔레그램, 시그널, 왓츠앱. - 메일 서버 외부에 하나 이상의 대상(SMS, 메신저 또는 웹훅)을 추가하십시오. 전달이 중단되면 알림 메일이 도착하지 않습니다.
Messwerte in Prometheus und OpenTelemetry 모든 대시보드 값은 /metrics에 표시됩니다: nextxch_mail_inbound_total, nextxch_mail_outbound_total, nextxch_mail_deferred_total, nextxch_mail_bounced_total, nextxch_mail_rejected_total, nextxch_mail_spam_total, nextxch_auth_failures_total, nextxch_mail_spam_rate_percent, nextxch_queue_messages, nextxch_queue_deferred_messages, nextxch_queue_oldest_age_minutes, nextxch_connections_active{protocol}, nextxch_process_cpu_percent, nextxch_process_working_set_bytes, nextxch_disk_free_percent, nextxch_disk_free_bytes, nextxch_database_size_bytes, nextxch_tls_certificate_min_expiry_days, nextxch_tls_certificate_expiry_days{domain}, nextxch_cluster_nodes_active, nextxch_alerts_firing, nextxch_smtp_filter_verdicts_total{type,verdict}, nextxch_smtp_filter_failures_total. aktiv OTLP에서 측정항목 이름은 언더스코어 대신 점을 사용합니다(nextxch.mail.inbound); Prometheus로 변환하면 동일한 이름으로 다시 매핑됩니다.
Protokoll-Logs (#/proto-log) 프로토콜 로그 및 분석 아래의 hMailServer와 같은 영구 프로토콜 로깅: 카테고리, 시간 범위, 텍스트, IP 및 세션별 필터가 있는 실시간 로그 (최대 1500줄, 3초마다 새로 고침), 분석 및 삭제 제외, 다운로드가 포함된 설정 및 파일. Logging aktiv · 30 Tage 보관 기간(1~3650일)을 자체 삭제 기간에 맞게 조정하십시오. 오래된 파일은 자동으로 제거됩니다.
Protokoll-Kategorien application, smtp, smtp-out, delivery 및 auth는 기본적으로 켜져 있습니다. imap, pop3, activesync, ews, mapi(Outlook용 MAPI over HTTP, 주소록 포함), jmap(메서드 이름, 오류 카운트, 크기 및 지속 시간만 해당하며 인자나 내용은 제외), webdav는 개별적으로 켜고 끌 수 있습니다. 5 von 12 an 이러한 프로토콜은 로그를 많이 생성하므로 문제 해결(예: 아웃룩 문제) 목적일 때만 MAPI와 JMAP을 켜고 나중에 다시 끄십시오.