This commit is contained in:
southseact-3d
2026-02-09 15:39:28 +00:00
parent d5065b117f
commit df58e4b239
5 changed files with 2 additions and 216 deletions

View File

@@ -172,61 +172,6 @@ main() {
exit_code=1
fi
# Check OpenSMTPD service (ports 25, 587, 465)
health_log "INFO" "=== OpenSMTPD Service ==="
REPO_DIR="${REPO_DIR:-/home/web/data}"
OPENSMTPD_INSTALL_ROOT="/workspace/src/backend/app/opensmtpd/install"
if [ -d "${REPO_DIR}/backend/app/opensmtpd" ]; then
OPENSMTPD_INSTALL_ROOT="${REPO_DIR}/backend/app/opensmtpd/install"
fi
OPENSMTPD_CUSTOM_BINARY="${OPENSMTPD_INSTALL_ROOT}/sbin/smtpd"
OPENSMTPD_SYSTEM_BINARY="/usr/sbin/smtpd"
# Determine which binary to use (prefer custom, fallback to system)
OPENSMTPD_BINARY=""
if [ -x "$OPENSMTPD_CUSTOM_BINARY" ]; then
OPENSMTPD_BINARY="$OPENSMTPD_CUSTOM_BINARY"
elif [ -x "$OPENSMTPD_SYSTEM_BINARY" ]; then
OPENSMTPD_BINARY="$OPENSMTPD_SYSTEM_BINARY"
elif command -v smtpd &>/dev/null; then
OPENSMTPD_BINARY="$(command -v smtpd)"
fi
if [ -n "$OPENSMTPD_BINARY" ]; then
# Check SMTP port 25
if check_port 25 "SMTP"; then
health_log "INFO" "✓ SMTP port 25 is listening"
else
health_log "WARN" "⚠ SMTP port 25 is not listening (may be normal if not using inbound email)"
fi
# Check SMTP submission port 587
if check_port 587 "SMTP Submission"; then
health_log "INFO" "✓ SMTP submission port 587 is listening"
else
health_log "WARN" "⚠ SMTP submission port 587 is not listening"
fi
# Check SMTPS port 465
if check_port 465 "SMTPS"; then
health_log "INFO" "✓ SMTPS port 465 is listening"
else
health_log "WARN" "⚠ SMTPS port 465 is not listening"
fi
# Check OpenSMTPD process
if pgrep -f "smtpd" > /dev/null; then
local smtpd_pid=$(pgrep -f "smtpd" | head -1)
health_log "INFO" "✓ OpenSMTPD process running (PID: ${smtpd_pid})"
else
health_log "WARN" "⚠ OpenSMTPD process not found (may be disabled)"
fi
else
health_log "INFO" "OpenSMTPD not installed (checked: $OPENSMTPD_CUSTOM_BINARY, $OPENSMTPD_SYSTEM_BINARY, PATH), skipping SMTP checks"
fi
# ttyd service has been removed, no longer checking port 4501
health_log "INFO" "========== HEALTH CHECK END ==========="
if [ $exit_code -eq 0 ]; then