Mon 98-01-12 "Mark A. Matthews" <markm(_at_)XMission(_dot_)com> list.procmail
| jari(_dot_)aalto(_at_)ntc(_dot_)nokia(_dot_)com writes:
| >b) It takes lot of time for _each_ mail if you try to do even nslookup,
| > the call may block for several seconds.
|
| However, if the message is destined for something like a closed mailing
| list which is going to attempt to reply to the message anyway, the cost of
| validating the address at the filter stage is cheaper
I agree that there may be cases when it makes sense to use nslookup,
but I wouldn't running it for every message I receive. I already have
in my Emacs Gnus package called TinyGnus, which handles the UBE complaints
for the postmasters by running nslookup for every parsed received field ip
address.
What I have learned (and I love perl), is that do not use perl with procmail
if you can do things with less effort. Just check the OK flag for the
nslookup results. Could someone post their nslookup results to me or
to this group so that I could see how much differencies are there.
I have HP 9 and 10 here.
Can I rely on the regexp used in my recipe to check nslookup?
nslookup always seem to return exitcode 0 regadrless of failure or
success.
jari
% nslookup -querytype=MX geocities.com
Name Server: zeus.tele.nokia.fi
Address: 131.228.134.50
Non-authoritative answer:
geocities.com preference = 0, mail exchanger = mail.geocities.com
Authoritative answers can be found from:
com nameserver = H.ROOT-SERVERS.NET
% nslookup uta.fi
Name Server: zeus.tele.nokia.fi
Address: 131.228.134.50
Non-authoritative answer:
Name: uta.fi
Address: 153.1.1.12
% nslookup foo.com
Name Server: zeus.tele.nokia.fi
Address: 131.228.134.50
Name: foo.com
Address: 209.54.94.60
% nslookup foo.bar.com
pegasus txt nslookup foo.bar.com
Name Server: zeus.tele.nokia.fi
Address: 131.228.134.50
*** No address information is available for "foo.bar.com"
NSLOOKUP = "/usr/bin/nslookup -querytype=MX"
ADDR = `formail -rt`
OK = "no"
:0
* ADDR ?? @\/.*
{
ADDR = $MATCH
STAT = `$NSLOOKUP $ADDR`
# If nslookup succeeds it returns
#
# Non-authoritative answer:
# Name: uta.fi
#
# Or
#
# Non-authoritative answer:
# geocities.com preference = 0, mail exchanger = mail.geocities.com
#
:0
*$ STAT ?? answer:($)(Name:|$ADDR)|(Name:.*$ADDR)
{ OK = "yes" }
}
:0
* OK ?? no
{
# nslookup failed, whatever the reason might have been
# Name server down?
}