Previous Next Contents

4. Mail 'Transport Agents'

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:

        #-------- /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 ppp and uucp site and generally 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:

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 or later, 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.

Sometime after things settle down, I'll send the 'unpatches' to the sendmail+IDA authors and ask'em to remove the now unnecessary patches.

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 has 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.cffile 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.

So Which Entries are Really Required?

When not using any of the optional dbm tables, sendmail+IDA delivers mail via the 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. 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 RELAY_MAILER.

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.7

Sendmail 8.7.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. You'll probably be best served by grabbing one of the various binary distributions off of the usual Linux archive sites rather than fighting things like Berkeley dbm yourself.

There's a nice distribution of sendmail 8.6.12 from Jason Haar - j.haar@lazerjem.demon.co.uk on sunsite.unc.edu in /pub/Linux/system/Mail/delivery/sendmail-8.6.12-bin.tgz that has the source documentation and a very nice quickie description of how to run sendmail v8 for common configurations.

Bottom line with sendmail v8 is that you want to configure the bare minimum necessary to get the job done. The following is an example that should get you close at least.

A Sample 8.7.x mc file

Much like sendmail+IDA, sendmail v8 uses m4 to process a config file into a full sendmail.cf that sendmail uses. The following is my current mc file for my site (ppp to Internet for outgoing mail, uucp for incoming mail).

        dnl divert(-1)
        #---------------------------------------------------------------------
        #
        # this is the .mc file for a linux host that's set up as follows:
        #
        #       - connected to Internet for outbound mail (ppp here)
        #       - connected via UUCP for incoming mail
        #       - domainized headers
        #       - no local mailer (use 'deliver' instead)
        #       - no DNS running so don't canonicalize outgoing via DNS
        #       - all non-local outbound mail goes to the RELAY_HOST over smtp 
        #           (we run ppp and let our service provider do the work)
        #
        #                                       vds 3/31/95
        #
        #---------------------------------------------------------------------
        include(`../m4/cf.m4')
        VERSIONID(`linux nodns relays to slip service provider smarthost')dnl
        Cwmyhostname.myprimary.domain myhostname.UUCP localhost
        OSTYPE(linux)
        FEATURE(nodns)dnl
        FEATURE(always_add_domain)dnl
        FEATURE(redirect)
        FEATURE(nocanonify)
        dnl MAILER(local)dnl
        MAILER(smtp)dnl
        MAILER(uucp)dnl
        define(`RELAY_HOST', smtp:my.relay.host.domain)
        define(`SMART_HOST', smtp:my.relay.host.domain)
        define(`UUCP_RELAY', smtp:my.relay.host.domain)
        define(`LOCAL_MAILER_PATH', `/bin/deliver')
        define(`LOCAL_MAILER_ARGS', `deliver $u')

Sendmail v8 tidbits

There are a few differences I suppose to the 'IDA bigots' among us. So far, I've found the following.

4.4 Other "transport agents"

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

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.


Previous Next Contents