# PolicySet

The [PolicySet](/api/policyset.md) type represents all data provided by the postfix server in a typed and self-descriptive manner. Once your policy server receives data from postfix the data will be internally processed and as a result, a [PolicySet](/api/policyset.md) is created that is then provided as a pointer to the `Handle()` method of your [Handler](/api/handler.md) interface.

The [PolicySet](/api/policyset.md) currently consists of the following properties and follows the [Postfix documentation](http://www.postfix.org/SMTPD_POLICY_README.html). Please check the Postfix docs on details to the properties.

{% tabs %}
{% tab title="Signature" %}

```go
type PolicySet struct {
	// Postfix version 2.1 and later
	Request           string
	ProtocolState     string
	ProtocolName      string
	HELOName          string
	QueueId           string
	Sender            string
	Recipient         string
	RecipientCount    uint64
	ClientAddress     net.IP
	ClientName        string
	ReverseClientName string
	Instance          string

	// Postfix version 2.2 and later
	SASLMethod       string
	SASLUsername     string
	SASLSender       string
	Size             uint64
	CCertSubject     string
	CCertIssuer      string
	CCertFingerprint string

	// Postfix version 2.3 and later
	EncryptionProtocol string
	EncryptionCipher   string
	EncryptionKeysize  uint64
	ETRNDomain         string

	// Postfix version 2.5 and later
	Stress bool

	// Postfix version 2.9 and later
	CCertPubkeyFingerprint string

	// Postfix version 3.0 and later
	ClientPort uint64

	// Postfix version 3.1 and later
	PolicyContext string

	// Postfix version 3.2 and later
	ServerAddress net.IP
	ServerPort    uint64

	// postfix-policy-server specific values
	PPSConnId string
}
```

{% endtab %}
{% endtabs %}

Besides of all values provided by the Postfix server, **pps** adds some package specific values, that might be useful in your program. The list of pps-specific values currently is:

| Property  | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| PPSConnId | `string` | <p>Each time Postfix connects to your policy <br>service, a unique connection id is assigned</p><p>to it. The <code>PPSConnId</code> property represents</p><p>this <code>string</code>.</p><p></p><p><strong>Note: Please keep in mind, that the Postfix</strong> </p><p><strong>specifications require that a connection</strong> </p><p><strong>can be re-used by Postfix. Therefore you</strong></p><p><strong>might see multiple PolicySets with the</strong> </p><p><strong>same connection id.</strong></p> |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pps-docs.pebcak.de/api/policyset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
