-
Notifications
You must be signed in to change notification settings - Fork 0
/
mail.tf
54 lines (49 loc) · 1.59 KB
/
mail.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
resource "hcloud_rdns" "reverse_dns_4" {
server_id = hcloud_server.nix-pizza.id
ip_address = hcloud_server.nix-pizza.ipv4_address
dns_ptr = "mail.nix.pizza"
}
resource "cloudflare_record" "mail_record_4" {
provider = cloudflare.dns
zone_id = data.cloudflare_zone.nix_pizza_zone.id
name = "mail.nix.pizza"
value = hcloud_server.nix-pizza.ipv4_address
type = "A"
ttl = 10800
}
resource "cloudflare_record" "mx_record_4" {
provider = cloudflare.dns
zone_id = data.cloudflare_zone.nix_pizza_zone.id
type = "MX"
name = "@"
value = "mail.nix.pizza"
priority = 10
proxied = false
ttl = 300
}
resource "cloudflare_record" "spf_record" {
provider = cloudflare.dns
zone_id = data.cloudflare_zone.nix_pizza_zone.id
name = "nix.pizza"
proxied = false
ttl = 10800
type = "TXT"
value = "v=spf1 a:mail.nix.pizza ~all"
}
# cat /var/dkim/nix.pizza.mail.txt
resource "cloudflare_record" "dkim_record" {
provider = cloudflare.dns
zone_id = data.cloudflare_zone.nix_pizza_zone.id
name = "mail._domainkey.nix.pizza"
value = "v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC1fmBfXdR6HV/sHziAej0AtrZSgBSvanZfXs8NjfmjzxBtBUTeqxsBY761iPYiLmHZiRdi7H6DetXNSKo3ivfW8X66VVqjSSLMx75NDLauauDMP+sfYbA8nQTZjsoigOgPelGsBym2TlE/I1SgG7L0a3f5DEVGynQ6AYIYFhLUewIDAQAB"
type = "TXT"
ttl = 10800
}
resource "cloudflare_record" "dmarc_record" {
provider = cloudflare.dns
zone_id = data.cloudflare_zone.nix_pizza_zone.id
name = "_dmarc"
value = "v=DMARC1; p=reject; pct=100"
type = "TXT"
ttl = 10800
}