diff options
Diffstat (limited to 'lib/dmarc.ex')
-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) |