Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jul 1995 20:03:18 +0800 (HKT)
From:      John Beukema <john@winjef.somerset>
To:        questions@freebsd.org
Subject:   downloading mail from ISP
Message-ID:  <Pine.BSF.3.91.950715194627.268A-100000@winjef.somerset>

next in thread | raw e-mail | index | archive | help

After some fooling around, I have worked out simple scripts to login and 
download my mail from my ISP using iijppp in auto mode.  I enclose the 
scripts for anyone who might be interested.  After it is downloaded, the 
mail can be read using mail, elm or pine or, if you load the pop3 server, 
can be further downloaded by Eudora (network version) by the technically 
challanged on the LAN.  Sendmail works fine through either Eudora or mail 
and iijppp for mail out.


---------------- cut here ---------------------
#################################################################
# /etc/ppp/ppp.conf
# Default setup. Executed always when PPP is invoked.
#
default:
 set device /dev/cuaa0
 set speed 57600
 disable lqr
 deny lqr
 set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" ATE1Q0 OK-AT-OK \\dATDT\\T TIMEOUT 40 CONNECT"
#
# On demand dialup example
#  dynamic IP addressing for local side
#  remote side uses 202.14.67.39 as their IP address.
#  You must supply -auto option to invoke PPP.
#
#  ex. % ppp -auto ondemand
#
ondemand:
 set debug chat phase  lcp
 set phone 12345678
 set login "TIMEOUT 5 login: jbeukema ssword: XXXXX nnex: ppp"
 set timeout 120
 set ifaddr 0 202.14.67.39
 dial


.netrc contents
---------------  cut here ------------------
machine is1.hk.super.net login jbeukema password XXXXX
macdef init
cd /usr/spool/mail
get jbeukema johnmail
delete jbeukema
close
bye
default login ftp password jbeukema@hk.super.net

getmail contents
------------------ cut here -------------------
#!/bin/sh
# to wake up ppp -auto
ping -c 1 202.14.67.39 > /dev/null
sleep 30
ftp is1.hk.super.net >> /tmp/getmail.log
if [ -e johnmail ] 
then
	cat johnmail >> /var/mail/john
	rm johnmail
	echo "You have new mail (:-)"
	pine
else
	echo "No mail. (;-("
fi

----------------- cut here ------------------

to run .netrc must be mode 600 in a home directory.  ./getmail will fire 
up ppp, log in under ftp, download any mail, delete the mail file at the 
IPC and add it to the users mail file.  

It does not try to lock the mail file at the IPC nor verify correct
transmission, nor handle errors which is left as an exercise for the
users... 

jbeukema




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.950715194627.268A-100000>