For big sites, sendmail is worth choosing, due to the "incredible ease of use", (very relative feeling when you know qmail) but you must decide which you want between sendmail+IDA and sendmail 8.x :
Remember, linux newbies or people concerned by security / ease of configuration should rather try using smail or qmail, which are easier to use and safer.
If your distribution doesn't provide you with a ready-to-install sendmail package (.rpm for RedHat, Caldera and Suse, .deb for Debian) just download the sources and run :
Edit out the distributed hostname, aliases, 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
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.
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 can 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 kernel > 1.1.50, you get the fun of reversing most of the Linux-specific patches that are now in the vanilla sources. (I *did* told you this sendmail was only for old kernels :-)
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.
Now linux kernel is 2.0, you should use sendmail 8.x insted of sendmail+IDA, but I told you'd better choose sendmail 8.x :-)
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 -------
Unlike most Unix distributions, Linux does not come with a local
mail delivery agent by default. Now, deliver or procmail is
generally installed, so no complexity will be added to this
already very complex setup. I recommend using the commonly
available deliver
or procmail
programs, which
can be optional packages in a some 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. Please note procmail is generally better than deliver, for example for mail filtering.
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
(if you can still find
it :-), 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.
When not using any of the optional dbm tables, sendmail 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.
Sendmail 8.7.x from Berkeley was the latest major revision after sendmail5. It had wonderful built-in support for building under Linux : just "make linux" and all was 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 at 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.
The 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.
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')
There are a few differences I suppose to the 'IDA bigots' among us. So far, I've found the following:
Instead of 'runq', you type 'sendmail -q' to run the queue !
Unlike most operating systems, Linux did not have mail "built-in" : you needed a program to deliver the local mail, like "lmail", "procmail" or "deliver".
However, every recent distribution includes a local mailer now !
Documentation for how to use either for local delivery is in the sendmail5.67b+IDA1.5 binary release (on sunsite) mentioned above.