# ReceiptRuleOptions

Options to add a receipt rule to a receipt rule set.

Used as argument in: [IReceiptRuleSet.addRule](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ses.IReceiptRuleSet.html#addrule)

- Source: [`aws-ses/lib/receipt-rule.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts#L45)
- Type last changed: v2.235.0 · 15 Jan 2026

## Example

TypeScript:

```ts
const ruleSet = new ses.ReceiptRuleSet(this, 'RuleSet');

const awsRule = ruleSet.addRule('Aws', {
  recipients: ['aws.com'],
});
```

Python:

```python
rule_set = ses.ReceiptRuleSet(self, "RuleSet")

aws_rule = rule_set.add_rule("Aws",
    recipients=["aws.com"]
)
```

Java:

```java
ReceiptRuleSet ruleSet = new ReceiptRuleSet(this, "RuleSet");

ReceiptRule awsRule = ruleSet.addRule("Aws", ReceiptRuleOptions.builder()
        .recipients(List.of("aws.com"))
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var ruleSet = new ReceiptRuleSet(this, "RuleSet");

var awsRule = ruleSet.AddRule("Aws", new ReceiptRuleOptions {
    Recipients = new [] { "aws.com" }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
ruleSet := ses.NewReceiptRuleSet(this, jsii.String("RuleSet"))

awsRule := ruleSet.addRule(jsii.String("Aws"), &ReceiptRuleOptions{
	Recipients: []*string{
		jsii.String("aws.com"),
	},
})
```

## Properties

- `actions`: [IReceiptRuleAction](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ses.IReceiptRuleAction.html)[] — An ordered list of actions to perform on messages that match at least one of the recipient email addresses or domains specified in the receipt rule.

  **Default:** No actions.

- `after`: [IReceiptRuleRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ses.IReceiptRuleRef.html) — An existing rule after which the new rule will be placed.

  **Default:** The new rule is inserted at the beginning of the rule list.

- `enabled`: boolean = true — Whether the rule is active.

- `receiptRuleName`: string — The name for the rule.

  **Default:** A CloudFormation generated name.

- `recipients`: string[] — The recipient domains and email addresses that the receipt rule applies to.

  **Default:** Match all recipients under all verified domains.

- `scanEnabled`: boolean = false — Whether to scan for spam and viruses.

- `tlsPolicy`: [TlsPolicy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ses.TlsPolicy.html) — Whether Amazon SES should require that incoming email is delivered over a connection encrypted with Transport Layer Security (TLS).

  **Default:** Optional which will not check for TLS.
