Date: Tue, 11 Jul 2000 01:14:16 -0700 From: "Hank Wethington" <bsd@info-logix.com> To: <cjclark@alum.mit.edu>, <freebsd-questions@freebsd.org> Subject: RE: Having ppp(8) Set Hostname Message-ID: <KFEIIDCJNHBCGLAFNMJIAEKOCHAA.bsd@info-logix.com> In-Reply-To: <20000711002558.D182@dialin-client.earthlink.net>
next in thread | previous in thread | raw e-mail | index | archive | help
This is probably a bad place to say so, but instead of having you machine
try to send mail when using earhtlink, just use E-links mail servers, they
allow open relay. Of course if you are sending to someone who black lists
e-link then your stuck with your method.
Normally when doing a reverse dns lookup, it is not just looking for the ip,
since it can be spoofed, but the host name to match the ip. i.e.
adsl-63-194-112-63.dsl.snlo01.pacbell.net
Not sure what it would be for e-link though.
Hank
-----Original Message-----
From: owner-freebsd-questions@FreeBSD.ORG
[mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of Crist J. Clark
Sent: Tuesday, July 11, 2000 12:26 AM
To: freebsd-questions@freebsd.org
Subject: Having ppp(8) Set Hostname
My mail forwarding recently stopped working unless my PC has a valid
hostname. I am trying to get ppp(8) to set the hostname
automatically... but it turning out to be a lot harder than I
thought. I am trying to get it done in a ppp.linkup,
EarthLink:
shell /root/sethostfromip MYADDR
!bg /usr/sbin/sendmail -q
!bg su cjc -c /usr/local/bin/fetchmail
The script 'sethostfromip' does a reverse-lookup of MYADDR and tries
to set the hostname accordingly (yeah, a quick program would probably
be better, but I'm lazy),
if [ expr $1 : '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' > /dev/null 2>&1 ]; then
IP=$1
else
IP=`ifconfig tun0 | awk '/inet/ { print $2 }'`
fi
HOSTNAME=`nslookup $IP | awk '/^Name:/ { print $2 }'`
hostname $HOSTNAME
However, the nslookup keeps failing and neither the sendmail or
fetchmail runs very reliably. Here the stderr output from the
sethostfromip when I wake up the PPP connection right now,
*** Can't find server name for address 207.217.126.81: Timed out
*** Can't find server name for address 207.217.77.82: Timed out
*** Default servers are not available
Here is the ppp.log showing those actually being run,
Jul 11 00:22:31 <daemon.info> dialin-client ppp[58]: tun0: Command:
EarthLink: shell /root/sethostfromip MYADDR
Jul 11 00:23:03 <daemon.info> dialin-client ppp[58]: tun0: Command:
EarthLink: !bg /usr/sbin/sendmail -q
Jul 11 00:23:03 <daemon.info> dialin-client ppp[58]: tun0: Command:
EarthLink: !bg su cjc -c /usr/local/bin/fetchmail
Others must be setting new hostname when they do a dialup, right? How
do you do it? I'm suprised it's not an option built into ppp... Or is
it and I have not managed to find it?
--
Crist J. Clark cjclark@alum.mit.edu
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?KFEIIDCJNHBCGLAFNMJIAEKOCHAA.bsd>
