https://github.com/rsclarke/terraform-cloudflare-mta-sts
MTA-STS DNS records and policy worker
https://github.com/rsclarke/terraform-cloudflare-mta-sts
cloudflare email mta-sts security spam-protection terraform worker
Last synced: 3 months ago
JSON representation
MTA-STS DNS records and policy worker
- Host: GitHub
- URL: https://github.com/rsclarke/terraform-cloudflare-mta-sts
- Owner: rsclarke
- License: mit
- Created: 2021-02-06T09:38:26.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2026-03-26T09:41:11.000Z (3 months ago)
- Last Synced: 2026-03-27T01:42:12.780Z (3 months ago)
- Topics: cloudflare, email, mta-sts, security, spam-protection, terraform, worker
- Language: HCL
- Homepage: https://registry.terraform.io/modules/rsclarke/mta-sts/cloudflare/latest
- Size: 18.6 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# terraform-cloudflare-mta-sts
This module creates the necessary DNS records to support MTA-STS and SMTP TLS reporting. In addition, a Cloudflare Worker serves the MTA-STS policy, note that this worker does not accept the reports and you must specify a location which does through the `rua` variable.
## Usage
```terraform
resource "cloudflare_zone" "example_com" {
zone = "example.com"
}
module {
source = "rsclarke/mta-sts/cloudflare"
account_id = "0123456789abcdef"
zone_id = cloudflare_zone.example_com.id
zone_name = cloudflare_zone.example_com.name
mode = "enforce"
mx = ["mx1.example.com", "mx2.example.net"]
max_age = 604800 # 1 week in seconds
rua = ["mailto:tls_report@example.org", "https://example.org/mta-sts/report"]
}
```
## Providers
| Name | Version |
|------|---------|
| cloudflare | `~>5.0` |
## Inputs
| Name | Description | Type | Required |
|------|-------------|------|:--------:|
| account_id | Cloudflare Account ID | `string` | yes |
| zone_id | Cloudflare Zone ID | `string` | yes |
| zone_name | Cloudflare Zone Name | `string` | yes |
| mode | Sending MTA policy application, [rfc8461#section-5](https://tools.ietf.org/html/rfc8461#section-5). Default `testing` | `string` | no |
| mx | List of permitted MX hosts, at least one | `list(string)` | yes |
| max_age | Maximum lifetime of the policy in seconds, up to 31557600, defaults to 604800 (1 week) | `number` | no |
| rua | Locations to which aggregate reports about policy violations should be sent, either `mailto:` or `https:` schema. | `list(string)` | yes |
## Outputs
This module does not expose any outputs.