Skip to content

fix(mail): depend on upstream mail 5.1.0 and stop the per-render restart - #479

Merged
ashish1099 merged 1 commit into
masterfrom
fix/mail-chart-upstream
Oct 23, 2026
Merged

ashish1099 merged 1 commit into
masterfrom
fix/mail-chart-upstream

Conversation

@ashish1099

Copy link
Copy Markdown
Member

What

  • argocd-helm-charts/mail is now a real wrapper. It depends on the upstream chart repository (https://bokysan.github.io/docker-postfix/, chart mail 5.1.0) instead of holding a copy, so the chart updater follows upstream releases. Chart.lock is added and the subchart is vendored unpacked, as for the other wrappers.
  • The wrapper defaults mail.recreateOnRedeploy: false.
  • A README for the chart.

Why

  • The copy was never updated. It had no dependencies: entry, so the updater skipped it. Its appVersion was the placeholder v1.0.0, which the chart uses as the image tag, so every cluster on it runs boky/postfix:v1.0.0, released January 2019. On a production cluster Trivy reports 3 Critical and 13 High fixable CVEs in it, and an end-of-life base hides more.
  • recreateOnRedeploy: true (upstream's default) fights Argo CD. It stamps date/deploy-date: {{ now }} into the pod template, so every render differs from the live object. The app is permanently OutOfSync, and every sync restarts the relay. The chart's checksum/configmap annotation already restarts the pod when the configuration changes, so nothing is lost by turning it off.

What changes on a cluster

I rendered two production clusters' values with the old copy and with this chart.

Old copy 5.1.0
Image boky/postfix:v1.0.0 boky/postfix:v5.1.0 (base moves from Alpine to Debian slim, upstream v4)
StatefulSet selector, serviceName – unchanged
volumeClaimTemplates – same name, access mode and size. The new chart writes out apiVersion/kind, which the API server already stores, so there's no immutable-field change.
Services mail mail, plus a new mail-headless
date/deploy-date present gone
Env vars – identical
Readiness probe nc against port 587 /scripts/healthcheck.sh, which ships in the v5 image
Startup probe supervisord only also requires postfix-script and opendkim. Without DKIM keys, the image's opendkim.sh (v5.1.0) runs a sleep loop, so the check still passes.
Spool the PVC root at /var/spool/postfix the PVC's spool/ subdirectory

Queue on the switch: the old pod's preStop hook flushes the queue before it stops, so the queue moves cleanly when the relay host is reachable. Mail still deferred at that moment stays at the PVC root, unread by the new pod. Sync while the upstream relay is healthy.

Upgrade notes

  • Clusters move to this when they bump the mail app's targetRevision. Until then, a cluster can set mail.recreateOnRedeploy: false in its own values to stop the permanent diff.
  • After syncing, send a test mail through the relay.

Testing

  • helm dependency update, then the subchart unpacked like the updater does. No tarball is committed (*.tgz is gitignored).
  • helm lint argocd-helm-charts/mail: passes.
  • helm template with two production clusters' values, old copy against 5.1.0: the results are as in the table above.
  • Checked that boky/postfix:v5.1.0 exists on Docker Hub, and read scripts/opendkim.sh and configs/supervisord.conf at the v5.1.0 tag to confirm the opendkim behaviour.
  • Not done: running the relay. Send a test mail after the first sync.

argocd-helm-charts/mail held a copy of the upstream bokysan/docker-postfix
chart with no dependency entry, so the chart updater never touched it.
Its appVersion was the placeholder v1.0.0, which the chart uses as the
image tag, so clusters ran boky/postfix:v1.0.0 from January 2019.

Depend on the upstream chart repository at 5.1.0 instead, so the updater
follows its releases. This moves the relay to boky/postfix:v5.1.0.

Also default mail.recreateOnRedeploy to false. Upstream's true stamps
date/deploy-date: <now> into the pod template. Under Argo CD every render
then differs, so the app never syncs and each sync restarts the relay.
The chart's checksum/configmap annotation still restarts it on config
changes.
@gitguardian

gitguardian Bot commented Oct 23, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
38895005 Triggered AWS SES Keys 43c736c argocd-helm-charts/mail/charts/mail/README.md View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@ashish1099
ashish1099 merged commit 3123e4a into master Oct 23, 2026
7 of 8 checks passed
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.

1 participant