Directory recipient misses are logged at info level (#364) #365

Merged
jcoffey-dev merged 2 commits from fix/364-directory-rcpt-miss-logs into main 2026-11-11 00:35:59 +00:00
Owner

Fixes #364.

On a directory domain, a recipient the LDAP/SQL directory has no answer for is refused with 550 5.1.2, and at the default log level nothing said why. A new event, smtp.directory-no-answer (id 661, info, also in the packaged schema), now comes right before that refusal:

  • Reason The directory found no entry for the address: Details is the LDAP mailbox filter as it ran for the address, or the SQL recipient query.
  • Reason The directory answered with an account|group on a domain it doesn't serve (DIR-6): Details is the address it answered with.
  • Also carries To, Domain and the session span.

It is raised only if the address ends up refused, so mail to a mailing list, catch-all or relay domain on a directory domain logs nothing. Sign-in lookups are untouched; the LDAP debug warning stays as it was.

New: Directory::recipient_query (LDAP/SQL) for the Details text.

Tested locally: per_domain_directory_tests (new checks: no-entry with its query, DIR-6 through a directory that looks recipients up by alias, nothing logged for an accepted address) passes; smtp::inbound::rcpt, smtp::inbound::vrfy, cargo test -p trc pass; clippy clean on touched files; fork checks (name, notice, context, privacy, expr-schema, unit tests) clean. per_domain_directory_compat needs INBUXA_COMPAT_ADMIN and a data copy, not run.

Docs side: inbuxa.org #148.

Fixes #364. On a directory domain, a recipient the LDAP/SQL directory has no answer for is refused with `550 5.1.2`, and at the default log level nothing said why. A new event, **`smtp.directory-no-answer`** (id 661, info, also in the packaged schema), now comes right before that refusal: - **Reason** `The directory found no entry for the address`: **Details** is the LDAP mailbox filter as it ran for the address, or the SQL recipient query. - **Reason** `The directory answered with an account|group on a domain it doesn't serve` (DIR-6): **Details** is the address it answered with. - Also carries To, Domain and the session span. It is raised only if the address ends up refused, so mail to a mailing list, catch-all or relay domain on a directory domain logs nothing. Sign-in lookups are untouched; the LDAP debug warning stays as it was. New: `Directory::recipient_query` (LDAP/SQL) for the Details text. **Tested locally:** `per_domain_directory_tests` (new checks: no-entry with its query, DIR-6 through a directory that looks recipients up by alias, nothing logged for an accepted address) passes; `smtp::inbound::rcpt`, `smtp::inbound::vrfy`, `cargo test -p trc` pass; clippy clean on touched files; fork checks (name, notice, context, privacy, expr-schema, unit tests) clean. `per_domain_directory_compat` needs `INBUXA_COMPAT_ADMIN` and a data copy, not run. Docs side: inbuxa.org #148.
jcoffey-dev added 1 commit 2026-11-11 00:12:56 +00:00
Directory recipient misses are logged at info level (#364)
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Failing after 1m26s
b6f664a8d7
On a domain with an LDAP or SQL directory, the RCPT check asks only the
directory, and an address it has no answer for is refused with 550 5.1.2.
At the default log level nothing said why: the LDAP backend's "Mailbox
filter yielded no results" is debug level, an SQL miss logs nothing, and
an answer for a domain the directory doesn't serve (DIR-6) was dropped
without a word.

A new event, smtp.directory-no-answer (id 661, info level, also in the
packaged schema), now precedes such a refusal. Reason says why: the
directory found no entry (Details holds the LDAP mailbox filter as it ran
for the address, or the SQL recipient query), or it answered with an
account or group on a domain it doesn't serve (Details holds the address
it answered with). It carries the recipient, its domain and the session.

It is raised only when the address ends up refused: a mailing list,
catch-all or relay domain that still takes the address logs nothing, so
mailing lists on directory domains don't fill the log. Sign-in lookups
are untouched.

Test: per_domain_directory_tests checks the no-entry case with its query,
the DIR-6 case through a directory that looks recipients up by alias,
and that an accepted address raises nothing.

Fixes #364
jcoffey-dev added 1 commit 2026-11-11 00:22:54 +00:00
trc: rustfmt the new event's description line (#364)
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 12m45s
ca8e2aa4ff
jcoffey-dev merged commit 1431002e6b into main 2026-11-11 00:35:59 +00:00
jcoffey-dev deleted branch fix/364-directory-rcpt-miss-logs 2026-11-11 00:36:00 +00:00
jcoffey-dev referenced this issue from a commit 2026-11-11 06:46:21 +00:00
Sign in to join this conversation.