mirror of
https://github.com/KumoCorp/kumomta.git
synced 2026-09-21 08:01:11 +00:00
Previously we'd go as far as the OS would let us. This introduces the ability to set an upper bound, and our default for this is 32k connections, or half of the possible u16 port space. I picked half because the ideal for an MTA is using half of its resources to receive and the other half to send. The math for that is more complex for multi-homed machines or systems using proxies, but it feels like a reasonable default; not too low that it will be painfully surprising for existing users to discover on upgrade, and not so high that new installations are as easily overwhelmed in the face of high incoming traffic. A new total_connections_denied counter is added that is bumped whenever this or the over-memory limit are reached and we turn away a session with a 421. The idea is that the operator may want to investigate these events, and we don't otherwise have a stream of information about them because they are deliberately not logged to the normal delivery logs.