Skip to content

fix(postfix): drop group copies for disabled mailbox - #314

Closed
stephdl wants to merge 4 commits into
fix-8185-disabled-rcptfrom
fix-8205-disabled-group-member
Closed

stephdl wants to merge 4 commits into
fix-8185-disabled-rcptfrom
fix-8205-disabled-group-member

Conversation

@stephdl

@stephdl stephdl commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

When a group or an alias with several destinations contained a disabled mailbox, every message sent to it returned a bounce to the sender for that mailbox. The other members received the message. NethServer/dev#8205

Now the copy for a disabled mailbox is dropped and no bounce is sent. The other members still receive the message. This works with AD and OpenLDAP groups, aliases and forwards to a group.

Known limit: if every member of a group is disabled, the message is accepted and dropped. The expected behavior is a rejection at SMTP time, it is documented in the issue and in the tests.

This branch is built on top of #312, so the PR targets its branch. GitHub will switch the base to main once #312 is merged. I tested it on a real cluster with AD and OpenLDAP.

How to test

The new suite tests/50__smtp/00__disabled_mailbox_expansion.robot covers these cases. To check by hand:

  1. Enable "Add group addresses" on a mail domain and disable the mailbox of a group member.
  2. Send a message to the group address.
  3. The other members receive it. The log line of the disabled member shows relay=none and status=sent, which means the copy was discarded. No bounce is sent.

LDAP group expansion cannot skip members, so a group with a disabled
member bounced every message back to the sender. Route disabled
mailboxes to the discard transport instead.
@stephdl
stephdl force-pushed the fix-8205-disabled-group-member branch from 0208493 to 4dedc17 Compare October 14, 2026 09:13
@stephdl
stephdl changed the base branch from main to fix-8185-disabled-rcpt October 14, 2026 09:31
@stephdl
stephdl marked this pull request as ready for review October 14, 2026 09:32

@DavidePrincipi DavidePrincipi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The approach is right. I proposed a variation in my review of #312: #312 (review)

It uses a generated texthash file instead of the inline transport map, shared with the RCPT check of #312. Since both PRs would then rely on the same list, I'd fold this one into #312.

@stephdl

stephdl commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

I'm closing this one. As Davide suggested in his review of #312, I folded it into #312. Both fixes use the same list of disabled mailboxes. #312 now generates a texthash table from DOVECOT_DISABLED_USERS and puts it first in transport_maps, so copies that reach a disabled mailbox through an alias, a group, a forward or the catch-all are discarded without a bounce. The robot cases from this PR moved to tests/50__smtp/00__disabled_mailbox.robot.

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.

2 participants