open
https://gitlab.synchro.net/main/sbbs/-/work_items/1384
When a server reaches its client limit it refuses new connections, but only logs each refusal as a `LOG_WARNING` line. Nothing reaches the sysop, so a server can spend minutes turning everyone away without anyone noticing until users complain.
On Vertrauen's web server (`MaxClients=200`) on 2026-11-21, the journal has 982 of these:
```
web 0097 HTTPS [88.234.87.7] !MAXIMUM CLIENTS (200) exceeded by 1, access denied
web 0046 HTTP [67.20.5.220] !MAXIMUM CLIENTS (200) exceeded (201), access denied
```
in three episodes: 04:57-04:59 (550), 09:50-09:51 (411) and 11:04 (21). These came from scraper bursts, and there was no notification for any of them.
## Request
An optional, per-server setting that notifies the sysop when that server starts refusing connections because it is at its client limit. Off by default. On Vertrauen it would be turned on for the web server in `sbbs.<host>.ini`.
Where the limit is enforced today:
- Web server: `web_server()` accept loop (`!MAXIMUM CLIENTS (%u) %s (%u), access denied`, 503) and `http_session_thread()` (`exceeded by %u`).
- FTP server: accept loop (`421 Maximum active clients reached`).
- Mail server: accept loop (SMTP/POP3 `Maximum active clients reached`).
- Services: per service (`service[i].max_clients`), which could use a per-service ini key in `services.ini`.
## Behaviour
- **One notification per episode, not per refused connection.** The first refusal sends it. No more are sent until the server has been back under its limit for a while, so a sustained or repeated burst can't flood the sysop. That interval can be fixed, or a setting.
- **The notification says how bad it was.** For example, the first refused client, the limit, and either at the first refusal or in a closing summary when the episode ends: how many connections were refused, over what span, and the busiest source subnets.
- **It uses the existing error-notification path,** so it goes wherever the sysop already gets error notices (`erruser`/`errlevel` in `main.ini`, i.e. `errorlog()` → `notify()`), plus the MQTT error topic. The simplest version is one `LOG_ERR`-level line per episode, which gives the notification, the `error.log` entry and MQTT for free.
## Implementation notes
- The `*_startup_t` structs are an ABI boundary with `sbbsctrl.exe` (it checks their `sizeof()`), so a new field there is a problem. A new bit in each server's existing `Options` value (e.g. `WEB_OPT_NOTIFY_MAX_CLIENTS`, and the FTP/mail equivalents) avoids that and is naturally per-server: `Options = ... | NOTIFY_MAX_CLIENTS` in `[Web]`.
- The episode state (first refusal, count, last refusal time) is small and would be identical in each server. It suits a shared header-only helper, as `ratelimit_filter.hpp` does for the rate-limit handling.
- The option should be exposed in SCFG's server configuration, alongside each server's client limit.
— *Authored by Claude (Claude Code), on behalf of @rswindell*
--- SBBSecho 3.38-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)