Skip to content

scripts: add wrapper to update Postfix configuration safely (follow up)#3503

Merged
casperklein merged 14 commits intodocker-mailserver:masterfrom
casperklein:follow-up-3484
Aug 27, 2023
Merged

scripts: add wrapper to update Postfix configuration safely (follow up)#3503
casperklein merged 14 commits intodocker-mailserver:masterfrom
casperklein:follow-up-3484

Conversation

@casperklein
Copy link
Copy Markdown
Member

@casperklein casperklein commented Aug 26, 2023

Description

While working on improving the function _add_to_or_update_postfix_main(), I noticed a problem we had before in other occasions.

SED_STRING="/${NEW_VALUE}/!

This is not really fail safe, when $NEW_VALUE is a substring of an existing value.

Now I simplified the whole function, by replacing sed with postconf.

Fixes #3484

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 Aug 26, 2023
@casperklein casperklein added this to the v13.0.0 milestone Aug 26, 2023
@casperklein casperklein added area/scripts kind/improvement Improve an existing feature, configuration file or the documentation labels Aug 26, 2023
Comment thread target/scripts/helpers/postfix.sh Outdated
polarathene
polarathene previously approved these changes Aug 26, 2023
Copy link
Copy Markdown
Member

@polarathene polarathene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement! 😁

This is much simpler to grok now without all the sed syntax dance and escaping added into the mix.

Comment thread target/scripts/helpers/postfix.sh
Comment thread target/scripts/helpers/postfix.sh Outdated
Comment thread target/scripts/helpers/postfix.sh Outdated
Comment thread target/scripts/helpers/postfix.sh Outdated
Copy link
Copy Markdown
Member

@georglauterbach georglauterbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking on the check, but it'd be nice to see [[ rather than grep.

Comment thread target/scripts/helpers/postfix.sh Outdated
polarathene
polarathene previously approved these changes Aug 27, 2023
@casperklein casperklein enabled auto-merge (squash) August 27, 2023 13:02
@casperklein casperklein merged commit 43a122f into docker-mailserver:master Aug 27, 2023
@casperklein casperklein deleted the follow-up-3484 branch September 2, 2023 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/scripts kind/improvement Improve an existing feature, configuration file or the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants