	Compiling Zmailer 2.90 on Solaris 2.3 (SPARC)

According to porting experiences by  Matti Aarnio <mea@nic.funet.fi>
on 26-Jun-94


"Go to the BSD universe"

	Install GNU CC (2.5.6 works) according to the usual instructions,
	and insert a fix into:
		/opt/gnu/lib/gcc-lib/sparc-sun-solaris2/2.5.6/specs
	into its standard predefines:
		*predefines:
		-Dsun -Dsparc -Dunix -D__svr4__ -Asystem(unix) -Asystem(svr4) -Acpu(sparc) -Amachine(sparc) -D__GCC_NEW_VARARGS__ -D__STDC__=0

	The Solaris headers test for __STDC__ existing with value 0,
	not the more common 1..

	(Nota Bene: GCC 2.6.0 has corrected this finally.  It is __STRICT_ANSI__
		    vs. relaxed __STDC__ ...)

	Set your PATH to be:

		PATH=/usr/ccs/bin:/usr/ucb:/opt/gnu/bin:(+ whatever you like)

	thus getting GNU CC, Sun-supplied  make,  and UCB install.
	Makes life a lot easier.  BE CAREFULL NOT TO USE GNU-Binutils
	AR, WHICH ISN'T COMPATIBLE WITH SYSTEM AR!


On Solaris 2.3  the BSD-source-compability library seems to have
problems with its   readdir()  so that it looses first two characters
from the file names :-(  DO NOT USE COMPABILITY MODE, THERE IS NO
NEED!  (Actually it seems to be because of wrong #include -- BSD-compat
mode must not try to use <dirent.h>, rather  <sys/dir.h> ... )


To let you to compile this without being super-user ALL the time,
do following:    ("/usr/local/mail" is from example config..)

	$ su
	# mkdir /usr/local/mail
	# touch /usr/local/mail/zmailer.conf
	# chown YOURID /usr/local/mail/zmailer.conf
	# ln -s /usr/local/mail/zmailer.conf /etc
	# ln -s /usr/local/mail/bin/zmailer /etc
	# exit
	$

thus you can re-edit Config parameters -- change compiler, and other
such trivia -- and compile without running as super-user..

You can compile it all with command:

	$ make it all
	$ su
	# make install

The "make install" needs super-user powers, and will create all the
directories, and store most of the configurations BUT NOT ALL!
You need to manually install files   $MAILSHARE/router.cf,
$MAILSHARE/scheduler.conf, $MAILSHARE/sm.conf, and $MAILSHARE/smtpserver.conf.
See samples at   proto/utu.*


For generating fullname database, a sample utility to do it from
system /etc/passwd  GECOS data is provided as
	proto/fullnamealiasmaker.perl


To do a re-install of BINARIES only (not touching on configs), do:

	# make install-bin


Good luck!
	22-Mar-94	Matti Aarnio	<mea@utu.fi> <mea@nic.funet.fi>


	---------------- Config  for Solaris 2.3 ----------------

# Edit this file to reflect information specific to your installation.

# ZCONFIG is the pathname of the configuration file specifying all the other
# host-dependent information needed by ZMailer programs.  This file is
# created from the Config file in the distribution (the file you are reading
# right now), and contains variable assignments in an sh-compatible format.
ZCONFIG=	/etc/zmailer.conf

# HOSTENV selects one of the files in the hostenv directory, perhaps one
# you have just created, that describes the system you are trying to compile
# this software on.  The contents of that file will be processed to produce
# include/libsupport.h and some sed commands in Config.sed to munge makefiles
# appropriately.  Valid values for HOSTENV is any unqualified filename in
# the hostenv directory (SunOS4.0, BSD4.3, IRIX3.3, Ultrix3.1, SystemVr3.2,...).
HOSTENV=	SunOS5.2

# DEFS is where you put global preprocessor definitions that aren't handled
# by the HOSTENV based configuration procedure.  Hopefully this will be empty,
# but some sample uses are:
#
#	-Du_int=uint -Du_char=unchar -Du_long=ulong
#
# for a system that doesn't define u_int u_char u_long etc in <sys/types.h>,
# or	-DMAXPATHLEN=1024	for a system that doesn't define this in
# <sys/param.h>.
DEFS=

# MAILBOXDEFS has defines related to 'mailbox' and 'lock':
# -DBIFF - tell biff about mail
# -DRBIFF - tell remote comsats about mail  (also '-DRBIFF_ALWAYS')
# -DUSE_NFSMBOX  - do remote locking of mail spool files mounted via NFS
#	see  support/{nfslock,rlockd} for more about this
MAILBOXDEFS=	-DBIFF # -DUSE_NFSMBOX # -DRBIFF

# SHELL is usually /bin/sh, but some systems may require a different
# pathname to get a working shell.  On Ultrix or other systems with a very
# old default shell, this may have to be set to /bin/sh5 or similar.
SHELL=		/bin/sh

# INSTALL is the program to do system installation.  UCB-install behaviour
# is expected..
INSTALL=	/usr/ucb/install

# MAILBIN is the directory hierarchy containing all ZMailer binaries.
# Usually /usr/lib/mail/bin or /local/lib/mail.
MAILBIN=	/usr/local/mail/bin

# MAILSHARE is the directory hierarchy containing site-wide configuration
# files and databases.  Usually /usr/lib/mail or /local/share/mail.
MAILSHARE=	/usr/local/mail

# MAILVAR is the directory that will contain machine-specific configuration
# files and databases.  Usually /usr/lib/mail or /var/db/mail or
# /local/share/mail.
MAILVAR=	/usr/local/mail

# MAILBOX is the directory containing all the user mailboxes.  This is
# defaulted inside the mailbox.c program (currently /var/mail) and may
# be overridden here.  Usually /usr/spool/mail or /var/mail.
MAILBOX=	/var/mail

# POSTOFFICE is the directory hierarchy used to manipulate message files,
# where runtime activity takes places.  Usually /usr/spool/postoffice or
# /var/spool/postoffice.
POSTOFFICE=	/var/spool/postoffice

# Multiple LOWER priorities on message routing can be defined by creating
# $POSTOFFICE/<component-of-$ROUTERDIRS> -directories.
# Routers process first   $POSTOFFICE/router/ -directory, and once it is
# empty, files from subsequent dirs.   See  mail(3)  mail_priority
# These can be only under the $POSTOFFICE, and they must exist!
ROUTERDIRS=router1:router2:router3:router4

# LOGDIR is the directory where log files will appear.  Usually /usr/spool/log
# or /var/log.
LOGDIR=		/var/log/mail

# LOGLEVEL may be set to restrict the log output of the router to entries
# whose tags are found in the specified string value.  The currently known
# tags are:
#	address: deferred: file: header_defer: info: recipient:
# LOGLEVEL=	file: recipient:
LOGLEVEL=	deferred: file: header_defer:

# MANDIR is the top of the manual directory hierarchy where manual pages
# for the ZMailer programs are installed.  Usually /usr/man or /local/man.
MANDIR=		/usr/local/man

# CC gives the command (and associated arguments) used to invoke the C
# compiler on your system.  Usually this would be the standard C compiler,
# so you won't need to define this -- leave it commented out.  However,
# a sample use is:
CC=		gcc -D__STDC__=0 #-traditional


# COPTS are the pervasive options to be given with all C compilations.
# The -g option is advised unless you have supreme confidence in your compiler.
COPTS=		-O6 -g

# RANLIB is included to cater to machines that don't need it at all, because
# their ar(1) program has been smitten by featuritis.  Usually ranlib or true.
RANLIB=		: ranlib # : ar does the work of ranlib under System V

# NOBODY is the unprivileged UID value.
# This is absolutely necessary if setuid() will fail on your "nobody" account
# uid (if it is -2, for example).  Make sure that whatever value you give
# here will work with setuid().  Values between 1 and 29999 will usually work.
# BE CAREFULL WITH THIS!  THE SYSTEM RELIES ON IT VERY MUCH IN DEED!
#  (On SunOS 4.1.3, and Solaris systems it seems that value  "-2"  works the
#   best -- it is so defined in the  lib/nobody.c too! )
NOBODY=		-2

# NROUTERS is the number of parallel router processes to run.  Most sites
# will not need to have more than one router running at a time.  For high
# volume dedicated mail hosts, the value should be set to run the nameserver
# (or disk or other asynchronous I/O bottleneck) at full throughput.  For
# sites that want to avoid mailing lists blocking the queue, pick a low number.
# The default is a single router process, equivalent to specifying 1.
# NROUTERS=10
NROUTERS=4

# MAILSERVER is the hostname of the remote machine where the postoffice is
# located.  This value is only needed in an environment with distributed file
# systems, and if it exists will be used by the mail queue querying program
# as the default name of the host to query.  It is a way of overriding the
# algorithm used by mailq in an NFS environment, or when you are running a
# different kind of DFS.  Usually undefined or a hostname.
#MAILSERVER=	neat.cs

# SMTPOPTIONS are command line options given to the smtpserver when started
# from the zmailer shell script.  The intent is that if you want non-default
# address verification options they can be specified here.  The default
# value is "-asve".
SMTPOPTIONS=	-asve -l /var/log/mail/smtpserver

# Here you can put any ZM ``environment'' variables you want to place in
# the system-wide configuration file (/etc/zmailer.conf).  Typically this
# would be information used by the router configuration at your site.

# PUNTHOST is where mail that is supposed to go to a local address, but
# no such address exists, is punted to.
#PUNTHOST=	relay.cs

# SMARTHOST is where mail that cannot be resolved or routed is punted to.
#SMARTHOST=	relay.cs
