4.5. Message suspension
The pickup policy subsystem implements a suspension list to enforce concurrency, rate and connectinterval limits. This suspension list can be used directly to temporarily pause and resume traffic in the active queue. For a more permanent suspension, like a quarantine for spam, put messages on hold instead.
The default
start configuration’s
environment.suspendconf
directive
loads it from /etc/halon/smtpd-suspend.yaml.
It is described by, and can be validated with, the
smtpd-suspend.schema.json
JSON schema (included in our Visual Studio Code integration).
In addition to the configuration file on disk, policy conditions can be added on the fly over the
Protocol Buffer API’s PolicyConditionAddRequest
function, command line interface,
web administration,
as well as from the pre- and post-delivery script.
Lists may be used to reference and suspend multiple field values at the same time.
The example below suspends all emails on the “customer1” transport to the destination “gmail.com”:
suspends:
- transportid: customer1
recipientdomain: gmail.com
4.5.1. Excluding IPs from pool
A queued email can have multiple designated source IPs, which can be used to load balance between a pool
of source IPs in a round-robin fashion. The list of source IPs (and matching HELO hostnames) can be configured per transport,
or overridden by the “sourceip” argument to the pre-delivery script’s Try()
function.
Queuing an email with multiple source IPs has the benefit of being able to dynamically suspend specific source IPs,
while still allowing a queued email to be sent using the other IPs. Consider the following example:
suspends:
- localip: 192.0.2.1
recipientdomain: gmail.com
Since localip
is a list, emails queued with both “192.0.2.1” and another IP will still be sent to “gmail.com”
from that other source IP.