-->
by Tim Parker
IN THIS CHAPTER
If you have access to other machines through a local area network or through the Internet, you will probably want to install the mail and news software. Both offer a lot of interaction with other users and add a whole new dimension to your Linux system.
To handle electronic mail, most systems rely on UUCP (UNIX-to-UNIX Copy). Setting up UUCP is covered in many different online guides and documents, as well as in most UNIX books and this book. You can exchange e-mail with other users, or with the world at large, by connecting to an Internet service provider such as UUNET Technologies.
Reading Usenet newsgroups is a little more complicated, because you have to download the news yourself (100MB per day!) or connect to a site that offers news--a news server. Linux includes the software to connect you, although most users will find it easier to use an online service such as CompuServe or Delphi for news access.
In this chapter we look at the following:
If you installed Linux from a CD-ROM (such as the Slackware distribution included with this book), one of the installation options was to install the e-mail systems. Some Linux distributions give you a choice of mail packages, whereas others default to one particular type.
During the installation, most Linux setup procedures will install the software properly except for some configuration information about the network. With this kind of installation, there is little you have to do with the mail system except add your host name and configure UUCP (if you are using it to connect to other systems to transfer Mail).
If you didn't get Mail with your Linux system, you will have to pick up one of the archive libraries from an FTP site, or from a user group or CD-ROM utility disk. In this case, installation procedures are included as part of the archive.
Mail software for most UNIX systems (including Linux) has two components: a transport and a mailer. The transport is the low-level software that takes care of delivering the mail, both locally and across other machines. Users never work with the transport, although system administrators must configure it and understand the basic principles. The mailer is the user interface that presents mail to the user and accepts new mail. Many mailers are available.
Transport agents are the underlying software that connects your local machine to remote systems. Several transport agents are available with Linux, but the most commonly used are called smail (for send mail) and sendmail. You can find both on the CD that accompanies this book. The program you use probably will be determined by the Linux software supplied to you.
The smail and sendmail programs are ideally suited for sites that rely on UUCP for mail (either between other machines or to an Internet service provider), and they can be used with some SMTP (Simple Mail Transfer Protocol) sites. smail and sendmail are usually provided as an executable binary form with most Linux distributions, although only one of the transport agents is usually supplied.
The configuration changes needed to set up smail or sendmail on your Linux system depend on the type of connection you have to the outside world.
If you are running a UUCP-based mail system and you use a remote system for all processing to other sites (usually used with local area networks that employ a communications server), the changes to your system configuration files are minimal.
The changes occur in the files /usr/local/lib/smail/config and /usr/local/lib/smail/paths. Look for the lines that have to do with hostname and subdomain names and perform the following changes:
For example, the following extract shows the settings for a machine called vader that attached to the machine deathstar in the domain starwars.com, first for the file /usr/local/lib/smail/config:
#/usr/local/lib/smail/config # domains we belong to visible_domain=deathstar.starwars:uucp # who we're known as (fully-qualified-site-name) visible_name=vader.starwars # who we go through smart_path=deathstar
The changes for /usr/local/lib/smail/paths are the machine name only:
#/usr/local/lib/smail/paths # we're a domainized site, make sure we accept mail to both names vader %s vader.starwars.com %s
If you want to run the smail program as an SMTP daemon, you must add the following line to the file /etc/inetd.conf (or whatever the equivalent file is called in your distribution):
smtp stream tcp nowait root /usr/bin/smtpd smtpd
When this is added, any outgoing mail gets sent automatically when using a mailer like elm.
The sendmail program is quite popular with small Linux installations. It is included with the Slackware distribution of Linux.
If you are running a UUCP-only site and you want to use sendmail instead of smail when you have both on your system, you should make sure that all files from smail are removed to prevent conflicts (you can use whereis and find to locate smail files).
To configure sendmail, change to the /etc directory and edit the sendmail.cf file. This file has enough information to help you determine which lines to replace with your system values. Usually you will edit the hostname, aliases, and smarthost settings.
Unlike most UNIX versions, Linux does not have a mail-delivery package built in. Mail- delivery packages send the received mail to the proper user. One of the most widely used is called deliver.
In most cases, you don't have to do anything to install and configure deliver. When you installed the mail software using the Linux installation routine, the necessary software was installed and configured properly.
Mail user agents are the mailreaders you use to see your e-mail. Many newsreaders are available. Your choice of mailreader is more a personal preference than a feature-based decision.
Elm is probably the most widely used mailreader with Linux. It uses the configuration file /usr/lib/elm.rc to provide basic information about the machine name and its connections. You should edit the elm.rc file to replace the names with proper values.
Another popular mailreader is Mailx, which has been available for UNIX systems for many years. Versions of Mailx are available for Linux on many archive sites. Make sure you get version 5.3b or higher because there are security problems in version 5.3a.
Other interesting and popular mailreaders are Pine and Metamail, both of which are freely available from Linux archive sites and user groups.
Usenet is a service provided over the Internet. It's composed of more than 9,000 newsgroups on every subject imaginable. If you want to set your system to download the entire day's news, you must dedicate a lot of money to hardware and telephone lines. Such a connection is beyond the scope of most users.
However, accessing newsgroups from another machine that downloads them is quite easy, using software provided with Linux.
There are two parts to the News software: the server and the client. The server is the software that controls the newsgroups and handles delivering articles to other machines. The client or newsreader software is the user interface.
You do not have to hook up to the Internet to use News. You can run News locally (on your own machine for all the users) or across a small network. In this case, you don't have to worry about connecting to the Internet's Usenet newsfeed, which generally is expensive and very time- consuming.
News transport software, as its name implies, carries the news to your system and its newsreaders and helps your users post news to Usenet. Two main news transport software packages are used with Linux: Cnews and INN. The two should not be mixed. Use one or the other, or major hassles will result!
If you plan to use News locally only, much of the configuration required for connecting to the Internet or other newsfeed can be ignored. News normally is stored in the directory /usr/spool/news, so all the news transport and client software should be set to point to this location.
The most popular news transport software is Cnews, which has been available for almost a decade. Cnews runs on many different machines, and many people understand it very well, providing technical resources should you need them. Cnews is designed primarily for capturing news over a UUCP connection and a standard telephone modem, so it requires additional software to provide access to the Internet. This additional software is called NNTP (Network News Transfer Protocol). NNTP isn't necessary for local news support.
Installing Cnews is straightforward, as long as you follow the directions in the accompanying documentation files. Configuration involves editing several files, which usually reside in /usr/ lib/news. The files of primary interest are listed here:
Most of Cnews is configured with shell scripts or utility programs (such as addgroup to change the active file and addfeed to change newsfeed information). Again, check the documentation for complete information.
To download news automatically, cron makes an excellent choice. A sample cron entry for the Cnews newsfeed is
20 * * * * /usenet/sw/news/bin/input/newsrun 0 * * * * /usenet/sw/news/bin/batch/sendbatches feedsite 59 0 * * * /usenet/sw/news/bin/expire/doexpire 10 5 * * * /usenet/sw/news/bin/newsdaily 00 5 * * * /usenet/sw/new/bin/newswatch
This sample does things every hour, which is fine for a large site but considerable overkill for a small network or single machine to which you might want to connect only once a day. Modify the files as necessary to meet your requirement.
INN is newer than Cnews but is faster and has NNTP built in, making it easier to use for direct newsfeeds. Unfortunately, it is a little harder to install and configure than Cnews. INN uses a daemon (sometimes two) that runs continually, whereas Cnews is invoked by the user (or cron). Novices to Linux should probably stick with Cnews at the beginning until they gain more experience.
Installation is a little more complex than with Cnews, but following the documentation helps. INN is very particular about its file permissions, so make sure you set them properly. Configuration is a matter of making sure all of the site information is correct. Once correctly installed and configured, though, INN requires virtually no maintenance.
Many newsreaders are available for Linux. A newsreader presents the messages in a newsgroup and lets you step through them or reply to them, as well as create new messages. Some of the most popular newsreaders are tin, trn, and nn.
Choosing a newsreader is essentially a personal choice. Experiment with several and stay with the one you find easiest to work with and that offers the features you need. They all have some slight twist that gives you different methods of looking at news or moving through newsgroups.
Both e-mail and news extend the Linux system into a full-featured UNIX implementation, and make your machine part of a much larger network. Even if you are using your Linux machine only for yourself and have no interest in connecting to the outside world, e-mail is simple and easy to install, configure, and use. Once you've used e-mail, you'll probably never go back to the paper-based kind!
If you have several users on your Linux system or plan to connect to a network, News is a great way to get discussions and information flowing among the users. On top of that, News is just plain fun!