${client_connections}

Count of simultaneous client connections V8.13 and later

When a host connects to the listening sendmail server, that server forks a child copy of itself to handle the new connection. Before forking, the server increments the connection count associated with the IP address of the connecting client. When the forked child finishes and exits, the server decrements that count.

Beginning with V8.13 sendmail, the ${client_connections} macro holds that count as its value, making it available for use in rule sets.

With V8.13, if you declare FEATURE(conncontrol) (FEATURE(conncontrol) on page 619), a rule set called ConnControl will be added to your configuration file that looks up the current IP address in the access database. The source text file for the access database may contain that address with a literal ClientConn: prefix, as, for example:

ClientConn:123.45.67.89          12

Note that the literal prefix is followed by the IP address to be looked up, then tabs or spaces,[316] and lastly by the limit to impose on the maximum number of connections for that IP address.

If the number of connections (as stored in this ${client_connections} macro) exceeds the limit imposed inside the access database, the new connection is rejected with the following error:

433 4.3.0 Too many open connections.

[316] * Unless the -t command-line argument is used with makemap to change the separator.

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.