From a6d5635b36d4e6ccd922348cfaec3a93c1b74fce Mon Sep 17 00:00:00 2001 From: casjay Date: Mon, 27 Jul 2026 13:33:04 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Update=20codebase=20?= =?UTF-8?q?=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/usr/local/etc/docker/functions/entrypoint.sh --- .../local/etc/docker/functions/entrypoint.sh | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/rootfs/usr/local/etc/docker/functions/entrypoint.sh b/rootfs/usr/local/etc/docker/functions/entrypoint.sh index 5d25d12..eebaf00 100644 --- a/rootfs/usr/local/etc/docker/functions/entrypoint.sh +++ b/rootfs/usr/local/etc/docker/functions/entrypoint.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # shellcheck shell=bash # - - - - - - - - - - - - - - - - - - - - - - - - - -##@Version : 202607082330-git +##@Version : 202607271325-git # @@Author : Jason Hempstead # @@Contact : git-admin@casjaysdev.pro # @@License : LICENSE.md @@ -10,7 +10,7 @@ # @@Created : Sunday, Sep 03, 2023 01:40 EDT # @@File : docker-entrypoint # @@Description : functions for my docker containers -# @@Changelog : newScript +# @@Changelog : fix __setup_mta calling __symlink with from/to swapped, which no-op'd the symlink and broke msmtp/ssmtp/postfix config on container start # @@TODO : Refactor code # @@Other : # @@Resource : @@ -1171,12 +1171,14 @@ from ${account_user:-root}@${account_domain:-$HOSTNAME} EOF fi if [ -f "/config/msmtp/msmtprc" ]; then - __symlink "/config/msmtp/msmtprc" "/etc/msmtprc" + # __symlink(from, to) requires the "to" (config) side to already exist + # and creates "from" (etc) as a symlink to it — arguments were reversed here + __symlink "/etc/msmtprc" "/config/msmtp/msmtprc" __initialize_replace_variables "/etc/msmtprc" chmod 600 "/etc/msmtprc" 2>/dev/null || true # sendmail compat symlink if [ ! -e "/usr/sbin/sendmail" ] && command -v msmtp &>/dev/null; then - __symlink "$(command -v msmtp)" "/usr/sbin/sendmail" + __symlink "/usr/sbin/sendmail" "$(command -v msmtp)" fi [ "$DEBUGGER" = "on" ] && echo "Done setting up msmtp" fi @@ -1204,17 +1206,19 @@ FromLineOverride=yes EOF fi if [ -f "/config/ssmtp/ssmtp.conf" ]; then + # __symlink(from, to) requires the "to" (config) side to already exist + # and creates "from" (etc) as a symlink to it — arguments were reversed here for file in $symlink_files; do - __symlink "/config/ssmtp/$file" "/etc/ssmtp/$file" + __symlink "/etc/ssmtp/$file" "/config/ssmtp/$file" __initialize_replace_variables "/etc/ssmtp/$file" done if [ -f "/etc/ssmtp/revaliases" ] && [ ! -f "/config/ssmtp/revaliases" ]; then mv -f "/etc/ssmtp/revaliases" "/config/ssmtp/revaliases" - __symlink "/config/ssmtp/revaliases" "/etc/ssmtp/revaliases" + __symlink "/etc/ssmtp/revaliases" "/config/ssmtp/revaliases" __initialize_replace_variables "/etc/ssmtp/revaliases" else touch "/config/ssmtp/revaliases" - __symlink "/config/ssmtp/revaliases" "/etc/ssmtp/revaliases" + __symlink "/etc/ssmtp/revaliases" "/config/ssmtp/revaliases" __initialize_replace_variables "/etc/ssmtp/revaliases" fi [ "$DEBUGGER" = "on" ] && echo "Done setting up ssmtp" @@ -1255,8 +1259,10 @@ relayhost = [$relay_server]:$relay_port EOF fi if [ -d "/config/postfix" ]; then + # __symlink(from, to) requires the "to" (config) side to already exist + # and creates "from" (etc) as a symlink to it — arguments were reversed here for f in $symlink_files; do - __symlink "/config/postfix/$f" "/etc/postfix/$f" + __symlink "/etc/postfix/$f" "/config/postfix/$f" done __initialize_replace_variables "/etc/postfix" touch "/config/postfix/aliases" "/config/postfix/mynetworks" "/config/postfix/transport"