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

Fix harmless startup errors #2357

Merged
merged 7 commits into from Jan 7, 2022

Conversation

casperklein
Copy link
Member

@casperklein casperklein commented Jan 4, 2022

Description

When restarting the container (docker restart mailserver), depending on someones setup, the following errors may be displayed:

rm: cannot remove '/etc/cron.d/clamav-freshclam': No such file or directory

Error: sed -i /^smtpd_recipient_restrictions = / s/, reject_rbl_client zen.spamhaus.org// /etc/postfix/main.cf
Error: sed -i -r -e s|^(MinProtocol).*|\1 = TLSv1| -e s|^(CipherString).*|\1 = DEFAULT@SECLEVEL=1| /usr/lib/ssl/openssl.cnf
Error: sed -i -r s|^(smtpd_tls_chain_files =).*|\1 /etc/dms/tls/key /etc/dms/tls/cert| /etc/postfix/main.cf
Error: sed -i -r -e s|^(ssl_key =).*|\1 </etc/dms/tls/key| -e s|^(ssl_cert =).*|\1 </etc/dms/tls/cert| /etc/dovecot/conf.d/10-ssl.conf

These errors are harmless and are only triggered, because the file deletion/modification already took place on the first container start.

To bypass this, a marker file CONTAINER_START is created after the container has started.

sedfile checks if that file exists. If so, no error is displayed on a failure.
There may be circumstances, where sedfile should fail, regardless of the container state (fresh or restarted). For that, pass --strict as first parameter to sedfile. At the moment this is only the case for the delmailuser script.

Fixes #

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change that does improve existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or the documentation under docs/)
  • If necessary I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@casperklein casperklein self-assigned this Jan 4, 2022
@casperklein casperklein requested a review from a team January 4, 2022 18:48
@casperklein casperklein added this to the v10.5.0 milestone Jan 4, 2022
@casperklein casperklein marked this pull request as ready for review January 5, 2022 00:26
@casperklein casperklein merged commit 29c2d97 into docker-mailserver:master Jan 7, 2022
@casperklein casperklein deleted the restart-errors branch January 7, 2022 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants