#!@MAILBIN@/router -dkf
#
# ZMailer 2 configuration file for a generic SMTP host (with UUCP links)
#

ZCONFIG=@ZMAILERCFGFILE@

. $ZCONFIG

PATH=.:$MAILSHARE/cf:$MAILBIN/bin ; export PATH
PS1=z$PS1
#
# Configure error logging (squirrel)
#
squirrel -breakin
squirrel badheader

# Domains with these toplevels will not be canonicalized via DNS lookup
# This list is from ISOC table of 16-April-95
toplevels="ad ae af ag ai al am an ao aq ar as at au aw az ba bb bd be bf bg bh bi bj bm bn bo br bs bt bv bw by bz ca cc cf cg ch ci ck cl cm cn co com cr cu cv cx cy cz de dj dk dm do dz ec edu ee eg eh es et fi fj fk fm fo fr ga gb gd ge gf gh gi gl gm gn gov gp gq gr gt gu gw gy hk hm hn hr ht hu id ie il in int io iq ir is it jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc li lk lr ls lt lu lv ly ma mc md mg mh mil ml mm mn mo mp mq mr ms mt mu mv mw mx my mz na nc ne net nf ng ni nl no np nr nt nu nz om org pa pe pf pg ph pk pl pm pn pr pt pw py qa re ro ru rw sa sb sc sd se sg sh si sj sk sl sm sn so sr st sv sy sz tc td tf tg th tj tk tm tn to tp tr tt tv tw tz ua ug uk um us uy uz va vc ve vg vi vn vu wf ws ye yu za zm zr zw"


# The transport preference order

protocols='routes smtp uucp'

# Will the  MAILVAR/lists/listname  show out sender identity as
# either:  owner-listname, or:  listname-owner ?

if true ; then # Change to "false" to get "pre-owner" mode
	preowner=""
	postowner="-owner"
else
	preowner="owner-"
	postowner=""
fi

# Does our "local" channel accept domain (@) at the user part ?
# ZMailer's mailbox does accept.  If you use something else, and
# it doesn't accept, comment this away!

localdoesdomain=1

# We may want .forward and mailing list files to be private, i.e., we ignore
# the current privileges when checking the privileges of such files.
# Don't add 'include' to this list, since anyone can :include: any file.

private='.forward maillist'

# Set up the dependency checking

. consist.cf
require siteinfo router crossbar process server

# The following are standard setup files and must be loaded in this order

. standard.cf
. trusted.cf

# Load the databases so they and the variables defined (e.g. network-specific
# node names for this host) can be used in the site specific configuration.

for method in $protocols
do
	test -f $MAILSHARE/cf/i-${method}.cf && . i-${method}.cf
done

mailconf () {
	local hname

	# My official hostname
	if [ -f /bin/hostname ]; then
		rawhostname=$(/bin/hostname)
	elif [ -f /etc/sys_id ]; then
		read rawhostname < /etc/sys_id
	else
		rawhostname=$(/bin/uname -n)
	fi

	hname=$(canon $rawhostname)

	# Try to discover the organizational domain name
	orgdomain=$hname
	sift $hname in
	$rawhostname\.(.+)
		orgdomain=\1
		;;
	tfis
	hostname=$hname

	# This is what it will say on out mail
	mydomain=$hostname
}

orgdomains=x
: ${MAILCONF:=/etc/mail.conf}
if [ ! -r $MAILCONF ]; then
	echo "$0: missing $MAILCONF: using the following values:"
	mailconf
	echo orgdomain=$orgdomain
	echo hostname=$hostname
	echo mydomain=$mydomain
	provide siteinfo
else
	. $MAILCONF && provide siteinfo
fi
[ "$orgdomains" = x ] && orgdomains=$orgdomain

# set hostname to enable message-id generation and checking
hostname $hostname

. aliases.cf
. canon.cf
. rrouter.cf
. crossbar.cf

for method in $protocols
do
	. p-${method}.cf
done

. process.cf
. server.cf

consist || exit 1

