diff options
author | 2025-05-28 23:19:12 +0100 | |
---|---|---|
committer | 2025-05-28 23:19:12 +0100 | |
commit | db267ed921aafc5861e2a1c0392e044fe159aa64 (patch) | |
tree | fc314b42e565d6991d043a5e32695e5eed5c7b3e | |
parent | Add DMARC module root (diff) |
Use PSL for DMARC lookups
-rw-r--r-- | lib/dmarc.ex | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/dmarc.ex b/lib/dmarc.ex index 9c74471..1be5da3 100644 --- a/lib/dmarc.ex +++ b/lib/dmarc.ex @@ -1,8 +1,10 @@ defmodule Lithium.DMARC do require Logger - + def get_dmarc_record(domain) do - with {:ok, records} <- Lithium.DNS.fetch_txt("_dmarc." <> domain) do + with od <- Lithium.Util.PublicSuffix.get_domain(domain), + {:ok, records} <- Lithium.DNS.fetch_txt("_dmarc." <> od) do + filtered = records |> Enum.map(&String.trim/1) |