Skip to content

Create /var/spool/postfix/etc/ and /var/spool/postfix/private/ if they don't exist.#55

Open
jroose wants to merge 5 commits intocisagov:developfrom
jroose:develop
Open

Create /var/spool/postfix/etc/ and /var/spool/postfix/private/ if they don't exist.#55
jroose wants to merge 5 commits intocisagov:developfrom
jroose:develop

Conversation

@jroose
Copy link

@jroose jroose commented Feb 3, 2024

🗣 Description

This change creates /var/spool/postfix/etc and /var/spool/postfix/private if they do not exist.

💭 Motivation and context

The documentation recommends using /var/spool/postfix as a volume, but if an empty directory gets mounted there, then the ./etc and ./private directories don't exist and the entrypoint fails.

🧪 Testing

I just built the container, pushed it to my registry, and ran it on my K8S cluster. It no longer threw an error.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All new and existing tests pass.

✅ Pre-merge checklist

  • Finalize version.

✅ Post-merge checklist

  • Create a release.

@jsf9k jsf9k added the improvement This issue or pull request will add or improve functionality, maintainability, or ease of use label Feb 5, 2024
@jsf9k
Copy link
Member

jsf9k commented Feb 5, 2024

Thanks for the contribution @jroose!

Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

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

Requesting a couple of very minor changes.


# postfix needs fresh copies of files in its chroot jail
if [ ! -e /var/spool/postfix/etc ]; then
mkdir /var/spool/postfix/etc
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
mkdir /var/spool/postfix/etc
mkdir --parents /var/spool/postfix/etc

mkdir /var/spool/postfix/etc
fi
if [ ! -e /var/spool/postfix/private ]; then
mkdir /var/spool/postfix/private
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
mkdir /var/spool/postfix/private
mkdir --parents /var/spool/postfix/private

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement This issue or pull request will add or improve functionality, maintainability, or ease of use

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants