Mail 'Transport Agents'

# 4 Mail 'Transport Agents'

Contents of this section

This section contains information related to 'transport agents', which means the underlying software that connects your local system to remote systems.

## 4.1 Smail v3.1

Smail3.1 seems to be a de-facto standard transport agent for uucp-only sites and for some smtp sites. It compiles without patching from the sources. In addition, smail is provided in binary form in the SLS distribution of Linux.

The newspak distribution contains config files for smail3.1.28 under Linux that you can use to start with.

If you're building smail from sources, you need to have the following in your os/linux file so that 'sed' gives you shell scripts that work properly.

            CASE_NO_NEWLINES=true

For a uucp-only system that has a MX-record and that wants a domainized header (who goes through a smart-host for everything), these are the entire config files you'll need:

- replace 'subdomain.domain' with your domain name
- replace 'myhostname' with you un-domainized hostname
- replace 'my_uucp_neighbor' with the uucp name of your upstream site

            #-------- /usr/local/lib/smail/config -----------------
            #
            # domains we belong to
            visible_domain=subdomain.domain:uucp
            #
            # who we're known as (fully-qualified-site-name)
            visible_name=myhostname.subdomain.domain
            #
            # who we go through
            smart_path=my_uucp_neighbor
            #
            #---------- /usr/local/lib/smail/paths --------------
            #
            # we're a domainized site, make sure we accept mail to both names
            myhostname        %s
            myhostname.subdomain.domain      %s
            #
            #-------------------------------------------------------------------

To run smail as a smtp daemon, add the following to /etc/inetd.conf:

                    smtp stream tcp nowait  root  /usr/bin/smtpd smtpd

Outgoing mail gets sent automatically, when using elm. If your internet link is down when you send mail, then the mail sits in "`/usr/spool/smail/input`". When the link next comes up, "`runq`" is run which causes the mail to be sent.

## 4.2 Sendmail+IDA

I run a uucp-only site and use sendmail5.67b+IDA1.5 instead of smail3.1.28 due to the incredible ease of use. There is a binary distribution in `sunsite.unc.edu:pub/Linux/system/Mail/delivery`. To install it:

- you'll probably want to remove (or rename) all the files from smail (see the /install/installed directory if you are SLS) to be safe.
- cd to / then "gunzip -c sendmail5.67b+IDA1.5.tpz | tar xvf -" If you have a "modern" tar from a recent Slackware (for example) you can probably just do a "tar -zxvf filename.tgz" and get the same results.
- cd to /usr/local/lib/mail/CF and copy the sample.m4 local.m4 file to "yourhostname.m4". Edit out the distributed hostname, aliases, and smarthost and put in the correct one for your site. The default file is for a uucp-only site who has domainized headers and who talks to a smart host. Then "make yourhostname.cf" and move the resulting file to /etc/sendmail.cf
- if you are uucp-only, you do *NOT* need to create any of the tables mentioned in the README.linux file. You'll just have to touch the files so that the Makefile works. Just edit the .m4 file, make sendmail.cf, and start testing it.
- if you're uucp-only and you talk to sites in addition to your "smart-host", you'll need to add uucpxtable entries for each (or mail to them will also go through the smart host) and run dbm against the revised uucpxtable.
- if you use my sendmail5.67b+IDA1.5 distribution you should not use a "freeze file".
- If you run Rich Braun's original binary distribution of 5.67a, you'll need to freeze the configuration if you change your .cf file with "/usr/lib/sendmail -bz" to make the changes take effect. You should also update your version to at least 5.67b since there is a nasty security hole in 5.67a and earlier.

Another nice thing is that if you have mail.debug set and you run syslogd, your incoming and outgoing mail messages will get logged. See the /etc/syslog.conf file for details.

The sources for sendmail+IDA may be found at vixen.cso.uiuc.edu. They require no patching to run under Linux if you're running something like a kernel of 1.00.

If you're running a current kernel of around 1.1.50, you get the fun of reversing most of the Linux-specific patches that are now in the vanilla sources. It's extremely obvious where this needs to be done. Just type make and when it blows up, go to that line in the sources and comment out the Linux-specific code that's in there.

If you're going to run sendmail+IDA, I strongly recommend you go to the sendmail5.67b+IDA1.5 version since all required Linux-specific patches are now in the vanilla sources and several security holes have been plugged that WERE (!!!) in the older version you may have grabbed or built before about December 1st, 1993.

The May/June 1994 edition of `Linux Journal` has an extensive article on the care and feeding of sendmail+IDA. The new edition of the Linux DOC Project `Networking Administrator's Guide` will have an even more detailed and complete version.

### The sendmail.m4 file

Sendmail+IDA requires you to set up a `sendmail.m4` file rather than editing the `sendmail.cf`file directly. The nice thing about this is that it is simple to set up mail configurations that are extremely difficult (if not totally impossible for most people to set up correctly) in smail or traditional sendmail.

The sendmail.m4 file that corresponds to the above smail example looks like the following:

      dnl #------------------ SAMPLE SENDMAIL.M4 FILE ------------------
      dnl #
      dnl # (the string 'dnl' is the m4 equivalent of commenting out a line)
      dnl #
      dnl # you generally don't want to override LIBDIR from the compiled in paths
      dnl #define(LIBDIR,/usr/local/lib/mail)dnl    # where all support files go
      define(LOCAL_MAILER_DEF, mailers.linux)dnl    # mailer for local delivery
      define(POSTMASTERBOUNCE)dnl                   # postmaster gets bounces
      define(PSEUDODOMAINS, BITNET UUCP)dnl         # don't try DNS on these
      dnl #
      dnl #-------------------------------------------------------------
      dnl #
      dnl # names we're known by
      define(PSEUDONYMS, myhostname.subdomain.domain myhostname.UUCP)
      dnl #
      dnl # our primary name
      define(HOSTNAME, myhostname.subdomain.domain)
      dnl #
      dnl # our uucp name
      define(UUCPNAME, myhostname)dnl
      dnl #
      dnl #-------------------------------------------------------------
      dnl #
      define(UUCPNODES, |uuname|sort|uniq)dnl       # our uucp neighbors
      define(BANGIMPLIESUUCP)dnl                    # make certain that uucp
      define(BANGONLYUUCP)dnl                       #  mail is treated correctly
      define(RELAY_HOST, my_uucp_neighbor)dnl       # our smart relay host
      define(RELAY_MAILER, UUCP-A)dnl               # we reach moria via uucp
      dnl #
      dnl #--------------------------------------------------------------------
      dnl #
      dnl # the various dbm lookup tables
      dnl #
      define(ALIASES, LIBDIR/aliases)dnl            # system aliases
      define(DOMAINTABLE, LIBDIR/domaintable)dnl    # domainize hosts
      define(PATHTABLE, LIBDIR/pathtable)dnl        # paths database
      define(GENERICFROM, LIBDIR/generics)dnl       # generic from addresses
      define(MAILERTABLE, LIBDIR/mailertable)dnl    # mailers per host or domain
      define(UUCPXTABLE, LIBDIR/uucpxtable)dnl      # paths to hosts we feed
      define(UUCPRELAYS, LIBDIR/uucprelays)dnl      # short-circuit paths
      dnl #
      dnl #--------------------------------------------------------------------
      dnl #
      dnl # include the 'real' code that makes it all work
      dnl # (provided with the source code)
      dnl #
      include(Sendmail.mc)dnl                         # REQUIRED ENTRY !!!
      dnl #
      dnl #------------ END OF SAMPLE SENDMAIL.M4 FILE -------

### Defining a local mailer

Unlike most Unix distributions, Linux does not come with a local mail delivery agent by default. I recommend using the commonly available `deliver` program, which is an optional package in a number of the usual Linux distributions. In order to do so, you need to define a `LOCAL_MAILER_DEF` in the `sendmail.m4` file that points to a file that looks like:

      # -- /usr/local/lib/mail/mailers.linux --
      #     (local mailers for use on Linux )
      Mlocal, P=/usr/bin/deliver, F=SlsmFDMP, S=10, R=25/10, A=deliver $u
      Mprog,  P=/bin/sh,       F=lsDFMeuP,   S=10, R=10, A=sh -c $u

There is a also built-in default for `deliver` in the `Sendmail.mc` file that gets included into the `sendmail.cf` file. To specify it, you would not use the `mailers.linux` file but would instead define the following in your sendmail.m4 file:

       dnl --- (in sendmail.m4) ---
       define(LOCAL_MAILER_DEF, DELIVER)dnl       # mailer for local delivery

Unfortunately, Sendmail.mc assumes deliver is installed in /bin, which is not the case with Slackware1.1.1 (which installs it in /usr/bin). In that case you'd need to either fake it with a link or rebuild deliver from sources so that it resides in /bin.

### The Sendmail+IDA dbm Tables

Setting up special behavior for sites or domains is done through a number of optional `dbm` tables rather than editing the `sendmail.cf` file directly. Refer to the July-1994 issue of `Linux Journal`, to the docs in the sources, or to the sendmail chapter in the newest version of the Linux DOC Project `Networking Administration Guide` which will be available real-soon-now for more details.

- mailertable - defines special behavior for remote hosts or domains.
- uucpxtable - forces UUCP delivery of mail to hosts that are in DNS format.
- pathtable - defines UUCP bang-paths to remote hosts or domains.
- uucprelays - short-circuits the pathalias path to well-known remote hosts.
- genericfrom - converts internal addresses into generic ones visible to the outside world.
- xaliases - converts generic addresses to/from valid internal ones.
- decnetxtable - converts RFC-822 addresses to DECnet-style addresses.

### So Which Entries are Really Required?

When not using any of the optional dbm tables, sendmail+IDA delivers mail via the `DEFAULT_MAILER` (and possibly `RELAY_HOST` and `RELAY_MAILER)` defined in the sendmail.m4 file used to generate sendmail.cf. It is easily possible to override this behavior through entries in the domaintable or uucpxtable.

A generic site that is on Internet and speaks Domain Name Service, or one that is UUCP-only and forwards all mail via UUCP through a smart `RELAY_HOST`, probably does not need any specific table entries at all.

Virtually all systems should set the `DEFAULT_HOST` and `PSEUDONYMS` macros, which define the canonical site name and aliases it is known by, and `DEFAULT_MAILER`. If all you have is a relay host and relay mailer, you don't need to set these defaults since it works automagically.

UUCP hosts will probably also need to set `UUCPNAME` to their official UUCP name. They will also probably set `RELAY_MAILER`, and `RELAY_HOST` which enable smart-host routing through a mail relay. The mail transport to be used is defined in `RELAY_MAILER` and should usually be UUCP-A for UUCP sites.

If your site is SMTP-only and talks `Domain Name Service', you would change the `DEFAULT_MAILER` to TCP-A and probably delete the `RELAY_MAILER` and `RELAY_HOST` lines.

If you're a SLIP site, you might want to take the easy way out and just forward all outgoing mail to your service provider to do the right thing with. To do so, you'd want to define ISOLATED_DOMAINS and VALIDATION_DOMAINS to be your domain, you'd also want to define RELAY_HOST to be your service provider and RELAY_MAILER to be TCP. Of course, you want to ask permission before you set any system up as your general purpose relay.

## 4.3 Sendmail 8.6

Sendmail 8.6.x from Berkeley is the latest major revision after sendmail5. It has wonderful built-in support for building under Linux. Just "make linux" and you'll be all set.

## 4.4 Other "transport agents"

The following also are known to run under Linux. Consult "archie" for details regarding how to find them...

- smail2.5 - very simple UUCP-based smail

## 4.5 Local Delivery Agents

Unlike most operating systems, Linux does not have mail "built-in". You'll need a program to deliver the local mail. One good program is Rich Braun's "lmail" program, but I've switched to using the more commonly available "deliver" program.

Documentation for how to use either for local delivery is in the sendmail5.67b+IDA1.5 binary release (on sunsite) mentioned above.

Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter