UUCP

[ home --> uucp --> maintenance --> links ]

Introduction

Why would you want to use UUCP? What can you do with UUCP?

Well, first of all UUCP saves money. I read loads of mail and news, and being online is quite expensive (our PTT is way too happy with me as it is).

UUCP exchanges news articles in compressed form ('batches'), and these batches are prepared while I'm offline. This saves a lot of time, normally spent online.

Second, UUCP is a very convenient way to automate my news and email supply. I have full control over my email and news. This is the good part. The downside is, of course, that you need to invest some time in the configuration and maintenance of your UUCP link.

This document should describe the entire process of configuring your machine for UUCP under Linux. I use Slackware Linux, v2.0.29 with Taylor UUCP (v1.06.1). This is the standard UUCP as distributed with my Slackware setup (off the Infomagic LDR, dec. 1996)

I have completed the configuration of UUCP in several steps:

  1. Basic system configuration for UUCP
  2. Sendmail configuration for UUCP
  3. UUCP configuration
  4. CNews configuration for UUCP

Basic system configuration

You will need to pick a suitable hostname for your machine. Your email address will be in the form of username@hostname.iaehv.nl. You cannot use an existing hostname on IAEhv.

Limit your hostname to 7 characters or less (I'll use 'myhost' as an example hostname). Your machine will identify itself to IAEhv as 'Umyhost'. This is the special UUCP accountname that you need to get from IAEhv (account@iaehv.nl will gladly help you set up a UUCP account).

Once you have decided on a hostname (and applied for the UUCP account), you will need to modify (or create) the following system configuration files:

/etc/HOSTNAME (*)
This file should contain your full hostname (e.g. myhost.iaehv.nl). Make sure that the name of the machine does not exceed 7 characters.
/etc/aliases
Make sure that you have a 'news', 'postmaster' and 'uucp' entry here (you may redirect all their email to 'root')
/etc/hosts
You may want to create an entry for your host (e.g. under 127.0.0.1)
(*) On my system, the following files contain hostname entries:

Other interesting configuration files are:

/etc/inittab
Check whether there is an mgetty process running on your modem port (e.g. ttyS1)
/etc/passwd
Check if there is an entry like "uucp:*:10:14:uucp:/var/spool/uucppublic:"
You may also want to read my assorted notes about UUCP-related files.

Advanced configuration information

If you're up to it, you can implement UUCP grades. IAEhv uses 'N' for mail and 'd' for news.

Sendmail configuration

Sendmail normally assumes a direct link to the Internet. Use of UUCP requires some tweaking of the sendmail configuration in /etc/sendmail.cf.

Warning: sendmail.cf hacking can be dangerous to your mental health ;)

Fortunately, 'm4' comes to the rescue. I use the m4 macro processor to generate a suitable /etc/sendmail.cf from the following definitions (note the 'iaehv' smarthost entry):

include(/usr/src/sendmail/cf/m4/cf.m4)
VERSIONID(setup for linux with uucp)dnl
OSTYPE(linux)
FEATURE(nodns)dnl
FEATURE(always_add_domain)dnl
FEATURE(nocanonify)
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(uucp)
define(SMART_HOST, uucp-dom:iaehv)
The "nocanonify" feature is absolutely necessary: sendmail should not try to resolve email addresses using DNS. If you leave out this feature, sendmail will happily try to resolve addresses every couple of minutes (bringing up your auto-dialing PPP link), resulting in unpleasantly huge bills from your phone company ;)

The command:

m4 sendmail.mc > sendmail.cf

will now produce your sendmail configuration file.

Over time, I have made a couple of small modifications to the generated /etc/sendmail.cf: Around line 159, I activated the maximum message size check:

O MaxMessageSize=1000000
Around line 204, I disabled MIME-type error messages:
O SendMimeErrors=False
Finally, I changed the loglevel around line 225:
O LogLevel=8

UUCP configuration

Now that your basic system configuration is in order, it is time to move on to the actual UUCP configuration.

Taylor UUCP allows two types of configuration: the Taylor-configuration and the "HoneyDanBer" (or 'HDB') configuration.

The UUCP "HoneyDanBer" configuration files

I have chosen HDB configuration. The relevant files are in /usr/lib/uucp/hdb_config.
Devices
This file defines the dialout devices that should be used
Dialers
This file configures the selected dialout device (modem init-strings)
Permissions
This file defines the programs that other machines may execute over our UUCP link
Systems
This file defines when and how we should call other machines (IAEhv)
As the files are quite small, I will list their contents here:

Devices

# Automatic Call Unit, /dev/ttyS1, 38400 baud, hayes dialer. Ed
ACU ttyS1 - 38400 hayes
This defines a modem (or ACU) on /dev/ttyS1. The type of ACU is 'hayes' (the name itself does not imply anything).

Dialers

# EDVK 960420 Changed AT into reset, AT&F1 for USR Sportster.
# Probably the modem is still in fax-mode (mgetty receives faxes)
# EDVK 960420 Removed \E echo check
hayes	=,-,	"" \dAT&F1\r\c OK\r ATDT\T\r\c CONNECT
This defines the behaviour of a 'hayes' modem. The stuff you see in that file is actually some form of chat-script.

Permissions

MACHINE=iaehv \
   MYNAME=myhost \
   COMMANDS=rmail:rnews:uucp:uux
This allows 'iaehv' to execute rmail, rnews, uucp and uux on 'myhost'.

Make sure to replace 'myhost' by your chosen hostname!

Systems

iaehv Any;1 ACU 38400 0402439436 "" \r\c ogin:--ogin: Umyhost word: mypassword
This allows 'myhost' to call 'iaehv' anytime on the specified phone number. The rest of the line is, again, a chat-script.

Make sure to replace 'myhost' and 'mypassword' with your UUCP hostname and password!

Testing the UUCP link

Write an email to your regular account on IAEhv. This email should be processed by sendmail, and queued for transmission to the smarthost ('iaehv').

The UUCP mail queue can be viewed using

uustat -a

Now, try to send the email (do this as user 'uucp'):

/usr/lib/uucp/uucico -r1 -siaehv

Your modem should start dialing (uucico is the UUCP program that talks to the modem). Check the logfiles in /var/spool/uucp/.Log/uucico/ for details.

Running UUCP from cron

If everything seems to run reliably, UUCP can be run from cron. Maintenance scripts etc. could also be executed from a crontab entry.
# Check UUCP requests every 15 minutes
0,15,30,45 * * * * /usr/lib/uucp/uusched

# Poll every morning at 07:15
15 07 * * * /usr/lib/uucp/uucico -r1 -siaehv

Be warned that the above configuration will dial out every 15 minutes if mail or news are waiting! I usually run uusched only a couple of times a day, for example late at night.

CNews configuration

Finally, the news system should be configured for use with UUCP.

Due to the excessive amount of spam/UCE that I receive, I unfortunately have to recommend using a fake email address in your news software. CNews, if properly instructed, will do this for you (hint: take a look at /var/lib/news/mailname).

You might have to download C-News from ftp://ftp.cs.toronto.edu/pub/c-news/ if it was not included with your distribution.

top$Id: index.m4,v 1.2 1999/04/26 12:24:02 ed Exp $

Sending unsolicited (commercial) email
to any address on these pages strictly prohibited!

Caught in a frame? Go to http://www.iaehv.nl/users/evoncken/index.html
Questions? Remarks? Contact Ed Voncken evoncken@iaehv.nl