Hello!
I've just started using the spf module, and discovered a problem: the
%{h} macro expands to the sender's domain (like %{o}), but that's not
what the RFC seems to say, and it's not what at least one SPF record
I've encountered expects.
The SPF record at
robertwalters.com.tw says:
v=spf1 include:%{i}._ip.%{h}._ehlo.%{d}._spf.vali.email ~all
and it expects that %{i} matches the address of the %{h} name, so if I
expand it to:
208.82.5.201._ip.robertwalters.com.tw._ehlo.robertwalters.com.tw._spf.vali.email
(like the go module currently does), I get `v=spf1 -all`, but if I
expand it to:
208.82.5.201._ip.mailpmta200a.broadbean.net._ehlo.robertwalters.com.tw._spf.vali.email
(like other SPF validation libraries do, for example Perl's
Mail::SPF), I get `v=spf1 ip4:
208.82.5.0/24 -all` which resolves to
"pass"
Since we can send email on behalf of
robertwalters.com.tw from our
MTA, I have to conclude that the Go SPF module needs patching.
I'm attaching such a patch, with tests.
--
dakkar
a.k.a. Gianni Ceccarelli