From brian@UCB.EDU.BZ Fri Jan 26 07:28:26 1996 Date: Fri, 12 Jan 1996 10:38:18 -0600 From: Brian Candler To: Multiple recipients of list BIG-LINUX Subject: Re: Mailbox Routing help > What I want to do is have a machine > that is on the net 24/7 connect to my machine at home via uucp over tcp/ip > - - I'll have my home machine poll for mail every x hours. What I need to > know is, how do I configure sendmail on the live net machine, and how do I > configure it on the intermittently connected home machine? We have been using uucp over TCP/IP here. Here's what you need to do on the machine which is initiating the uucp call: (1) Make sure you have the following in /etc/services uucp 540/tcp uucpd # uucp daemon (2) Add the following line to /var/lib/uucp/hdb_config/Devices TCP uucp - - (3) The /var/lib/uucp/hdb_config/Systems file entry looks like this: Any TCP - in:--in: word: Where is the uucpname of the other end of the link, is the domain name to call up (it goes where the telephone number is normally) (4) If you include multiple adjacent lines for the same uucpname they will be tried in turn; this lets you attempt uucp over TCP/IP, with an automatic dial-up backup. Example: uunet Any TCP - relay1.uu.net in:--in: myname word: wombat uunet Any ACU 38400 18001234567 in:--in: myname word: wombat (5) If this is a dial-up TCP/IP link you have to arrange that the line is brought up automatically. If you have diald installed and running, problem solved. If not, you need a script. Here's one I use; it is programmed defensively since there have been problems with our service provider. ---------------------------- cut here ------------------------------ #!/bin/sh # /usr/local/bin/poll-slip # Do a mail poll. Call host; bring up and down the SLIP link if necessary # (a kludge until I get diald running) PROG=uucico HOST=route # uucpname HOSTIP=rg.net # domain name or IP number CLOCKIP=rip.psg.com # machine to set clock to UUCICO=/usr/lib/uucp/$PROG didslip="" # bring up SLIP if necessary function downslip() { if [ "$didslip" != "" ]; then sleep 3 # let TCP connection hang up properly /sbin/dip -k &>/dev/tty8 /dev/null if [ "$?" != "0" ]; then date &>/dev/tty8 /sbin/dip -v /etc/isp.dip &>/dev/tty8 /dev/null if [ "$?" != "0" ]; then /sbin/dip -v /etc/isp.dip &>/dev/tty8 /dev/null if [ "$?" != "0" ]; then downslip sleep 5 # wait for line to drop so uucico can use it if req'd fi } # function checklastpoll: # Check for possible errors: all matching ports in use; line disconnected # (also tends to give write I/O errors when our uucp tries to send uucp # shutdown sequence); timed out in chat script (=remote end not answering) # If these don't apply, then we expect the call was completed OK so we exit. function checklastpoll() { tail -2 /usr/spool/uucp/.Log/$PROG/$HOST | grep "ERROR" > /dev/null if [ "$?" != "0" ]; then tail -3 /usr/spool/uucp/.Log/$PROG/$HOST | grep "Timed out" > /dev/null if [ "$?" != "0" ]; then exit 0 fi fi } # START HERE! trap downslip EXIT # so we drop SLIP when this script terminates checkslip # bring up SLIP if [ "$didslip" = "Y" -a "$(date +%H)" -lt 5 ]; then # Set our clock from our host (only during our overnight poll) /usr/sbin/netdate ${CLOCKIP:-$HOSTIP} &>/dev/null /sbin/clock -w fi $UUCICO -S $HOST -x 2 checklastpoll # wait, try again downslip sleep 9m checkslip checklastpoll $UUCICO -S $HOST -x 2 checklastpoll ######### For the time being, give up after 2 attempts ######## exit 1 ############################################################### # wait, try again downslip sleep 14m checkslip checklastpoll $UUCICO -S $HOST -x 2 checklastpoll # Admit defeat! exit 1 --------------------------- end cut --------------------------- At the end which is answering the call you need to have the uucico daemon start on an incoming connection on port 540: (1) Make sure you have the following in /etc/services uucp 540/tcp uucpd # uucp daemon (2) Make sure you have the following in /etc/inetd.conf uucp stream tcp nowait uucp /usr/sbin/tcpd /usr/lib/uucp/uucico -l (do "killall -1 inetd" if you have changed it) (3) Put username:password pairs in /var/lib/uucp/taylor_config/passwd freddy:catNmouse (This is correct for the Taylor uucp supplied with Slackware 3.0; it uses cleartext passwords, so make sure you protect the file!) To test it out, do "telnet localhost 540", enter the username and password, and it should come back with "Shere=". Type ^[ close to get out. > I'm a bit intimidated by the prospect of messing with sendmail, having seen > the big Sendmail book. Me too, so I use Smail. The compiled version which comes in the 'contrib' directory of Slackware 3.0 works very nicely. > If this is in a FAQ, I haven't found it and would welcome pointers, > preferably URLs. Check out the UUCP-HOWTO and Mail-HOWTO for other aspects of uucp/mail setup. ---- Brian Candler E-mail: brian@ucb.edu.bz University College of Belize or: brian%ucb.edu.bz@rg.net PO Box 990 Tel: +501 2 32732 Belize City Fax: +501 2 30255 BELIZE, Central America