Skip to content

Conversation

@k4lv15
Copy link
Contributor

@k4lv15 k4lv15 commented Apr 1, 2025

Motivation:
Mailhog is an email service we’re using in our development environments (local & Silta non-production) to test out if email functionalities are working properly. Mailhog is not maintained anymore and is causing issues for developers. Therefore, we need to replace it with some alternative. Our current pick is Mailpit.

Changes proposed:

  • Add mailpit dependency, enable it, add default value overrides
  • Update chart templates with needed changes for mailpit to work
  • Update unit tests to run against mailpit instead of mailhog
  • Keep mailhog in chart but add deprecation notices

How to test:

  1. Install the updated chart and see that mailpit works (helm install drupal-release charts/drupal --set mailpit.enabled=true or test here: https://app.circleci.com/pipelines/github/wunderio/drupal-project-k8s/6873/workflows/20d2da53-257e-4bc2-8d2e-85bbb7c3eae2/jobs/22713). Test the following:
    • validation goes through (i.e., unit tests pass: helm unittest ./charts/drupal)
    • mailpit URL is listed in the release notes and it works
    • the legacy /mailhog path redirects to /mailpit
    • emails sent from Drupal (i.e., after password reset or new account creation) end up in mailpit, mailpit's UI works, i.e, you can mark emails as read, delete them, download etc.
  2. See that updated installation checks work, i.e., try to install chart with both mailpit and mailhog enabled, see that the installation fails (or see screenshot below)
    image

k4lv15 added 20 commits April 1, 2025 18:20
…ng drupal.env as otherwise mailpit deployment has incorrect name and kubernetes services are not created.
…release-name>-mailpit-smtp:25 as that's the service/port that mailpit creates for SMTP communications.
…is not created and php containers fail to start.
…ginx config to proxy mailpit-http under Drupal's /mailpit path.
…ifies mailpit and mailhog are not enabled at the same time. Add deprecation notes for mailhog.
@k4lv15 k4lv15 force-pushed the feature/SLT-1103-mail branch from 5255230 to 265f89b Compare April 1, 2025 16:12
@k4lv15 k4lv15 marked this pull request as ready for review April 1, 2025 17:00
@k4lv15 k4lv15 requested review from Jancis, Rade333, Copilot and tormi April 1, 2025 17:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request replaces Mailhog with Mailpit in the Drupal chart to address maintenance concerns and ensure a stable email testing service in development environments. Key changes include:

  • Adding Mailpit configuration and dependency while deprecating Mailhog.
  • Updating chart templates, tests, and configuration files to support Mailpit.
  • Adding validation rules to prevent dual activation and production use of deprecated services.

Reviewed Changes

Copilot reviewed 11 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
silta/silta.yml Added Mailpit service flag
charts/drupal/values.yaml Introduced Mailpit configuration values and overrides
charts/drupal/tests/drupal_deployment_test.yaml Updated test cases to refer to Mailpit
charts/drupal/test.values.yaml Changed Mailhog to Mailpit in test values
charts/drupal/templates/varnish-configmap-vcl.yaml Added proxy bypass for Mailpit URLs
charts/drupal/templates/smtp-secret.yaml Modified condition to include Mailpit
charts/drupal/templates/drupal-configmap.yaml Added redirect from legacy Mailhog to Mailpit
charts/drupal/templates/checks.yaml Inserted checks to prevent enabling both services simultaneously and blocking deprecated usage in production
charts/drupal/Chart.yaml Added Mailpit as a chart dependency
.circleci/config.yml Added Helm repo for the new Mailpit chart dependency
Files not reviewed (3)
  • charts/drupal/templates/NOTES.txt: Language not supported
  • charts/drupal/templates/_helpers.tpl: Language not supported
  • charts/drupal/values.schema.json: Language not supported
Comments suppressed due to low confidence (1)

charts/drupal/values.yaml:757

  • [nitpick] The nested 'mailpit' key inside the main Mailpit configuration block may be confusing. Consider renaming it (e.g., to 'webrootConfig' or similar) for clearer structure.
  mailpit:

Copy link
Member

@tormi tormi left a comment

Choose a reason for hiding this comment

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

RTBC. Nice work, thanks @k4lv15 ! 👍

/var/www/html$ env | grep SMTP_ADDRESS
SMTP_ADDRESS=feature-slt-1103-mail-mailpit-smtp:25
Screenshot 2025-04-01 at 22 13 07

@Rade333 Rade333 changed the base branch from master to release/2025-05-05 May 5, 2025 08:24
@Rade333 Rade333 merged commit 259e36a into release/2025-05-05 May 5, 2025
1 check passed
@Rade333 Rade333 deleted the feature/SLT-1103-mail branch May 5, 2025 08:24
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.

4 participants