You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mail: disabled mailboxes accepted at RCPT time, causing backscatter #8185
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:<forged@example.com>, RCPT TO:<alice@example.org>, DATA
Repeat with RCPT TO:<krbtgt@example.org> and RCPT TO:<ldapservice@example.org>
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:
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
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.
RCPT TO:<alice@example.org> is rejected with 550 5.1.1 ... User unknown in virtual alias table, like a non existent address. The same for Alice@example.org and alice+tag@example.org.
RCPT TO:<krbtgt@example.org> and RCPT TO:<ldapservice@example.org> are rejected the same way.
With "Add alias addresses" enabled and an LDAP mail attribute set on alice, that address is rejected too.
With "Accept unknown recipients" enabled, a message to alice@example.org is delivered to the catch-all mailbox, not to alice.
No bounce is sent: journalctl --since -5min | grep "non-delivery" returns nothing.
alice cannot log in with IMAP, POP3 or SMTP. ✋ (the suite checks IMAP and SMTP, not POP3)
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)
Update from Mail 1.9.x with a disabled mailbox: it is still disabled after the update. ✋
Back up and restore Mail with a disabled mailbox: it is still disabled after the restore, also for logins tried during the restore. ✋
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.
✅ With qa1 disabled, IMAP (993), POP3 (995) and SMTP (465) logins all fail with "authentication failed".
✅ 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.
✅ Update from Mail 1.9.3 with qa1 disabled: before the update RCPT TO:<qa1@example.org> 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".
✅ 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: Qa1@example.org and qa1+tag@example.org are rejected too, and no non-delivery notification was sent.
Activity
DavidePrincipi commentedon Oct 13, 2026
@stephdl moved to In Progress since NethServer/ns8-mail#312 is open. Feel free to move it back if that's not right.
Merge pull request #356 from NethServer/bug-8185
DavidePrincipi commentedon Nov 26, 2026
Fixed by NethServer/ns8-mail#356, available in Mail
2.0.0-beta.5from 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.orgwith "Add user addresses" enabled, useralicewith her mailbox disabled from the Mail UI. Send from an external host to port 25.RCPT TO:<alice@example.org>is rejected with550 5.1.1 ... User unknown in virtual alias table, like a non existent address. The same forAlice@example.organdalice+tag@example.org.RCPT TO:<krbtgt@example.org>andRCPT TO:<ldapservice@example.org>are rejected the same way.mailattribute set onalice, that address is rejected too.alice@example.orgis delivered to the catch-all mailbox, not toalice.journalctl --since -5min | grep "non-delivery"returns nothing.alicecannot log in with IMAP, POP3 or SMTP. ✋ (the suite checks IMAP and SMTP, not POP3)DavidePrincipi commentedon Nov 27, 2026
VERIFIED
Tested Mail
2.0.0-beta.6on 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.qa1disabled, IMAP (993), POP3 (995) and SMTP (465) logins all fail with "authentication failed".qa1disabled: before the updateRCPT TO:<qa1@example.org>returns250 2.1.5 Ok(the bug). After the update to2.0.0-beta.6it returns550 5.1.1 ... User unknown in virtual alias table, logins fail,DOVECOT_DISABLED_USERSis removed from the module environment, and the mailbox is listed as disabled with the description "Migrated from DOVECOT_DISABLED_USERS".pcdb-initfinished 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:
Qa1@example.organdqa1+tag@example.orgare rejected too, and no non-delivery notification was sent.