From owner-freebsd-questions Sun Jul 16 18:26:15 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id SAA18002 for questions-outgoing; Sun, 16 Jul 1995 18:26:15 -0700 Received: from mail.barrnet.net (mail.barrnet.net [131.119.246.7]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id SAA17996 for ; Sun, 16 Jul 1995 18:26:14 -0700 Received: from winjef.somerset (slip154.hk.super.net [202.64.10.11]) by mail.barrnet.net (8.6.10/MAIL-RELAY-LEN) with ESMTP id SAA07984 for ; Sun, 16 Jul 1995 18:26:10 -0700 Received: (from john@localhost) by winjef.somerset (8.6.11/8.6.9) id UAA00282; Sat, 15 Jul 1995 20:03:19 +0800 Date: Sat, 15 Jul 1995 20:03:18 +0800 (HKT) From: John Beukema To: questions@freebsd.org Subject: downloading mail from ISP Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: questions-owner@freebsd.org Precedence: bulk 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