-----Original Message-----
From: owner-spf-discuss(_at_)v2(_dot_)listbox(_dot_)com
[mailto:owner-spf-discuss(_at_)v2(_dot_)listbox(_dot_)com] On Behalf Of
Stuart
D. Gathman
Sent: vrijdag 19 november 2004 16:36
To: spf-discuss(_at_)v2(_dot_)listbox(_dot_)com
Subject: [spf-discuss] TXT lookup problem
The SPF record for pobox.com is giving me trouble. It comes in
two pieces:
pobox.com text "v=spf1 mx mx:fallback-relay.%{d}
a:webmail.%{d} a:smtp.%{d} a:discards.%{d}
mx:store.discard.%{d} a:emerald.%{d} redirect=%{l1r"
"+}._at_.%{o}._spf.%{d}"
Ok, my DNS library give me a list of TXT records. I currently
go through the list looking for exactly 1 record that begins with
"v=spf1".
What OS are you on? It returns just 1 answer to me:
---------------------------
asarian-host: {root} % dig pobox.com txt
; <<>> DiG 8.4 <<>> pobox.com txt
;; res options: init recurs defnam dnsrch
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15918
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 5
;; QUERY SECTION:
;; pobox.com, type = TXT, class = IN
;; ANSWER SECTION:
pobox.com. 1H IN TXT "v=spf1 mx mx:fallback-relay.%{d}
a:webmail.%{d} a:smtp.%{d} a:discards.%{d} mx:store.discard.%{d}
a:emerald.%{d} redirect=%{l1r" "+}._at_.%{o}._spf.%{d}"
---------------------------
Now it appears that I must glue these two pieces together.
At only 151 bytes length, I see no reason why it should return two parts.
You could try and run the below test, and see what you get returned. It only
returns 1 item here.
Cheers,
- Mark
System Administrator Asarian-host.org
---
"If you were supposed to understand it,
we wouldn't call it code." - FedEx
------------------------------
#!/usr/local/bin/perl
use Net::DNS;
$res = Net::DNS::Resolver -> new;
$packet = $res -> query ('pobox.com', 'TXT');
foreach $rr ($packet->answer) {
push @r, $rr->txtdata if $rr->type eq "TXT";
}
$i = 0;
foreach (@r) {
print ++$i . ": $_\n";
}
print "\n";
exit 0;