Commit a6c8a176 authored by Colin Shea's avatar Colin Shea

also fill in v=spf1

parent 1a56271b
......@@ -190,6 +190,9 @@ class Zone
end
def spf(text, ttl=nil)
if text !~ /^v=spf1/
text = "v=spf1 #{text.strip}"
end
push :spf, "@", ttl, text: text
push :txt, "@", ttl, text: text
end
......
......@@ -185,5 +185,10 @@ describe Zone do
subject.zonefile.spf.must_equal [{:class=>"IN", :name=>"@", :ttl=>nil, :text=>"v=spf1 include:_spf.google.com include:acmeemailmarketing.com ~all"}]
subject.zonefile.txt.must_equal [{:class=>"IN", :name=>"@", :ttl=>nil, :text=>"v=spf1 include:_spf.google.com include:acmeemailmarketing.com ~all"}]
end
it "fills in v=spf1" do
subject.spf "include:_spf.google.com include:acmeemailmarketing.com ~all"
subject.zonefile.spf[0][:text].must_equal "v=spf1 include:_spf.google.com include:acmeemailmarketing.com ~all"
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment