Skip to content

mail: disabled mailboxes accepted at RCPT time, causing backscatter #8185

Done

Description

@stephdl

Postfix accepts mail for disabled mailboxes and hidden accounts. Dovecot then rejects it at LMTP delivery, and Postfix sends a bounce to the sender. The sender is often forged, so this is backscatter and it can hurt the server reputation.

Steps to reproduce

  • Install mail 1.8.0 and bind it to a Samba AD user domain
  • Add a mail domain with "Add user addresses" enabled, e.g. example.org
  • Create user alice and disable her mailbox from the Mail UI
  • From an external host, connect to port 25 and send EHLO test, MAIL FROM:<[email protected]>, RCPT TO:<[email protected]>, DATA
  • Repeat with RCPT TO:<[email protected]> and RCPT TO:<[email protected]>
  • Check the journal: journalctl --since -5min | grep -E "status=|non-delivery"

Expected behavior

RCPT TO is rejected with 550 5.1.1 User unknown, like any non existent address.

Actual behavior

RCPT TO returns 250 2.1.5 Ok for alice, krbtgt and ldapservice. An unknown address is correctly rejected with 550. LMTP delivery then fails and Postfix sends a bounce to the forged sender:

to=<[email protected]>, orig_to=<[email protected]>, ... status=bounced (... 550 5.1.1 <[email protected]> User doesn't exist ...)
sender non-delivery notification: ABEE4C6E2C

Postfix checks recipients with laddusers-ad.cf and laddusers-rfc2307.cf. Their query_filter only checks that the account exists. Dovecot excludes DOVECOT_DISABLED_USERS (which also contains hidden_users) from its LDAP filters, Postfix does not. The variable is already passed to the postfix container through discovery.env.

A possible fix is to add the same NOT-OR clause used in dovecot/usr/local/bin/reload-config to the Postfix laddusers*.cf filter, and to reload Postfix when a mailbox is enabled or disabled.

Components

  • ns8-mail 1.8.0, latest stable release, with Samba AD 3.5.0
  • Reproduced on a test system, same code in current main

See also

Activity

  1. self-assigned this
    on Sep 25, 2026
  2. moved this from ToDo to In Progress in NethServeron Oct 13, 2026
  3. DavidePrincipi commented on Oct 13, 2026

    @DavidePrincipi
    Member

    @stephdl moved to In Progress since NethServer/ns8-mail#312 is open. Feel free to move it back if that's not right.

  4. moved this from In Progress to ToDo in NethServeron Nov 24, 2026
  5. moved this from ToDo to In Progress in NethServeron Nov 24, 2026
  6. 3 remaining items

  7. added a commit that references this issue on Nov 26, 2026
  8. added
    testing
    on Nov 26, 2026
  9. DavidePrincipi commented on Nov 26, 2026

    @DavidePrincipi
    Member

    Fixed by NethServer/ns8-mail#356, available in Mail 2.0.0-beta.5 from the testing repository.

    Test cases

    Cases marked with ✋ are not covered by the automated test suite, or only in part: they need a manual check.

    Setup: Mail bound to a Samba AD user domain, mail domain example.org with "Add user addresses" enabled, user alice with her mailbox disabled from the Mail UI. Send from an external host to port 25.

    1. RCPT TO:<[email protected]> is rejected with 550 5.1.1 ... User unknown in virtual alias table, like a non existent address. The same for [email protected] and [email protected].
    2. RCPT TO:<[email protected]> and RCPT TO:<[email protected]> are rejected the same way.
    3. With "Add alias addresses" enabled and an LDAP mail attribute set on alice, that address is rejected too.
    4. With "Accept unknown recipients" enabled, a message to [email protected] is delivered to the catch-all mailbox, not to alice.
    5. No bounce is sent: journalctl --since -5min | grep "non-delivery" returns nothing.
    6. alice cannot log in with IMAP, POP3 or SMTP. ✋ (the suite checks IMAP and SMTP, not POP3)
    7. Enable the mailbox again: delivery and login work at once, with no service restart. ✋ (delivery after enabling is covered; the immediate login and the missing restart are not)
    8. Update from Mail 1.9.x with a disabled mailbox: it is still disabled after the update. ✋
    9. Back up and restore Mail with a disabled mailbox: it is still disabled after the restore, also for logins tried during the restore. ✋
  10. moved this from ToDo to Testing in NethServeron Nov 26, 2026
  11. DavidePrincipi commented on Nov 27, 2026

    @DavidePrincipi
    Member

    VERIFIED

    Tested Mail 2.0.0-beta.6 on Rocky Linux 9.8, core 3.25.1, OpenLDAP user domain. Only the cases marked ✋ were checked by hand: the others are covered by the automated tests.

    1. ✅ With qa1 disabled, IMAP (993), POP3 (995) and SMTP (465) logins all fail with "authentication failed".
    2. ✅ Enabling the mailbox again: IMAP, POP3 and SMTP logins work at once, and the next message is delivered. The Postfix and Dovecot main PIDs do not change and the journal shows no reload, also after disabling and enabling three mailboxes three times in a row.
    3. ✅ Update from Mail 1.9.3 with qa1 disabled: before the update RCPT TO:<[email protected]> returns 250 2.1.5 Ok (the bug). After the update to 2.0.0-beta.6 it returns 550 5.1.1 ... User unknown in virtual alias table, logins fail, DOVECOT_DISABLED_USERS is removed from the module environment, and the mailbox is listed as disabled with the description "Migrated from DOVECOT_DISABLED_USERS".
    4. ✅ Back up a Mail instance with a disabled mailbox, then restore it with "replace": a login loop for the disabled user (every few seconds, IMAP/POP3/SMTP) never succeeded during the restore. pcdb-init finished before Postfix and Dovecot started, and after the restore the mailbox is still disabled (description and custom quota kept) and RCPT is rejected with 550.

    Also checked: [email protected] and [email protected] are rejected too, and no non-delivery notification was sent.

  12. added
    verified
    and removed
    testing
    on Nov 27, 2026
  13. moved this from Testing to Verified in NethServeron Nov 27, 2026
  14. moved this from Testing to In Progress in NethServeron Nov 27, 2026
  15. removed
    verified
    on Dec 1, 2026
  16. moved this from Verified to Done in NethServeron Dec 1, 2026
  17. added
    verified
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    verified

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions