Skip to content

feat(mailer): Return-Path for suspension notices from MAILER_SUSPENSION_BOUNCE_ADDRESS - #586

Merged
Neophytis merged 1 commit into
mainfrom
neophytis/654-suspension-bounce-address
Oct 11, 2026
Merged

Neophytis merged 1 commit into
mainfrom
neophytis/654-suspension-bounce-address

Conversation

@Neophytis

@Neophytis Neophytis commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Target branch: main (prod build source since rox#518). Part of BeWelcome/sysadmins-infra#693 (Gabriel's request).

Why

Bounces of the suspension notices (SuspendAfter5Reminders) need no support action, because the members are suspended when the mailing is queued (enqueueSuspensionNotification). Today they come back to reminder@ and land in Znuny's Newsletter queue as tickets.

Change

  • Mailer::sendNewsletterEmail: for SuspendAfter5Reminders only, set the email's Return-Path from MAILER_SUSPENSION_BOUNCE_ADDRESS. Symfony Mailer uses it as the SMTP envelope sender, so bounces go to bounces-suspended@bewelcome.org, which Znuny does not fetch and the bounce-processor reads (sysadmins-infra#683).
  • From stays reminder@bewelcome.org, so a member who replies still reaches the support team in Znuny.
  • config/services.yaml: bind $suspensionBounceAddress with %env(default::MAILER_SUSPENSION_BOUNCE_ADDRESS)%. Unset or empty means no change.
  • Other mailing types are not affected.

Infra half: BeWelcome/sysadmins-infra#684 (prod bounces-suspended@bewelcome.org, stage bounces-suspended@stage.bewelcome.org). Safe in either order.

Tests

  • php -l clean.
  • An earlier stage image of this change (sha-5902327, before the rebase onto main) built with all jobs green, including the image scan. This PR's CI builds a fresh image.
  • Stage check pending. leopard-stage is in use by another e2e test right now. Afterwards: deploy this PR's image with sysadmins-infra#684, send one suspension notice to a test member, and check Return-Path: <bounces-suspended@stage.bewelcome.org> in Mailpit while From is still reminder@.

…ON_BOUNCE_ADDRESS

Bounces of SuspendAfter5Reminders notices need no support action: the
members are suspended when the mailing is queued. With the variable set,
those notices use it as Return-Path (SMTP envelope sender), so bounces go
to a mailbox Znuny does not fetch and the bounce-processor reads instead.
From stays reminder@, so human replies still reach Znuny. Unset = no change.
(BeWelcome/sysadmins-infra#654, Gabriel's request)
@Neophytis
Neophytis merged commit ea1da67 into main Oct 11, 2026
21 checks passed
@Neophytis
Neophytis deleted the neophytis/654-suspension-bounce-address branch October 11, 2026 19:03
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.

1 participant