Ensure OpenSMTPD symlink setup at runtime

This commit is contained in:
cto-new[bot]
2026-02-09 13:44:48 +00:00
parent 4cd57bc012
commit 6c12d282cd
2 changed files with 50 additions and 15 deletions

View File

@@ -174,9 +174,14 @@ main() {
# Check OpenSMTPD service (ports 25, 587, 465)
health_log "INFO" "=== OpenSMTPD Service ==="
OPENSMTPD_CUSTOM_BINARY="/workspace/src/backend/app/opensmtpd/install/sbin/smtpd"
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
@@ -186,7 +191,7 @@ main() {
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