From 6ed1455ec1fd5673152978de0c41de3aaecfc1cb Mon Sep 17 00:00:00 2001 From: Brennan Kinney <5098581+polarathene@users.noreply.github.com> Date: Tue, 27 May 2025 14:19:16 +1200 Subject: [PATCH] chore: `packages.sh` - Revise Postfix hostname workaround --- target/scripts/build/packages.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/target/scripts/build/packages.sh b/target/scripts/build/packages.sh index cfd510de..bfdf0a15 100644 --- a/target/scripts/build/packages.sh +++ b/target/scripts/build/packages.sh @@ -83,12 +83,14 @@ function _install_postfix() { _log 'warn' 'Applying workaround for Postfix bug (see https://github.com/docker-mailserver/docker-mailserver/issues/2023#issuecomment-855326403)' - # Debians postfix package has a post-install script that expects a valid FQDN hostname to work: - mv /bin/hostname /bin/hostname.bak - echo "echo 'docker-mailserver.invalid'" >/bin/hostname - chmod +x /bin/hostname + # Debians postfix package has a post-install script that expects a valid FQDN hostname to work. + # Replace the hostname command to instead output temporary hostname that is fully-qualified: + mv /usr/bin/hostname /usr/bin/hostname.bak + echo -e "#!/bin/bash\necho 'docker-mailserver.invalid'" >/usr/bin/hostname + chmod +x /usr/bin/hostname + # Install the postfix package, then restore the original hostname command afterwards: apt-get "${QUIET}" install --no-install-recommends postfix - mv /bin/hostname.bak /bin/hostname + mv /usr/bin/hostname.bak /usr/bin/hostname # Irrelevant - Debian's default `chroot` jail config for Postfix needed a separate syslog socket: rm /etc/rsyslog.d/postfix.conf