Artica Wiki

Per-client limits

Cap the connections, messages and recipients one client address may submit, internal networks included

Per-client limits cap how much one client address may submit to your SMTP service per time unit: simultaneous sessions, new connections, messages and recipients. 
A client that goes beyond a limit receives a temporary error: its mail waits on its own side and is retried later, instead of flooding your relay and the providers behind it. 
Unlike the Postfix default, the limits also apply to your own networks, which is where most floods come from.

The feature is available from the menu SMTP Router > Inbound flow > Per-client limits.

Per-client limits page: state widget, limits, exempt clients and the configuration read back from Postfix

Functional benefits

Concepts

How a per-client limit is evaluated

What is counted

Every counter is kept per client IP address by the Postfix anvil service, over a sliding time unit (60 seconds by default, between 10 seconds and 1 hour):

Limit Meaning Proposed value
Simultaneous sessions SMTP sessions open at the same time by one address (not per time unit). 50 (the Postfix default)
Connections New connections per time unit. Unlimited
Messages Messages submitted per time unit. 300 per minute
Recipients Recipients (RCPT TO) per time unit. 3,000 per minute

A value of 0 means no limit. The proposed values stay far above what any single legitimate host sends through a typical gateway, while cutting a runaway job down to a rate your relay and its peers absorb.

Exempt clients

Important: an exempt client escapes every limit of this page, the simultaneous sessions included. This is why the session limit is a field of the page: when your networks are no longer exempt, an internal relay or load balancer that legitimately opens many sessions needs either a higher value or its own exemption.

Use cases

Configure

Per-client limits settings

Choosing values. Before tightening the limits, open the Clients this hour tab of the Volume alerts: it lists how many messages each client address submitted over the last 60 minutes. Set the message limit well above the largest legitimate client.

Check that it works

In the lab, with a limit of 3 messages per minute and the trusted networks not exempt, five messages sent in a row from one host gave:

message 1, 2, 3  -> 250 accepted
message 4, 5     -> 450 4.7.1 Error: too much mail from 192.168.1.142

The same five messages submitted from 127.0.0.1 were all accepted: loopback stays exempt.