Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't enable smtputf8 when running on alpine on container restart #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

envy
Copy link

@envy envy commented Jan 27, 2025

postfix_disable_utf8 checks if its running on alpine and if so, disables smtputf8.

However, the check is wrong. Consider this scenario:

  1. alpine container is created, smtputf8_enable is set to no using -e POSTFIX_smtputf8_enable=no
  2. container is restarted. Now the elif branch is taken and smtputf8 is actually enabled on alpine.
  3. Due to the set environment var, it is set to no again, so no harm done.

We actually encountered this on our system:

★★★★★ POSTFIX STARTING UP (alpine) ★★★★★
‣ NOTE  System accounts: postfix=100:101, opendkim=102:103. Careful when switching distros.
‣ INFO  Not setting any timezone for the container
‣ DEBUG /tmp writable.
‣ INFO  Using plain log format for rsyslog.
‣ NOTE  Emails in the logs will not be anonymized. Set ANONYMIZE_EMAILS to enable this feature.
‣ DEBUG Reowning root: /var/spool/postfix/
‣ DEBUG Reowning root: /var/spool/postfix/pid/
‣ DEBUG Reowning postfix:postdrop /var/spool/postfix/private/
‣ DEBUG Reowning postfix:postdrop /var/spool/postfix/public/
‣ INFO  Preparing files for Postfix chroot:
        '/etc/localtime' -> '/var/spool/postfix/etc/localtime'
        '/etc/nsswitch.conf' -> '/var/spool/postfix/etc/nsswitch.conf'
        '/etc/resolv.conf' -> '/var/spool/postfix/etc/resolv.conf'
        '/etc/services' -> '/var/spool/postfix/etc/services'
        '/etc/hosts' -> '/var/spool/postfix/etc/hosts'
        '/etc/passwd' -> '/var/spool/postfix/etc/passwd'
‣ DEBUG No upgrade of hashes needed needed.
‣ DEBUG Running on non-Alpine system. Setting smtputf8_enable=yes.
...

This PR adds an additional check for non-existence of /etfc/alpine-release to the elif branch to make sure that branch is only taken in non-alpine containers.

@bokysan
Copy link
Owner

bokysan commented Jan 27, 2025

Nice catch. Thank you for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants