<a id="queue-suspend"></a>

<a id="message-suspension"></a>

# 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](config_startup.html.md)’s
[`environment.suspendconf`](config_startup.html.md#confval-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](http://lbovet.github.io/docson/index.html#https://docs.halon.io/json-schemas/6.12-stable/smtpd-suspend.schema.json)
[JSON schema](https://docs.halon.io/json-schemas/6.12-stable/) (included in our [Visual Studio Code integration](vscode.html.md)).

In addition to the configuration file on disk, policy conditions can be added on the fly over the
[Protocol Buffer](https://docs.halon.io/protobuf-schemas/6.12-stable/) API’s `PolicyConditionAddRequest` function, [command line interface](cli.html.md),
[web administration](web.html.md),
as well as from the pre- and [post-delivery script](https://docs.halon.io/hsl/archive/6.12-stable/postdelivery.html).

[Lists](config_smtpd.html.md#config-list) 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”:

```yaml
suspends:
  - transportid: customer1
    recipientdomain: gmail.com
```

<a id="excluding-ips-from-pool"></a>

## 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](https://docs.halon.io/hsl/archive/6.12-stable/predelivery.html)’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:

```yaml
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.
