FEATURE(conncontrol)

Check SMTP RCPT TO: first V8.13 and later

FEATURE(conncontrol) allows you to use the access database to control the number of simultaneous connections another machine may have to your server.[240] The number of simultaneous connections allowed each interval is based on the setting of the ConnectionRateWindowSize option (ConnectionRateWindowSize on page 989), which defaults to 60 seconds. So, for example, if you want to reject a host that has more than 10 simultaneous connections to your server (sometime in the past 60 seconds), where that host has the IP address 192.168.23.45, you would put the following into your access database source file:

ClientRate:192.168.23.45       10

Here, if the host with the IP address 192.168.23.45 tries to set up an 11th simultaneous connection to your server, that connection will be denied.

You enable FEATURE(conncontrol) like this:

FEATURE(`conncontrol')

But note, if you have not already declared the access database (The access Database on page 277), you must do so before declaring this new feature, or you will get the following error when building your new configuration file:

*** ERROR: FEATURE(conncontrol) requires FEATURE(access_db)

Once you have successfully enabled this FEATURE(conncontrol), you may use it to control the number of simultaneous connections, based on IP addresses of hosts or networks, or to set the default limit:

ClientRate:192.168.23.45 2 ClientRate:127.0.0.1 0 ClientRate: 10 ClientRate:10.5.2 2 ClientRate:IPv6:2002:c0a8:51d2::23f4 ...

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.