	Installing the IDA sendmail on your platform.

Finding the combination of conf.h and Makefile parameters that will create
a working sendmail executable can be a troublesome task.  I've attempted
to include here some things I've learned, sometimes from others but usually
through trial and error, that may make the task easier.

 ======================================================================
>>Save your existing sendmail executable and current sendmail.cf file!<<
 ======================================================================
This shouldn't have to be said, then again I know folks that never do backups
either.

This would be a wizard time to print the doc/07.sendmailop/op.me document.
The file has been brought considerably up to date in the 5.65c release.

Edit src/conf.h to set parameters particular to your machine.

Select the include file from the src/config directory that matches your
oeprating system name.  The file src/config/proto.h can be used as a base
for creating new configurations.

DBM	Almost always defined.  Without it none of the hashed dbm
	files such as mailertable or domaintable can be used and the
	alias file will be searched linearly.

Define only 1 of the various {N,G,S,M,H}DBM libraries.  If none are defined,
only the alias file can be accessed in dbm form as vanilla dbm can handle
only one database at a time.  All require DBM to be defined as well.
GDBM, SDBM, and HDBM are call-compatible with NDBM.

NDBM	The classic multi-database version of dbm supplied with BSD.
GDBM	GNU DBM library.
SDBM	Ozan Yigit's sdbm library.
MDBM	UMaryland's ndbm variant.
HDBM	The new Berkeley hashing package.

	Source for both sdbm (sdbm.tar.Z) and the Berkeley hashing package
	(hash.tar.Z) are available on uxc.cso.uiuc.edu in /pub and on
	nexus.yorku.ca in pub/oz .  In the case of HDBM, libhash.a should
	be built with the ndbm.o module included as well.

YP	Enable Yellow Plague code for accessing YP maps (mail.aliases, etc).
	Builds hashed aliases file with required YP flags. Note: SUN
	now calls this capability the Network Information Service (NIS)
	because the name Yellow Pages is a registered trademark in the
	United Kingdom of British Telecommunications and may not be
	used without permission of humorless lawyer-types.
FUZZY	Enable fuzzy matching of local user names.  This uses information from
	the GECOS field in /etc/passwd if the address does not match any
	user-id.  Example: mail is sent to Margaret Greenbriar addressed as
	margaret.  No userid margaret exists.  Her /etc/passwd entry is
	greenb:*:107:10:Margaret Greenbriar:/misc/greenb:/bin/ksh
	If FUZZY is enabled, then the Margaret in the GECOS field will cause
	userid greenb to be selected.  This feature is disabled by default.
LOG	Enable logging.
SMTP	Enable user and server SMTP.
QUEUE	Enable queueing.
QUEUE_MACVALUE	Save the $r and $s macros in queue file.
UGLYUUCP	Output ugly UUCP From lines.
DAEMON	Include the daemon (requires IPC & SMTP).
MAIL11V3	Set if this host will act as a DECnet mail gateway.  This
	enables code for two non-standard SMTP extensions, HEAD and MULT.
	See the source and RCS logs for details.
SETPROCTITLE	Munge argv to display current status.  Sometimes has evil
	side-effects.
NAMED_BIND	Require the Berkeley Internet Domain Server.
BIT8	Support character set translation and 8bit mailers.  See the
	ida/charset directory for further info.  Disabled by default.
TTYNAME	Set macro $y to basename of tty device.  Disabled by default.
NOTUNIX	Define if msgs lack a UNIX "From " line.  Disabled by default.

The next three determine the location of several control files.  The new
convention is to store the sendmail.cf file in /etc though many systems
still use /usr/lib.

# define	_PATH_SENDMAILCF	"/etc/sendmail.cf"

The next define is optional.  Leaving it commented out omits the freeze()
and thaw() routines that manipulate the frozen configuration file.  Sendmail
performance is greatly enhanced when using sendmail.fc however there are some
problems.  1) Changes to sendmail.cf are ignored until sendmail.fc is re-built.
This has tripped up many a hacker.  2) On small systems sendmail isn't invoked
often enough to justify the added disk space.  3) It doesn't work on all 
systems w.o. lots of work.  If some sendmail operation isn't working, try
removing the sendmail.fc file and trying again.  If that cures it, rebuild
sendmail w.o. _PATH_SENDMAILFC.  Better yet, fix the problem and send me the
patches.  If you still get mysterious failures, rebuild w.o. SETPROCTITLE.

# define	_PATH_SENDMAILFC	"/etc/sendmail.fc"

Also optional is support for the daemon to write its pid to a file.  This is
handy for scripts that re-start, stat, or kill sendmail.  It has low overhead.

# define	_PATH_SENDMAILPID   	"/etc/sendmail.pid"


Next edit src/Makefile and note the instructions there.  This consists of
adding missing files to the SRCS/OBJS lines, setting DEFS and CFLAGS.
If the BIND routines are not in /lib/libc.a and NAMED_BIND is set, change
the all: target to dsendmail.

This release tickles a bug on SUNs with 16 Mbytes or more running 4.1 SUNOS.
If your SUN starts crashes with a data fault, get patch
 Patch-ID# 100092-03
 Keywords: 4/60, performance, memory, pmeg, kernel, vm
 Synopsis: poor VM performance with  physical memory greater than 16Mb.
 Date: 27/July/90
 SunOS release: 4.1

Because sendmail is started early on in the boot process, shared libraries
may not be ready when sendmail starts.  On SUNs, compile with -Bstatic
in CFLAGS.

See the file sendmail/uk for some Apollo 10.1 related changes. 

If you are using an ANSI C compiler that defines __STDC__, verify that
/usr/include/stdlib.h and /usr/include/unistd.h exist.  If not, create
empty versions of those files in the src directory ("touch src/unistd.h",
for example).  If stdarg.h is missing, copy it to the src directory from
../support.

Now do a make.  If any routines come up missing, copy them over from the
support directory and add them to Makefile.  Iterate until the make is
successful.  At this point kill the running sendmail daemon and copy
the executable to /usr/lib.  Verify that the permissions stay the same
(setuid root is the rule).  Let the users know that outbound mail may
not succeed until the installation is complete.

The dbm executable is required for manipulating the IDA databases.  First
edit the sendmail/ida/Makefile to reflect which database library to use and
where ancillary mail files will be installed.  The two most common choices
for the latter are /usr/lib/mail (SUN users may want to consider using
/var/lib/mail) and /usr/local/lib/mail.
	cd sendmail/ida; vi Makefile; make
This edits the Makefiles in the sub-directories.

Follow this with 
	cd aux; make dbm; cp dbm /usr/lib/mail	(or wherever)

Next on the list is building the IDA sendmail.cf file.  cd to ida/cf and
read README and the files mentioned in it.  A large number of actual uiuc
m4 files are included.  I would start with a minimalist file such as uiuc-1.m4.
If your DNS does not provide local wildcard MX records for such pseudo-domains
as .bitnet, etc, add their names to the PSEUDODOMAIN define.  The mailertable
file can handle them as well.

Now build your cf file.  If your m4 file is named hourglass.m4, use the command
"make hourglass.cf".  Copy it to _PATH_SENDMAILCF (you did save your old copy?).
Now is the time to correct any differences between the old and new sendmail.cf
files in regard to the prog and local mailers (re-read ida/cf/README).

If NAMED_BIND is set, and if you are not running a nameserver on your machine, 
verify that /etc/resolv.conf (/usr/etc/resolv.conf on Silicon Graphics
machines) is set up with the name of your domain and the IP address of the
local DNS server.

If _PATH_SENDMAILFC is defined, issue the command, "/usr/lib/sendmail -bz".

Create the hashed dbm files for aliases with "/usr/lib/sendmail -bi".  This
is equivalent to the "newaliases" command.  If sendmail complains about
either the local or prog mailer being undefined, re-compile sendmail w.o.
_PATH_SENDMAILFC.  Better yet, figure out why and send me the patches.

SUN systems omit the mailq command for some twisted reason.  Create it by
making a symlink as follows "ln -s /usr/lib/sendmail /usr/ucb/mailq".

Apollo systems will usually do one of two things when delivering local
mail: /bin/mail will segmentation fault, or it will complain that it can't
find group mail.  I've not been able to determine why for either and punt
by compiling/installing mail from the sendmail/binmail directory.

Verify that sendmail can calculate the load average with "sendmail -d3.1 -bp".
The -d3.1 prints the load average, -bp prints the spool queue.

Run sendmail in test mode with "sendmail -bt".  Each address should have
a "3,0 " prepended to it unless specific rulesets are being tested.  E.g.,
> 3,0 user@hourglass.cso.uiuc.edu .

You should verify that all expected variants of your hostname resolve to
the local mailer.  This includes user@host, host!user, user@host.domain.

Test that sendmail can actually hand-off mail to your local mailer.  The
Berkeley mail program has the very useful -v option ala "Mail -v user".
If this is not available, feed the following to "sendmail -v -t < file"
where file is

To: user
Subject: Hi

test text

Repeat to verify that sendmail can talk to another machine via SMTP by
replacing "user" in the example previous with "user@anotherhost.yourdomain".
The addresses used in the Mail from and Rcpt to lines of the SMTP dialogue
should be fully qualified.

If there's any messages pending in the spool queue, try running the queue
manually: "/usr/lib/sendmail -q -v"

Assuming all has gone well to this point, fire up sendmail in daemon mode:
"/usr/lib/sendmail -bd -q1h".  (Better still, "grep sendmail /etc/rc*" will
give you the exact form of the command used during system startup).  Verify
that it's running both with ps and by telnet'ing to the SMTP port:
"telnet localhost 25".  (You can exit from this either with the QUIT command,
by escaping back to 'telnet' usually with ^], or with ^C if the connection
fails completely).  It should respond with a connected message and the
greeting banner should have your fully quailified domain name in the second
field.  If it doesn't, reread the docs in ida/cf about DEFAULTHOST,
DEFAULTDOMAIN, etc.

Test inbound mail from another machine.
