Skip to content

Commit

Permalink
fix: dmarc v and p options need to be first (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
mskrajnowski authored Jul 9, 2024
1 parent 8796045 commit 72d0dcc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ses/domain/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ locals {
adkim = var.dmarc_strict_dkim_alignment ? "s" : "r"
aspf = var.dmarc_strict_spf_alignment ? "s" : "r"
}

# v= and p= options need to be first
# https://support.google.com/a/answer/10032169
dmarc_options_order = ["v", "p", "sp", "pct", "rua", "adkim", "aspf"]
}

resource "aws_route53_record" "dmarc" {
Expand All @@ -119,7 +123,7 @@ resource "aws_route53_record" "dmarc" {
name = "_dmarc.${local.domain}."
type = "TXT"
ttl = 300
records = [join(";", [for k, v in local.dmarc_options : "${k}=${v}"])]
records = [join(";", [for k in local.dmarc_options_order : "${k}=${local.dmarc_options[k]}"])]
}

# sender policy ---------------------------------------------------------------
Expand Down

0 comments on commit 72d0dcc

Please sign in to comment.