Index: zmailer/ChangeLog
diff -u zmailer/ChangeLog:1.573 zmailer/ChangeLog:1.593
--- zmailer/ChangeLog:1.573	Wed Feb 21 21:11:23 2001
+++ zmailer/ChangeLog	Tue May  8 15:51:33 2001
@@ -1,3 +1,189 @@
+2001-05-08  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
+
+	* Makefile.in:
+	    Version 2.99.55-patch1
+
+	* transports/smtp/smtp.h, transports/smtp/smtp.c:
+	    Reworking (simplifying) DATA phase processing,
+	    and quick-retry handling of socket write/read
+	    failure induced closes.  There is limit of three
+	    attempts on any given host for the delivery before
+	    giving up entirely.  (Passing the failure to the
+	    scheduler..)
+
+2001-05-04  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
+
+	* proto/cf/p-routes.cf:
+	    Wrong function called to pick the flag data..
+
+	* transports/smtp/smtp.c:
+	    Fixup into pipelined error diagnostics accumulation methodology.
+
+	* proto/newdbprocessor.in:
+	    PERL 5.6.0+ specific syntax altered back to earlier syntax,
+	    which even the lattest perl does support.
+
+	* configure.in:  --with-zconfig-noload   option to disable
+	    preloading of possibly existing ZCONFIG file contents
+	    into configuration variables.
+
+2001-04-04  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
+
+	* transports/smtp/getmxrr.c:
+	    If destination has one MX, and lookup for its A yields
+	    EAI_AGAIN, remember to report SS->mxcount = 0 ...
+
+2001-04-03  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
+
+	* proto/forms/delivery:
+	    Changed the URL reference to a "decode key" at
+		http://www.zmailer.org/delivery-report-decoding.html
+
+	* acconfig.h, configure.in:
+	    When supporting local  _getaddrinfo_() function,
+	    have a HAVE_ variable for it too!
+
+	* include/mail.h.in, router/rfc822.c:
+	    Rearranged the _CF_*** defines into the order at which
+	    the router uses them -- while editing documentation,
+	    and needing coherent view at the things.
+
+	* scheduler/threads.c:
+	    When running parallel TAs at same thread, remember to
+	    traverse pointer chain when showing process list..
+	    (verbose debugging to stderr..)
+
+	* libc/getaddrinfo.c:
+	    Present at the debug vlog file the g->gaih() return code
+	    in octal (it is a bitset, after all)
+
+	* smtpserver/mxverify.c, transports/smtp/getmxrr.c:
+	    Use the  HAVE__GETADDRINFO_  flag for local debug version..
+	    Also done changes for retrieving AF_INET and AF_INET6
+	    addresses separately, as there seems to be some problems
+	    when trying to use  ai_family == 0  ("any goes") form.
+
+2001-03-08  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
+
+	* include/mailer.h, router/rfc822.c, router/libdb/header.c,
+	  transports/errormail/errormail.c, scheduler/msgerror.c,
+	  proto/cf/p-routes.cf, router/functions.c:
+	    New envelope header:  "errormsg"  telling that a message
+	    is internally generated error message; router script has
+	    new function:  $(iserrmessage) yielding this flag.
+
+	* include/libc.h, include/libsh.h, include/sysprotos.h,
+	  libc/getopt.c, libsh/builtins.c, libsh/interpret.c,
+	  libsh/main.c, libsh/zmsh.c, router/router.c, router/db.c,
+	  router/functions.c:
+	    Changed all Router/ZMSH internal instances of getopt() to be
+	    zgetopt() with additional capability -- optionset can now
+	    contain doublecolon as an option, IF the ':' is the FIRST
+	    character at the option specifier string...
+
+	* proto/newdbprocessor.in, proto/db/dbases.conf, router/db.c,
+	  proto/cf/p-routes.cf, proto/cf/rrouter.cf, proto/db/routes,
+	  router/libdb/search.h:
+	    Implemented DBlookup routine to be able to pick some options
+	    at runtime, '-:' (with string arg) supplies default lookup
+	    key in case the normal iteration fails.
+	    Cases where the "zmailer newdb" should generate the lookup
+	    wrapper function with user parameter passing.
+	    Also support 'incore' database by compiling from source file
+	    to "db add" statements in the ``relationname.zmsh'' script.
+
+	* router/rfc822.c, router/functions.c, router/prototypes.h:
+	    Streamlined the recognition of the message being coming
+	    from an Error Channel ( not same as "errmessage" !)
+
+	* proto/cf/aliases.cf:
+	    The FOO+TAG needs to cut off at the first '+' char, not
+	    by the last (or whatever the REGEXP code happens to use)
+
+	* libsh/regex.c libsh/regex.h:
+	    Updated this pair to a very recent GLIBC contained version.
+
+	* transports/smtp/smtp.c:
+	    At response wait timeout, do have a GOAL TIME of when
+	    to timeout, not returning to it over and over again..
+
+	* configure.in, aclocal.m4, config.h.in:
+	    Using experimental  autoconf 2.49d  mandated couple of
+	    changes...
+
+2001-03-02  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
+
+	* README.UPGRADING:
+	    Added a note about the ALTERED default locations
+	    of  zmailer.conf  and  mail.conf  files.
+
+	* man/smtpserver.8, proto/smtpserver.conf.in:
+	    Fix up the tcp-wrapper related documentation, and the default
+	    stuff in the  smtpserver.conf  template.
+
+	* scheduler/threads.c:
+	    Print the gauges of message counts in the queue with SIGNED
+	    values, thus making underflows (negatives) more obvious.
+
+2001-03-01  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
+
+	* scheduler/mailq.c:
+	    Embarassing uninitialized array elements used for checking
+	    if loop ends - Tomasz Bojakowski <mad@devil.inside.pin.pl>
+	    reported errors.
+
+2001-02-27  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
+
+	* transports/smtp/smtp.c:
+	    At  smtp_sync()  when running in PIPELINING, if the
+	    MAIL FROM has produced 400 or 500 series response,
+	    do fault the RCPT TO responses in every case.
+	    (With EX_UNAVAILABLE for 500-series, not EX_TEMPFAIL.)
+
+	* smtpserver/smtpserver.h, smtpserver/smtpserver.c:
+	    Track Z_read() return errno code more properly to
+	    the 'Session closed w/o QUIT' log report.
+	    Case where this was needed was actually some firewall
+	    product which f**d OUTBOUND SMTP session of raporter...
+
+2001-02-26  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
+
+	* utils/listexpand.c, transports/smtp/smtp.c, include/ta.h,
+	  transports/libta/ctlopen.c:
+	    Implemented "EZMLM-alike" listexpander which does
+	    the envelope MAIL FROM address content rewrite at
+	    tne outgoing SMTP session.  This is done with 'DSN'
+	    dataentry  EZMLM=  which is presumed to have valid
+	    stuff to be appended to the localpart of the address
+	    envelope:  '+recipient=40address.dom', for example.
+
+	    When compared with more classical approach, this does
+	    message routing in system-friendly way, and only changes
+	    the output stage slightly.  (At classical case the message
+	    is expanded for each recipient, say 3000 copies of 60 kB
+	    each..  This mechanism is way faster.)
+
+2001-02-24  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
+
+	* smtpserver/smtpcmds.c:
+	    Make RCPT TO synchronous router reporting to be a copy
+	    of MAIL FROM one -- report things correctly, that is.
+
+2001-02-23  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
+
+	* router/rfc822.c, router/rtsyslog.c:
+	    Added the time to process the message to the router syslog
+	    report.  Both 'delay' and 'xdelay' just like at the TA's.
+	    'delay' is time from message injection to routing completion,
+	    'xdelay' is the time spent at the routing.
+
+	* utils/listexpand.c, utils/Makefile.in:
+	    Added '+ezlml' option, changed the low limit at
+	    the -bundlesize -- and set its default to 6000!
+	    Also re-learned that 'skip821address()' can only
+	    be used with *valid* addresses,  rfc821_path2()
+	    is for possibly invalid input scanning!
+
 2001-02-21  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
 
 	* Makefile.in:
@@ -5,7 +191,7 @@
 
 	* router/functions.c:
 	    At  $(listaddresses ..) and $(listexpand ..)  functions,
-	    removed the "%1@.." type substitutions with '-l' option.
+	    removed the '"%1"@..' type substitutions with '-l' option.
 	    See the comment about '-%' at 'relation' function below.
 	
 2001-02-20  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
@@ -52,7 +238,7 @@
 
 	* router/functions.c:
 	    At  $(listaddresses ..) and $(listexpand ..)  functions,
-	    support "%1@.." type substitutions with '-l' option.
+	    support '"%1"@..' type substitutions with '-l' option.
 	    I am now considering this *wrong* approach, and am doing
 	    more sendmailish approach to %N substitutions.
 
@@ -178,11 +364,11 @@
 2001-01-24  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
 
 	* lib/selfaddrs.c, transports/smtp/smtp.c:
-	    If resolver support option flag  RES_USE_INET6, but
+	    If resolver supports option flag  RES_USE_INET6, but
 	    system doesn't support IPv6 socket, clear that flag.
 
 	* libresolv/gethnamaddr.c, libresolv/netdb.h:
-	    When using   --with-bundled-libresolv  silense things a bit
+	    When using   --with-bundled-libresolv  silence things a bit
 	    as one particular #define may be set before calling this.
 	    Also, do explicitely at first lookup /etc/hosts file for
 	    host, only then do resolver lookups.
@@ -300,9 +486,6 @@
 	* scheduler/readconfig.c, scheduler/transport.c:
 	    setpriority() syscall autoconfig things
 
-	* smtpserver/smtpdata.c:
-	    "BDAT 0 LAST" is valid thing!
-
 2000-12-14  Matti Aarnio  <mea@aarnima1-pc1.icpd.sonera.fi>
 
 	* smtpserver/smtpdata.c:
@@ -414,7 +597,7 @@
 
 	* transports/smtp/smtp.c:
 	    Few hours of going over the  smtp_sync()'s smtp_nbread()
-	    call, and its surroundings.  Iverted its logic, and finally
+	    call, and its surroundings.  Inverted its logic, and finally
 	    got simple, clean, understandable code.  ("I smell Wumpus!")
 
 	* scheduler/mailq.c:
Index: zmailer/Makefile.in
diff -u zmailer/Makefile.in:1.59 zmailer/Makefile.in:1.62
--- zmailer/Makefile.in:1.59	Wed Feb 21 21:11:24 2001
+++ zmailer/Makefile.in	Tue May  8 15:51:33 2001
@@ -2,7 +2,7 @@
 
 MAJORVERSION =	2
 MINORVERSION =	99
-PATCHLEVEL =	55
+PATCHLEVEL =	55-patch1
 
 srcdir = @srcdir@
 VPATH = @srcdir@
Index: zmailer/README.UPGRADING
diff -u zmailer/README.UPGRADING:1.24 zmailer/README.UPGRADING:1.25
--- zmailer/README.UPGRADING:1.24	Tue Jan 23 01:35:08 2001
+++ zmailer/README.UPGRADING	Fri Mar  2 12:03:00 2001
@@ -12,6 +12,19 @@
 	If you upgrade several steps at once, all the notes in between
 	are important, naturally!
 
+	ZMailer-2.99.55:
+		The way how DEFAULT value for  zmailer.conf  location
+		is formed has been changed.  Formerly that, and  mail.conf
+		file used to default at  /etc/  directory.
+		Now  zmailer.conf will derive its location from
+			--prefix=
+		It really should be derived from $MAILSHARE, but the story
+		is long, and the script is complicated...  Do use
+		./configure  --with-zconfig=PATH  to set it explicitely.
+
+		The  mail.conf  is expected (by default versions of
+		router.cf) to be  $MAILVAR/mail.conf
+
 	ZMailer-2.99.55-pre1cvs (22-Jan-2001)
 		Detail change at how variable expansion happens inside
 		the router scripts with aim to allow less opportunities
Index: zmailer/TODO
diff -u zmailer/TODO:1.169 zmailer/TODO:1.172
--- zmailer/TODO:1.169	Fri Feb 16 03:12:28 2001
+++ zmailer/TODO	Tue May  8 15:33:02 2001
@@ -1,8 +1,13 @@
 Known/suspected bugs/Missing Features on current ZMailer sources
 
+check: Is router/db.c::db() now consistent at  argv1  construction ??
+
 check: scheduler.conf: command=  $channel  expansion ??
 	2.99.52-pre3  has apparently some problems!
 
+configure.in:
+	--includedir=.... not working ?? (XosÉ Vázquez <xose@smi-ps.com>)
+
 Wanted done for 3.0:
   - router  aliases.cf  to have similar 'protocols' feature as
     domain routing has currently
@@ -11,6 +16,9 @@
     run  "manual-expirer"
   - A work-over of the documentation
 
+
+proto/newdbprocessor.in:
+	Support  '-i -t ordered,$MAILVAR/db/realdata.dat -f ... '
 
 post-install:  Needs a way to define $(prefix) !
 
Index: zmailer/acconfig.h
diff -u zmailer/acconfig.h:1.10 zmailer/acconfig.h:1.11
--- zmailer/acconfig.h:1.10	Wed Jan 31 18:46:19 2001
+++ zmailer/acconfig.h	Tue Apr  3 14:45:35 2001
@@ -31,6 +31,8 @@
    routines don't support AF_INET6 ... */
 #undef INET6
 
+#undef HAVE__GETADDRINFO_
+
 /* socklen_t type can be found by including <sys/socket.h> */
 #undef HAVE_SOCKLEN_T
 
Index: zmailer/aclocal.m4
diff -u zmailer/aclocal.m4:1.2 zmailer/aclocal.m4:1.3
--- zmailer/aclocal.m4:1.2	Mon Jul 13 02:26:33 1998
+++ zmailer/aclocal.m4	Thu Mar  8 00:37:58 2001
@@ -157,18 +157,18 @@
   fi
 fi])
 
-AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
-[dnl
-#
-# Do we have "st_blksize" in the "struct stat" ?
-# Defines  HAVE_ST_BLKSIZE  if we do
-#
-AC_CACHE_CHECK(for st_blksize in struct stat, ac_cv_struct_stat_st_blksize, [
-AC_TRY_LINK([#include <sys/types.h>
-#include <sys/stat.h>], [struct stat st; st.st_blksize; ],
-		AC_DEFINE(HAVE_ST_BLKSIZE) ac_cv_struct_stat_st_blksize=yes)
-])
-])
+# AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
+# [dnl
+# #
+# # Do we have "st_blksize" in the "struct stat" ?
+# # Defines  HAVE_ST_BLKSIZE  if we do
+# #
+# AC_CACHE_CHECK(for st_blksize in struct stat, ac_cv_struct_stat_st_blksize, [
+# AC_TRY_LINK([#include <sys/types.h>
+# #include <sys/stat.h>], [struct stat st; st.st_blksize; ],
+# 		AC_DEFINE(HAVE_ST_BLKSIZE) ac_cv_struct_stat_st_blksize=yes)
+# ])
+# ])
 
 AC_DEFUN(AC_FUNC_GETMNTENT_MORE,
 [dnl
Index: zmailer/config.h.in
diff -u zmailer/config.h.in:1.27 zmailer/config.h.in:1.29
--- zmailer/config.h.in:1.27	Wed Jan 31 18:46:19 2001
+++ zmailer/config.h.in	Tue Apr  3 14:45:35 2001
@@ -1,134 +1,6 @@
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
+/* locally added autoconfig test report entries */
 
-/* Define if on AIX 3.
-   System headers sometimes define this.
-   We just want to avoid a redefinition error message.  */
-#ifndef _ALL_SOURCE
-#undef _ALL_SOURCE
-#endif
-
-/* Define if using alloca.c.  */
-#undef C_ALLOCA
-
-/* Define if the closedir function returns void instead of int.  */
-#undef CLOSEDIR_VOID
-
-/* Define to empty if the keyword does not work.  */
-#undef const
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
-   This function is required for alloca.c support on those systems.  */
-#undef CRAY_STACKSEG_END
-
-/* Define to the type of elements in the array set by `getgroups'.
-   Usually this is either `int' or `gid_t'.  */
-#undef GETGROUPS_T
-
-/* Define if the `getpgrp' function takes no argument.  */
-#undef GETPGRP_VOID
-
-/* Define to `int' if <sys/types.h> doesn't define.  */
-#undef gid_t
-
-/* Define if you have alloca, as a function or macro.  */
-#undef HAVE_ALLOCA
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix).  */
-#undef HAVE_ALLOCA_H
-
-/* Define if you don't have vprintf but do have _doprnt.  */
-#undef HAVE_DOPRNT
-
-/* Define if you have the getmntent function.  */
-#undef HAVE_GETMNTENT
-
-/* Define if you have a working `mmap' system call.  */
-#undef HAVE_MMAP
-
-/* Define if your struct stat has st_blksize.  */
-#undef HAVE_ST_BLKSIZE
-
-/* Define if your struct stat has st_blocks.  */
-#undef HAVE_ST_BLOCKS
-
-/* Define if you have the strftime function.  */
-#undef HAVE_STRFTIME
-
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
-#undef HAVE_SYS_WAIT_H
-
-/* Define if your struct tm has tm_zone.  */
-#undef HAVE_TM_ZONE
-
-/* Define if you don't have tm_zone but do have the external array
-   tzname.  */
-#undef HAVE_TZNAME
-
-/* Define if you have the vprintf function.  */
-#undef HAVE_VPRINTF
-
-/* Define if you have the wait3 system call.  */
-#undef HAVE_WAIT3
-
-/* Define as __inline if that's what the C compiler calls it.  */
-#undef inline
-
-/* Define if major, minor, and makedev are declared in <mkdev.h>.  */
-#undef MAJOR_IN_MKDEV
-
-/* Define if major, minor, and makedev are declared in <sysmacros.h>.  */
-#undef MAJOR_IN_SYSMACROS
-
-/* Define if on MINIX.  */
-#undef _MINIX
-
-/* Define to `int' if <sys/types.h> doesn't define.  */
-#undef mode_t
-
-/* Define to `long' if <sys/types.h> doesn't define.  */
-#undef off_t
-
-/* Define if the system does not provide POSIX.1 features except
-   with this defined.  */
-#undef _POSIX_1_SOURCE
-
-/* Define if you need to in order for stat and other things to work.  */
-#undef _POSIX_SOURCE
-
-/* Define as the return type of signal handlers (int or void).  */
-#undef RETSIGTYPE
-
-/* Define to `unsigned' if <sys/types.h> doesn't define.  */
-#undef size_t
-
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-#undef STACK_DIRECTION
-
-/* Define if you have the ANSI C header files.  */
-#undef STDC_HEADERS
-
-/* Define if `sys_siglist' is declared by <signal.h>.  */
-#undef SYS_SIGLIST_DECLARED
-
-/* Define if you can safely include both <sys/time.h> and <time.h>.  */
-#undef TIME_WITH_SYS_TIME
-
-/* Define if your <sys/time.h> declares struct tm.  */
-#undef TM_IN_SYS_TIME
-
-/* Define to `int' if <sys/types.h> doesn't define.  */
-#undef uid_t
-
-/* Define if your processor stores words with the most significant
-   byte first (like Motorola and SPARC, unlike Intel and VAX).  */
-#undef WORDS_BIGENDIAN
-
 /* What command was used to configure this setup ? */
 #undef CONFIGURE_CMD
 
@@ -160,6 +32,8 @@
    routines don't support AF_INET6 ... */
 #undef INET6
 
+#undef HAVE__GETADDRINFO_
+
 /* socklen_t type can be found by including <sys/socket.h> */
 #undef HAVE_SOCKLEN_T
 
@@ -228,6 +102,10 @@
 /* NIS (or "YP" for old salts) does exist */
 #undef HAVE_YP
 
+/* Want (not) to use TABs in RFC-822 headers to separate header name, and
+   its value from each other:  "From:" <TAB> <value> */
+#undef RFC822TABS
+
 /* The  sprintf()  returns a char*, or int ? */
 #undef SPRINTF_CHAR
 
@@ -260,7 +138,6 @@
 #undef HAVE_SYS_SIGLIST
 
 /* */
-#undef HAVE_TCPD_H
 #undef USE_TCPWRAPPER
 
 /* */
@@ -276,6 +153,12 @@
 #undef TA_USE_MMAP
 
 /* */
+#undef SVR4_elf
+
+/* */
+#undef SVR4_kvm
+
+/* */
 #undef HAVE_WHOSON_H
 
 /* HAVE_OPENSSL -- The system has www.OpenSSL.org software;
@@ -296,437 +179,577 @@
 /* Defined if resolver's  HEADER  structure has  cd  and  ad  fields */
 #undef HAVE_HEADER_CD_AD
 
-/* The number of bytes in a double.  */
-#undef SIZEOF_DOUBLE
+/* Define if the `closedir' function returns void instead of `int'. */
+#undef CLOSEDIR_VOID
 
-/* The number of bytes in a int.  */
-#undef SIZEOF_INT
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
+#undef CRAY_STACKSEG_END
 
-/* The number of bytes in a long.  */
-#undef SIZEOF_LONG
+/* Define if using `alloca.c'. */
+#undef C_ALLOCA
 
-/* The number of bytes in a short.  */
-#undef SIZEOF_SHORT
+/* Define to the type of elements in the array set by `getgroups'. Usually
+   this is either `int' or `gid_t'. */
+#undef GETGROUPS_T
 
-/* The number of bytes in a void *.  */
-#undef SIZEOF_VOID_P
+/* Define if the `getpgrp' function takes no argument. */
+#undef GETPGRP_VOID
+
+/* Define if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+#undef HAVE_ALLOCA_H
+
+/* Define if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
 
-/* Define if you have the crypt function.  */
+/* Define if you have the `crypt' function. */
 #undef HAVE_CRYPT
 
-/* Define if you have the endgrent function.  */
+/* Define if you have the <db1/db.h> header file. */
+#undef HAVE_DB1_DB_H
+
+/* Define if you have the <db2/db_185.h> header file. */
+#undef HAVE_DB2_DB_185_H
+
+/* Define if you have the <db2/db.h> header file. */
+#undef HAVE_DB2_DB_H
+
+/* Define if you have the <db3/db_185.h> header file. */
+#undef HAVE_DB3_DB_185_H
+
+/* Define if you have the <db3/db.h> header file. */
+#undef HAVE_DB3_DB_H
+
+/* Define if you have the <db_185.h> header file. */
+#undef HAVE_DB_185_H
+
+/* Define if you have the <db.h> header file. */
+#undef HAVE_DB_H
+
+/* Define if you have the <dirent.h> header file, and it defines `DIR'. */
+#undef HAVE_DIRENT_H
+
+/* Define if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
+
+/* Define if you have the `endgrent' function. */
 #undef HAVE_ENDGRENT
 
-/* Define if you have the fchdir function.  */
+/* Define if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
+
+/* Define if you have the `fchdir' function. */
 #undef HAVE_FCHDIR
 
-/* Define if you have the fchown function.  */
+/* Define if you have the `fchown' function. */
 #undef HAVE_FCHOWN
 
-/* Define if you have the flock function.  */
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the `flock' function. */
 #undef HAVE_FLOCK
 
-/* Define if you have the fpathconf function.  */
+/* Define if you have the `fpathconf' function. */
 #undef HAVE_FPATHCONF
 
-/* Define if you have the freeifaddrs function.  */
+/* Define if you have the `freeifaddrs' function. */
 #undef HAVE_FREEIFADDRS
 
-/* Define if you have the fsync function.  */
+/* Define if you have the `fsync' function. */
 #undef HAVE_FSYNC
 
-/* Define if you have the ftime function.  */
+/* Define if you have the `ftime' function. */
 #undef HAVE_FTIME
 
-/* Define if you have the ftruncate function.  */
+/* Define if you have the `ftruncate' function. */
 #undef HAVE_FTRUNCATE
 
-/* Define if you have the gai_strerror function.  */
+/* Define if you have the `gai_strerror' function. */
 #undef HAVE_GAI_STRERROR
+
+/* Define if you have the <gdbm.h> header file. */
+#undef HAVE_GDBM_H
 
-/* Define if you have the getaddrinfo function.  */
+/* Define if you have the `getaddrinfo' function. */
 #undef HAVE_GETADDRINFO
 
-/* Define if you have the getcwd function.  */
+/* Define if you have the `getcwd' function. */
 #undef HAVE_GETCWD
 
-/* Define if you have the getdtablesize function.  */
+/* Define if you have the `getdtablesize' function. */
 #undef HAVE_GETDTABLESIZE
 
-/* Define if you have the getenv function.  */
+/* Define if you have the `getenv' function. */
 #undef HAVE_GETENV
 
-/* Define if you have the getgroups function.  */
+/* Define if you have the `getgroups' function. */
 #undef HAVE_GETGROUPS
 
-/* Define if you have the gethostid function.  */
+/* Define if you have the `gethostid' function. */
 #undef HAVE_GETHOSTID
 
-/* Define if you have the getifaddrs function.  */
+/* Define if you have the `getifaddrs' function. */
 #undef HAVE_GETIFADDRS
 
-/* Define if you have the getmntinfo function.  */
+/* Define if you have the `getmntent' function. */
+#undef HAVE_GETMNTENT
+
+/* Define if you have the `getmntinfo' function. */
 #undef HAVE_GETMNTINFO
 
-/* Define if you have the getnameinfo function.  */
+/* Define if you have the `getnameinfo' function. */
 #undef HAVE_GETNAMEINFO
 
-/* Define if you have the getpagesize function.  */
+/* Define if you have the `getpagesize' function. */
 #undef HAVE_GETPAGESIZE
 
-/* Define if you have the getpgrp function.  */
+/* Define if you have the `getpgrp' function. */
 #undef HAVE_GETPGRP
 
-/* Define if you have the gettimeofday function.  */
+/* Define if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
-/* Define if you have the index function.  */
+/* Define if you have the <ifaddrs.h> header file. */
+#undef HAVE_IFADDRS_H
+
+/* Define if you have the `index' function. */
 #undef HAVE_INDEX
 
-/* Define if you have the inet_ntop function.  */
+/* Define if you have the `inet_ntop' function. */
 #undef HAVE_INET_NTOP
 
-/* Define if you have the inet_pton function.  */
+/* Define if you have the `inet_pton' function. */
 #undef HAVE_INET_PTON
+
+/* Define if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
 
-/* Define if you have the isascii function.  */
+/* Define if you have the `isascii' function. */
 #undef HAVE_ISASCII
 
-/* Define if you have the lockf function.  */
+/* Define if you have the `bsd' library (-lbsd). */
+#undef HAVE_LIBBSD
+
+/* Define if you have the `ldgc' library (-lldgc). */
+#undef HAVE_LIBLDGC
+
+/* Define if you have the `ypsec' library (-lypsec). */
+#undef HAVE_LIBYPSEC
+
+/* Define if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <linux/in6.h> header file. */
+#undef HAVE_LINUX_IN6_H
+
+/* Define if you have the `lockf' function. */
 #undef HAVE_LOCKF
 
-/* Define if you have the lstat function.  */
+/* Define if you have the `lstat' function. */
 #undef HAVE_LSTAT
 
-/* Define if you have the memchr function.  */
+/* Define if you have the <maillock.h> header file. */
+#undef HAVE_MAILLOCK_H
+
+/* Define if you have the `memchr' function. */
 #undef HAVE_MEMCHR
 
-/* Define if you have the memcpy function.  */
+/* Define if you have the `memcpy' function. */
 #undef HAVE_MEMCPY
+
+/* Define if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
 
-/* Define if you have the mkdir function.  */
+/* Define if you have the `mkdir' function. */
 #undef HAVE_MKDIR
 
-/* Define if you have the mkfifo function.  */
+/* Define if you have the `mkfifo' function. */
 #undef HAVE_MKFIFO
 
-/* Define if you have the mkstemp function.  */
+/* Define if you have the `mkstemp' function. */
 #undef HAVE_MKSTEMP
 
-/* Define if you have the mktime function.  */
+/* Define if you have the `mktime' function. */
 #undef HAVE_MKTIME
 
-/* Define if you have the msgctl function.  */
+/* Define if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define if you have the <mntent.h> header file. */
+#undef HAVE_MNTENT_H
+
+/* Define if you have the <mnttab.h> header file. */
+#undef HAVE_MNTTAB_H
+
+/* Define if you have the `msgctl' function. */
 #undef HAVE_MSGCTL
 
-/* Define if you have the msgrcv function.  */
+/* Define if you have the `msgrcv' function. */
 #undef HAVE_MSGRCV
 
-/* Define if you have the msgsnd function.  */
+/* Define if you have the `msgsnd' function. */
 #undef HAVE_MSGSND
+
+/* Define if you have the <ndbm.h> header file. */
+#undef HAVE_NDBM_H
+
+/* Define if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define if you have the <netinet6/in6.h> header file. */
+#undef HAVE_NETINET6_IN6_H
+
+/* Define if you have the <netinet/in6.h> header file. */
+#undef HAVE_NETINET_IN6_H
+
+/* Define if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define if you have the <protocols/rwhod.h> header file. */
+#undef HAVE_PROTOCOLS_RWHOD_H
 
-/* Define if you have the putenv function.  */
+/* Define if you have the `putenv' function. */
 #undef HAVE_PUTENV
 
-/* Define if you have the rename function.  */
+/* Define if you have the `rename' function. */
 #undef HAVE_RENAME
 
-/* Define if you have the rindex function.  */
+/* Define if you have the `rindex' function. */
 #undef HAVE_RINDEX
 
-/* Define if you have the rmdir function.  */
+/* Define if you have the `rmdir' function. */
 #undef HAVE_RMDIR
 
-/* Define if you have the select function.  */
+/* Define if you have the <sdbm.h> header file. */
+#undef HAVE_SDBM_H
+
+/* Define if you have the <security/pam_appl.h> header file. */
+#undef HAVE_SECURITY_PAM_APPL_H
+
+/* Define if you have the `select' function. */
 #undef HAVE_SELECT
+
+/* Define if you have the <select.h> header file. */
+#undef HAVE_SELECT_H
 
-/* Define if you have the setenv function.  */
+/* Define if you have the `setenv' function. */
 #undef HAVE_SETENV
 
-/* Define if you have the seteuid function.  */
+/* Define if you have the `seteuid' function. */
 #undef HAVE_SETEUID
 
-/* Define if you have the setgroups function.  */
+/* Define if you have the `setgroups' function. */
 #undef HAVE_SETGROUPS
 
-/* Define if you have the setpriority function.  */
+/* Define if you have the `setpriority' function. */
 #undef HAVE_SETPRIORITY
 
-/* Define if you have the setregid function.  */
+/* Define if you have the `setregid' function. */
 #undef HAVE_SETREGID
 
-/* Define if you have the setreuid function.  */
+/* Define if you have the `setreuid' function. */
 #undef HAVE_SETREUID
 
-/* Define if you have the setrlimit function.  */
+/* Define if you have the `setrlimit' function. */
 #undef HAVE_SETRLIMIT
 
-/* Define if you have the setsid function.  */
+/* Define if you have the `setsid' function. */
 #undef HAVE_SETSID
 
-/* Define if you have the setuid function.  */
+/* Define if you have the `setuid' function. */
 #undef HAVE_SETUID
 
-/* Define if you have the setvbuf function.  */
+/* Define if you have the `setvbuf' function. */
 #undef HAVE_SETVBUF
 
-/* Define if you have the sigpending function.  */
+/* Define if you have the <shadow.h> header file. */
+#undef HAVE_SHADOW_H
+
+/* Define if you have the `sigpending' function. */
 #undef HAVE_SIGPENDING
 
-/* Define if you have the sigprocmask function.  */
+/* Define if you have the `sigprocmask' function. */
 #undef HAVE_SIGPROCMASK
 
-/* Define if you have the sigsuspend function.  */
+/* Define if you have the `sigsuspend' function. */
 #undef HAVE_SIGSUSPEND
 
-/* Define if you have the snprintf function.  */
+/* Define if you have the `snprintf' function. */
 #undef HAVE_SNPRINTF
 
-/* Define if you have the socket function.  */
+/* Define if you have the `socket' function. */
 #undef HAVE_SOCKET
 
-/* Define if you have the socketpair function.  */
+/* Define if you have the `socketpair' function. */
 #undef HAVE_SOCKETPAIR
 
-/* Define if you have the statvfs function.  */
+/* Define if you have the `statvfs' function. */
 #undef HAVE_STATVFS
 
-/* Define if you have the strchr function.  */
+/* Define if you have the <stdarg.h> header file. */
+#undef HAVE_STDARG_H
+
+/* Define if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define if you have the `strchr' function. */
 #undef HAVE_STRCHR
 
-/* Define if you have the strcpy function.  */
+/* Define if you have the `strcpy' function. */
 #undef HAVE_STRCPY
 
-/* Define if you have the strdup function.  */
+/* Define if you have the `strdup' function. */
 #undef HAVE_STRDUP
 
-/* Define if you have the strerror function.  */
+/* Define if you have the `strerror' function. */
 #undef HAVE_STRERROR
+
+/* Define if you have the `strftime' function. */
+#undef HAVE_STRFTIME
+
+/* Define if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define if you have the <string.h> header file. */
+#undef HAVE_STRING_H
 
-/* Define if you have the strrchr function.  */
+/* Define if you have the `strrchr' function. */
 #undef HAVE_STRRCHR
 
-/* Define if you have the strsignal function.  */
+/* Define if you have the `strsignal' function. */
 #undef HAVE_STRSIGNAL
 
-/* Define if you have the strstr function.  */
+/* Define if you have the `strstr' function. */
 #undef HAVE_STRSTR
 
-/* Define if you have the strtoul function.  */
+/* Define if you have the `strtoul' function. */
 #undef HAVE_STRTOUL
+
+/* Define if `tm_zone' is member of `struct tm'. */
+#undef HAVE_STRUCT_TM_TM_ZONE
 
-/* Define if you have the sysconf function.  */
+/* Define if you have the `sysconf' function. */
 #undef HAVE_SYSCONF
 
-/* Define if you have the syslog function.  */
+/* Define if you have the `syslog' function. */
 #undef HAVE_SYSLOG
-
-/* Define if you have the unsetenv function.  */
-#undef HAVE_UNSETENV
-
-/* Define if you have the utime function.  */
-#undef HAVE_UTIME
-
-/* Define if you have the utimes function.  */
-#undef HAVE_UTIMES
 
-/* Define if you have the vsnprintf function.  */
-#undef HAVE_VSNPRINTF
-
-/* Define if you have the vsprintf function.  */
-#undef HAVE_VSPRINTF
+/* Define if you have the <syslog.h> header file. */
+#undef HAVE_SYSLOG_H
 
-/* Define if you have the wait4 function.  */
-#undef HAVE_WAIT4
+/* Define if you have the <sys/dir.h> header file, and it defines `DIR'. */
+#undef HAVE_SYS_DIR_H
 
-/* Define if you have the waitpid function.  */
-#undef HAVE_WAITPID
+/* Define if you have the <sys/filsys.h> header file. */
+#undef HAVE_SYS_FILSYS_H
 
-/* Define if you have the </local/include/whoson.h> header file.  */
-#undef HAVE__LOCAL_INCLUDE_WHOSON_H
+/* Define if you have the <sys/fstyp.h> header file. */
+#undef HAVE_SYS_FSTYP_H
 
-/* Define if you have the </opt/include/whoson.h> header file.  */
-#undef HAVE__OPT_INCLUDE_WHOSON_H
+/* Define if you have the <sys/fs_types.h> header file. */
+#undef HAVE_SYS_FS_TYPES_H
 
-/* Define if you have the </opt/local/include/whoson.h> header file.  */
-#undef HAVE__OPT_LOCAL_INCLUDE_WHOSON_H
+/* Define if you have the <sys/ipc.h> header file. */
+#undef HAVE_SYS_IPC_H
 
-/* Define if you have the </usr/local/include/whoson.h> header file.  */
-#undef HAVE__USR_LOCAL_INCLUDE_WHOSON_H
+/* Define if you have the <sys/mount.h> header file. */
+#undef HAVE_SYS_MOUNT_H
 
-/* Define if you have the <arpa/inet.h> header file.  */
-#undef HAVE_ARPA_INET_H
+/* Define if you have the <sys/msg.h> header file. */
+#undef HAVE_SYS_MSG_H
 
-/* Define if you have the <db.h> header file.  */
-#undef HAVE_DB_H
+/* Define if you have the <sys/ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_SYS_NDIR_H
 
-/* Define if you have the <db1/db.h> header file.  */
-#undef HAVE_DB1_DB_H
+/* Define if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
 
-/* Define if you have the <db2/db.h> header file.  */
-#undef HAVE_DB2_DB_H
+/* Define if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
 
-/* Define if you have the <db2/db_185.h> header file.  */
-#undef HAVE_DB2_DB_185_H
+/* Define if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
 
-/* Define if you have the <db3/db.h> header file.  */
-#undef HAVE_DB3_DB_H
+/* Define if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
 
-/* Define if you have the <db3/db_185.h> header file.  */
-#undef HAVE_DB3_DB_185_H
+/* Define if you have the <sys/statfs.h> header file. */
+#undef HAVE_SYS_STATFS_H
 
-/* Define if you have the <db_185.h> header file.  */
-#undef HAVE_DB_185_H
+/* Define if you have the <sys/statvfs.h> header file. */
+#undef HAVE_SYS_STATVFS_H
 
-/* Define if you have the <dirent.h> header file.  */
-#undef HAVE_DIRENT_H
+/* Define if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
 
-/* Define if you have the <errno.h> header file.  */
-#undef HAVE_ERRNO_H
+/* Define if you have the <sys/un.h> header file. */
+#undef HAVE_SYS_UN_H
 
-/* Define if you have the <fcntl.h> header file.  */
-#undef HAVE_FCNTL_H
+/* Define if you have the <sys/utsname.h> header file. */
+#undef HAVE_SYS_UTSNAME_H
 
-/* Define if you have the <gdbm.h> header file.  */
-#undef HAVE_GDBM_H
+/* Define if you have the <sys/vfs.h> header file. */
+#undef HAVE_SYS_VFS_H
 
-/* Define if you have the <ifaddrs.h> header file.  */
-#undef HAVE_IFADDRS_H
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
 
-/* Define if you have the <limits.h> header file.  */
-#undef HAVE_LIMITS_H
+/* Define if you have the <tcpd.h> header file. */
+#undef HAVE_TCPD_H
 
-/* Define if you have the <linux/in6.h> header file.  */
-#undef HAVE_LINUX_IN6_H
+/* Define if your `struct tm' has `tm_zone'. Deprecated, use
+   `HAVE_STRUCT_TM_TM_ZONE' instead. */
+#undef HAVE_TM_ZONE
 
-/* Define if you have the <maillock.h> header file.  */
-#undef HAVE_MAILLOCK_H
+/* Define if you don't have `tm_zone' but do have the external array `tzname'.
+   */
+#undef HAVE_TZNAME
 
-/* Define if you have the <mntent.h> header file.  */
-#undef HAVE_MNTENT_H
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
 
-/* Define if you have the <mnttab.h> header file.  */
-#undef HAVE_MNTTAB_H
+/* Define if you have the `unsetenv' function. */
+#undef HAVE_UNSETENV
 
-/* Define if you have the <ndbm.h> header file.  */
-#undef HAVE_NDBM_H
+/* Define if you have the `utime' function. */
+#undef HAVE_UTIME
 
-/* Define if you have the <ndir.h> header file.  */
-#undef HAVE_NDIR_H
+/* Define if you have the `utimes' function. */
+#undef HAVE_UTIMES
 
-/* Define if you have the <netdb.h> header file.  */
-#undef HAVE_NETDB_H
+/* Define if you have the <utime.h> header file. */
+#undef HAVE_UTIME_H
 
-/* Define if you have the <netinet/in.h> header file.  */
-#undef HAVE_NETINET_IN_H
+/* Define if you have the <varargs.h> header file. */
+#undef HAVE_VARARGS_H
 
-/* Define if you have the <netinet/in6.h> header file.  */
-#undef HAVE_NETINET_IN6_H
+/* Define if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
 
-/* Define if you have the <netinet6/in6.h> header file.  */
-#undef HAVE_NETINET6_IN6_H
+/* Define if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
 
-/* Define if you have the <protocols/rwhod.h> header file.  */
-#undef HAVE_PROTOCOLS_RWHOD_H
+/* Define if you have the `vsprintf' function. */
+#undef HAVE_VSPRINTF
 
-/* Define if you have the <sdbm.h> header file.  */
-#undef HAVE_SDBM_H
+/* Define if you have the `wait3' system call. */
+#undef HAVE_WAIT3
 
-/* Define if you have the <security/pam_appl.h> header file.  */
-#undef HAVE_SECURITY_PAM_APPL_H
+/* Define if you have the `wait4' function. */
+#undef HAVE_WAIT4
 
-/* Define if you have the <select.h> header file.  */
-#undef HAVE_SELECT_H
+/* Define if you have the `waitpid' function. */
+#undef HAVE_WAITPID
 
-/* Define if you have the <shadow.h> header file.  */
-#undef HAVE_SHADOW_H
+/* Define if you have the <whoson.h> header file. */
+#undef HAVE_WHOSON_H
 
-/* Define if you have the <stdarg.h> header file.  */
-#undef HAVE_STDARG_H
+/* Define if you have the </local/include/whoson.h> header file. */
+#undef HAVE__LOCAL_INCLUDE_WHOSON_H
 
-/* Define if you have the <stdlib.h> header file.  */
-#undef HAVE_STDLIB_H
+/* Define if you have the </opt/include/whoson.h> header file. */
+#undef HAVE__OPT_INCLUDE_WHOSON_H
 
-/* Define if you have the <string.h> header file.  */
-#undef HAVE_STRING_H
+/* Define if you have the </opt/local/include/whoson.h> header file. */
+#undef HAVE__OPT_LOCAL_INCLUDE_WHOSON_H
 
-/* Define if you have the <sys/dir.h> header file.  */
-#undef HAVE_SYS_DIR_H
+/* Define if you have the </usr/local/include/whoson.h> header file. */
+#undef HAVE__USR_LOCAL_INCLUDE_WHOSON_H
 
-/* Define if you have the <sys/filsys.h> header file.  */
-#undef HAVE_SYS_FILSYS_H
+/* Define if `major', `minor', and `makedev' are declared in <mkdev.h>. */
+#undef MAJOR_IN_MKDEV
 
-/* Define if you have the <sys/fs_types.h> header file.  */
-#undef HAVE_SYS_FS_TYPES_H
+/* Define if `major', `minor', and `makedev' are declared in <sysmacros.h>. */
+#undef MAJOR_IN_SYSMACROS
 
-/* Define if you have the <sys/fstyp.h> header file.  */
-#undef HAVE_SYS_FSTYP_H
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
 
-/* Define if you have the <sys/ipc.h> header file.  */
-#undef HAVE_SYS_IPC_H
+/* The size of a `double', as computed by sizeof. */
+#undef SIZEOF_DOUBLE
 
-/* Define if you have the <sys/mount.h> header file.  */
-#undef HAVE_SYS_MOUNT_H
+/* The size of a `int', as computed by sizeof. */
+#undef SIZEOF_INT
 
-/* Define if you have the <sys/msg.h> header file.  */
-#undef HAVE_SYS_MSG_H
+/* The size of a `long', as computed by sizeof. */
+#undef SIZEOF_LONG
 
-/* Define if you have the <sys/ndir.h> header file.  */
-#undef HAVE_SYS_NDIR_H
+/* The size of a `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
 
-/* Define if you have the <sys/param.h> header file.  */
-#undef HAVE_SYS_PARAM_H
+/* The size of a `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
 
-/* Define if you have the <sys/resource.h> header file.  */
-#undef HAVE_SYS_RESOURCE_H
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at run-time.
+        STACK_DIRECTION > 0 => grows toward higher addresses
+        STACK_DIRECTION < 0 => grows toward lower addresses
+        STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
 
-/* Define if you have the <sys/select.h> header file.  */
-#undef HAVE_SYS_SELECT_H
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
 
-/* Define if you have the <sys/socket.h> header file.  */
-#undef HAVE_SYS_SOCKET_H
+/* Define if `sys_siglist' is declared by <signal.h> or <unistd.h>. */
+#undef SYS_SIGLIST_DECLARED
 
-/* Define if you have the <sys/statfs.h> header file.  */
-#undef HAVE_SYS_STATFS_H
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
 
-/* Define if you have the <sys/statvfs.h> header file.  */
-#undef HAVE_SYS_STATVFS_H
+/* Define if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
 
-/* Define if you have the <sys/time.h> header file.  */
-#undef HAVE_SYS_TIME_H
+/* Define if your processor stores words with the most significant byte first
+   (like Motorola and SPARC, unlike Intel and VAX). */
+#undef WORDS_BIGENDIAN
 
-/* Define if you have the <sys/un.h> header file.  */
-#undef HAVE_SYS_UN_H
+/* Define if on AIX 3.
+   System headers sometimes define this.
+   We just want to avoid a redefinition error message.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
 
-/* Define if you have the <sys/utsname.h> header file.  */
-#undef HAVE_SYS_UTSNAME_H
+/* Define if on MINIX. */
+#undef _MINIX
 
-/* Define if you have the <sys/vfs.h> header file.  */
-#undef HAVE_SYS_VFS_H
+/* Define if the system does not provide POSIX.1 features except with this
+   defined. */
+#undef _POSIX_1_SOURCE
 
-/* Define if you have the <syslog.h> header file.  */
-#undef HAVE_SYSLOG_H
+/* Define if you need to in order for stat and other things to work. */
+#undef _POSIX_SOURCE
 
-/* Define if you have the <tcpd.h> header file.  */
-#undef HAVE_TCPD_H
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
 
-/* Define if you have the <unistd.h> header file.  */
-#undef HAVE_UNISTD_H
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
 
-/* Define if you have the <utime.h> header file.  */
-#undef HAVE_UTIME_H
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+   if it is not supported. */
+#undef inline
 
-/* Define if you have the <varargs.h> header file.  */
-#undef HAVE_VARARGS_H
+/* Define to `unsigned long' if <sys/types.h> does not define. */
+#undef ino_t
 
-/* Define if you have the <whoson.h> header file.  */
-#undef HAVE_WHOSON_H
+/* Define to `int' if <sys/types.h> does not define. */
+#undef mode_t
 
-/* Define if you have the bsd library (-lbsd).  */
-#undef HAVE_LIBBSD
+/* Define to `long' if <sys/types.h> does not define. */
+#undef off_t
 
-/* Define if you have the ldgc library (-lldgc).  */
-#undef HAVE_LIBLDGC
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
 
-/* Define if you have the ypsec library (-lypsec).  */
-#undef HAVE_LIBYPSEC
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
Index: zmailer/configure
diff -u zmailer/configure:1.101 zmailer/configure:1.104
--- zmailer/configure:1.101	Fri Feb 16 03:16:40 2001
+++ zmailer/configure	Fri May  4 14:07:40 2001
@@ -1,132 +1,195 @@
 #! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by Autoconf 2.49d.
+#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
 
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
 
+as_executable_p="test -f"
 
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
 
+# NLS nuisances.
+$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
+$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
+$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
+$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
+$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
+$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
+$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
+$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
+# Name of the executable.
+as_me=`echo "$0" | sed 's,.*/,,'`
 
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13 
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
+cat >config.log <<EOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me 2.49d, executed with
+ > $0 $@
+
+EOF
+{
+cat <<_ASUNAME
+## ---------- ##
+## Platform.  ##
+## ---------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+PATH = $PATH
+
+_ASUNAME
+} >>config.log
+
+cat >>config.log <<EOF
+## ------------ ##
+## Core tests.  ##
+## ------------ ##
+
+EOF
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 5 compiler messages saved in config.log
+# 6 checking for... messages and results
+exec 5>>config.log
+exec 6>&1
 
-# Defaults:
-ac_help=
+#
+# Initializations.
+#
 ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_help="$ac_help
-  --with-gcc              use gcc for compilation"
-ac_help="$ac_help
-  --with-generic-include=\"-I/...\"
-                            Include option for local overriders"
-ac_help="$ac_help
-  --with-generic-library=\"-L/...\"
-                            Library directory option for local overriders"
-ac_help="$ac_help
-  --with-zconfig=PATH     define the path and name of the zmailer.conf -file
-                          Set ZCONFIG environment, and then use --with-zconfig=no
-                          to disable usage of existing zmailer.conf -file to
-                          load existing defaults. "
-ac_help="$ac_help
-  --with-mailbox=DIR      define the path of the mailbox directory"
-ac_help="$ac_help
-  --with-postoffice=DIR   define the path of the postoffice directory"
-ac_help="$ac_help
-  --with-mailshare=DIR    define the path of the mailshare directory"
-ac_help="$ac_help
-  --with-mailvar=DIR      define the path of the mailvar directory"
-ac_help="$ac_help
-  --with-mailbin=DIR      define the path of the mailbin directory"
-ac_help="$ac_help
-  --with-logdir=DIR       define the path of the log directory"
-ac_help="$ac_help
-  --with-routeuser-is-abnormal={yes,no} define if your system doesn't get
-                          homedirs for users from getpwnam() call in router.
-                          Giving here 'no' will produce errors at routing for
-                          nonexistent users, not waiting until doing delivery
-                          attempt at mailbox."
-ac_help="$ac_help
-  --with-nntpserver=HOST  define the domain name of the nntp server"
-ac_help="$ac_help
-  --with-sendmailpath=PATH The location of the 'sendmail'"
-ac_help="$ac_help
-  --with-rmailpath=PATH    The location of 'rmail'"
-ac_help="$ac_help
-  --with-vacationpath=PATH The location of the 'vacation'"
-ac_help="$ac_help
-  --with-selfaddresses=NAME,NAME  Comma separated list of names"
-ac_help="$ac_help
-  --with-system-malloc    use system malloc instead of our own"
-ac_help="$ac_help
-  --with-libmalloc=LIBNAME define the name of the malloc library
-                           possible values: malloc, malloc_d, system (default)"
-ac_help="$ac_help
-  --with-yp                Have YP/NIS in system, and want to use it"
-ac_help="$ac_help
-  --with-yp-lib='-L... -lyp'  Linker arguments for the YP/NIS in the router"
-ac_help="$ac_help
-  --with-ldap-prefix=/usr  Prefix of UMich/NetScape LDAP includes, and library
-                           the directories are  PREFIX/include/ and PREFIX/lib/"
-ac_help="$ac_help
-  --with-ldap-include-dir=/.. Directory of UMich/NetScape LDAP includes"
-ac_help="$ac_help
-  --with-ldap-library-dir=/... Directory of UMich/NetScape LDAP libraries"
-ac_help="$ac_help
-  --disable-pam            Disable PAM(3) facility autoconfig "
-ac_help="$ac_help
-  --with-ipv6              Have IPv6 in system, and want to use it"
-ac_help="$ac_help
-  --without-fsync          Do not use fsync() even if you have it"
-ac_help="$ac_help
-  --without-maillock       Do not use maillock() even if you have it"
-ac_help="$ac_help
-  --with-bundled-libresolv Use bundled libresolv source"
-ac_help="$ac_help
-  --with-ipv6-replacement-libc If system has broken  getaddrinfo() and friends"
-ac_help="$ac_help
-  --without-rfc822-tabs    Turn off the TABs from the rewritten headers "
-ac_help="$ac_help
-  --with-tcp-wrappers[=DIRPATH] Where the TCP-WRAPPERS can be found"
-ac_help="$ac_help
-  --with-privatembox       Use 'private/' in a part of mailbox compilations"
-ac_help="$ac_help
-  --with-mboxquotacheck    Use 'CHECK_MB_SIZE' define in mailbox program.
-                           Linking is presumed to use  --with-generic-lib=DIR"
-ac_help="$ac_help
-  --with-privateauth       Use 'private/' in a part of smtpserver compilations"
-ac_help="$ac_help
-  --with-whoson[=DIRPATH]    Where the WHOSON libs can be found"
-ac_help="$ac_help
-  --with-ta-mmap           TA's to use MMAP for reading the message bodies"
-ac_help="$ac_help
-  --with-getpwnam-library=\"-L.. -l..\"
-                            Linking options for non-std getpwnam() libraries"
-ac_help="$ac_help
-  --with-openssl-prefix=/dir/path (defines both include and lib)"
-ac_help="$ac_help
-  --with-openssl-include=/dir/incl/path"
-ac_help="$ac_help
-  --with-openssl-lib=/dir/lib/path"
-ac_help="$ac_help
-  --with-openssl           Search for, and use OpenSSL, if it can be found"
-ac_help="$ac_help
-  --enable-translation=CHS Enable translation of
-ncoming text messages.     
-                           Assumes --generic-library=\"... -lmcs ...\" and
-                           proper --generic-include.
-                           (See smtpserver/README.translation)"
+cross_compiling=no
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Avoid depending upon Character Ranges.
+ac_cr_az='abcdefghijklmnopqrstuvwxyz'
+ac_cr_AZ='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ac_cr_09='0123456789'
+ac_cr_alnum=$ac_cr_az$ac_cr_AZ$ac_cr_09
+
+# Sed expression to map a string onto a valid sh and CPP variable names.
+ac_tr_sh="sed y%*+%pp%;s%[^_$ac_cr_alnum]%_%g"
+ac_tr_cpp="sed y%*$ac_cr_az%P$ac_cr_AZ%;s%[^_$ac_cr_alnum]%_%g"
+
+ac_unique_file="router/router.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#else
+# if HAVE_STRINGS_H
+#  include <strings.h>
+# endif
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
 
 # Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
 # The variables have the same names as the options, with
 # dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
+cache_file=/dev/null
 exec_prefix=NONE
-host=NONE
 no_create=
-nonopt=NONE
 no_recursion=
 prefix=NONE
 program_prefix=NONE
@@ -135,10 +198,15 @@
 silent=
 site=
 srcdir=
-target=NONE
 verbose=
 x_includes=NONE
 x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
@@ -152,17 +220,16 @@
 infodir='${prefix}/info'
 mandir='${prefix}/man'
 
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
 
 ac_prev=
 for ac_option
 do
-
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
     eval "$ac_prev=\$ac_option"
@@ -170,59 +237,61 @@
     continue
   fi
 
-  case "$ac_option" in
-  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) ac_optarg= ;;
-  esac
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case "$ac_option" in
+  case $ac_option in
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir="$ac_optarg" ;;
+    bindir=$ac_optarg ;;
 
   -build | --build | --buil | --bui | --bu)
-    ac_prev=build ;;
+    ac_prev=build_alias ;;
   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build="$ac_optarg" ;;
+    build_alias=$ac_optarg ;;
 
   -cache-file | --cache-file | --cache-fil | --cache-fi \
   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
     ac_prev=cache_file ;;
   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file="$ac_optarg" ;;
+    cache_file=$ac_optarg ;;
 
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
     ac_prev=datadir ;;
   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
   | --da=*)
-    datadir="$ac_optarg" ;;
+    datadir=$ac_optarg ;;
 
   -disable-* | --disable-*)
-    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
-      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
-    fi
-    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
-    eval "enable_${ac_feature}=no" ;;
+    expr "x$ac_feature" : ".*[^-_$ac_cr_alnum]" >/dev/null &&
+      { { echo "$as_me:276: error: invalid feature name: $ac_feature" >&5
+echo "$as_me: error: invalid feature name: $ac_feature" >&2;}
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
 
   -enable-* | --enable-*)
-    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
-      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
-    fi
-    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
-    case "$ac_option" in
-      *=*) ;;
+    expr "x$ac_feature" : ".*[^-_$ac_cr_alnum]" >/dev/null &&
+      { { echo "$as_me:286: error: invalid feature name: $ac_feature" >&5
+echo "$as_me: error: invalid feature name: $ac_feature" >&2;}
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
       *) ac_optarg=yes ;;
     esac
-    eval "enable_${ac_feature}='$ac_optarg'" ;;
+    eval "enable_$ac_feature='$ac_optarg'" ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -231,95 +300,47 @@
   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
   | --exec=* | --exe=* | --ex=*)
-    exec_prefix="$ac_optarg" ;;
+    exec_prefix=$ac_optarg ;;
 
   -gas | --gas | --ga | --g)
     # Obsolete; use --with-gas.
     with_gas=yes ;;
 
-  -help | --help | --hel | --he)
-    # Omit some internal or obsolete options to make the list less imposing.
-    # This message is too long to be a string in the A/UX 3.1 sh.
-    cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
-  --cache-file=FILE       cache test results in FILE
-  --help                  print this message
-  --no-create             do not create output files
-  --quiet, --silent       do not print \`checking...' messages
-  --version               print the version of autoconf that created configure
-Directory and file names:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [same as prefix]
-  --bindir=DIR            user executables in DIR [EPREFIX/bin]
-  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
-  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
-  --datadir=DIR           read-only architecture-independent data in DIR
-                          [PREFIX/share]
-  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
-  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
-                          [PREFIX/com]
-  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
-  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
-  --includedir=DIR        C header files in DIR [PREFIX/include]
-  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
-  --infodir=DIR           info documentation in DIR [PREFIX/info]
-  --mandir=DIR            man documentation in DIR [PREFIX/man]
-  --srcdir=DIR            find the sources in DIR [configure dir or ..]
-  --program-prefix=PREFIX prepend PREFIX to installed program names
-  --program-suffix=SUFFIX append SUFFIX to installed program names
-  --program-transform-name=PROGRAM
-                          run sed PROGRAM on installed program names
-EOF
-    cat << EOF
-Host type:
-  --build=BUILD           configure for building on BUILD [BUILD=HOST]
-  --host=HOST             configure for HOST [guessed]
-  --target=TARGET         configure for TARGET [TARGET=HOST]
-Features and packages:
-  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --x-includes=DIR        X include files are in DIR
-  --x-libraries=DIR       X library files are in DIR
-EOF
-    if test -n "$ac_help"; then
-      echo "--enable and --with options recognized:$ac_help"
-    fi
-    exit 0 ;;
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
 
   -host | --host | --hos | --ho)
-    ac_prev=host ;;
+    ac_prev=host_alias ;;
   -host=* | --host=* | --hos=* | --ho=*)
-    host="$ac_optarg" ;;
+    host_alias=$ac_optarg ;;
 
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
   | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir="$ac_optarg" ;;
+    includedir=$ac_optarg ;;
 
   -infodir | --infodir | --infodi | --infod | --info | --inf)
     ac_prev=infodir ;;
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir="$ac_optarg" ;;
+    infodir=$ac_optarg ;;
 
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir="$ac_optarg" ;;
+    libdir=$ac_optarg ;;
 
   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
   | --libexe | --libex | --libe)
     ac_prev=libexecdir ;;
   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
   | --libexe=* | --libex=* | --libe=*)
-    libexecdir="$ac_optarg" ;;
+    libexecdir=$ac_optarg ;;
 
   -localstatedir | --localstatedir | --localstatedi | --localstated \
   | --localstate | --localstat | --localsta | --localst \
@@ -328,12 +349,12 @@
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
-    localstatedir="$ac_optarg" ;;
+    localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
     ac_prev=mandir ;;
   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir="$ac_optarg" ;;
+    mandir=$ac_optarg ;;
 
   -nfp | --nfp | --nf)
     # Obsolete; use --without-fp.
@@ -354,26 +375,26 @@
   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir="$ac_optarg" ;;
+    oldincludedir=$ac_optarg ;;
 
   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
     ac_prev=prefix ;;
   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix="$ac_optarg" ;;
+    prefix=$ac_optarg ;;
 
   -program-prefix | --program-prefix | --program-prefi | --program-pref \
   | --program-pre | --program-pr | --program-p)
     ac_prev=program_prefix ;;
   -program-prefix=* | --program-prefix=* | --program-prefi=* \
   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix="$ac_optarg" ;;
+    program_prefix=$ac_optarg ;;
 
   -program-suffix | --program-suffix | --program-suffi | --program-suff \
   | --program-suf | --program-su | --program-s)
     ac_prev=program_suffix ;;
   -program-suffix=* | --program-suffix=* | --program-suffi=* \
   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix="$ac_optarg" ;;
+    program_suffix=$ac_optarg ;;
 
   -program-transform-name | --program-transform-name \
   | --program-transform-nam | --program-transform-na \
@@ -390,7 +411,7 @@
   | --program-transfo=* | --program-transf=* \
   | --program-trans=* | --program-tran=* \
   | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name="$ac_optarg" ;;
+    program_transform_name=$ac_optarg ;;
 
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
@@ -400,7 +421,7 @@
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
   | --sbi=* | --sb=*)
-    sbindir="$ac_optarg" ;;
+    sbindir=$ac_optarg ;;
 
   -sharedstatedir | --sharedstatedir | --sharedstatedi \
   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
@@ -411,58 +432,59 @@
   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
   | --sha=* | --sh=*)
-    sharedstatedir="$ac_optarg" ;;
+    sharedstatedir=$ac_optarg ;;
 
   -site | --site | --sit)
     ac_prev=site ;;
   -site=* | --site=* | --sit=*)
-    site="$ac_optarg" ;;
+    site=$ac_optarg ;;
 
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir="$ac_optarg" ;;
+    srcdir=$ac_optarg ;;
 
   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
   | --syscon | --sysco | --sysc | --sys | --sy)
     ac_prev=sysconfdir ;;
   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir="$ac_optarg" ;;
+    sysconfdir=$ac_optarg ;;
 
   -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target ;;
+    ac_prev=target_alias ;;
   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target="$ac_optarg" ;;
+    target_alias=$ac_optarg ;;
 
   -v | -verbose | --verbose | --verbos | --verbo | --verb)
     verbose=yes ;;
 
-  -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.13"
-    exit 0 ;;
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
-      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
-    fi
+    expr "x$ac_package" : ".*[^-_$ac_cr_alnum]" >/dev/null &&
+      { { echo "$as_me:469: error: invalid package name: $ac_package" >&5
+echo "$as_me: error: invalid package name: $ac_package" >&2;}
+   { (exit 1); exit 1; }; }
     ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case "$ac_option" in
-      *=*) ;;
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
       *) ac_optarg=yes ;;
     esac
-    eval "with_${ac_package}='$ac_optarg'" ;;
+    eval "with_$ac_package='$ac_optarg'" ;;
 
   -without-* | --without-*)
-    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
-      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
-    fi
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    eval "with_${ac_package}=no" ;;
+    expr "x$ac_package" : ".*[^-_$ac_cr_alnum]" >/dev/null &&
+      { { echo "$as_me:483: error: invalid package name: $ac_package" >&5
+echo "$as_me: error: invalid package name: $ac_package" >&2;}
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -473,98 +495,98 @@
     ac_prev=x_includes ;;
   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes="$ac_optarg" ;;
+    x_includes=$ac_optarg ;;
 
   -x-libraries | --x-libraries | --x-librarie | --x-librari \
   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
     ac_prev=x_libraries ;;
   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries="$ac_optarg" ;;
+    x_libraries=$ac_optarg ;;
 
-  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+  -*) { { echo "$as_me:507: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; }
     ;;
 
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$ac_cr_alnum]" >/dev/null &&
+      { { echo "$as_me:518: error: invalid variable name: $ac_envvar" >&5
+echo "$as_me: error: invalid variable name: $ac_envvar" >&2;}
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
   *)
-    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
-      echo "configure: warning: $ac_option: invalid host type" 1>&2
-    fi
-    if test "x$nonopt" != xNONE; then
-      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
-    fi
-    nonopt="$ac_option"
+    # FIXME: should be removed in autoconf 3.0.
+    { echo "$as_me:527: WARNING: you should use --build, --host, --target" >&5
+echo "$as_me: WARNING: you should use --build, --host, --target" >&2;}
+    expr "x$ac_option" : ".*[^-._$ac_cr_alnum]" >/dev/null &&
+      { echo "$as_me:530: WARNING: invalid host type: $ac_option" >&5
+echo "$as_me: WARNING: invalid host type: $ac_option" >&2;}
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
   esac
 done
 
 if test -n "$ac_prev"; then
-  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
-  exec 6>/dev/null
-else
-  exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
-
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
-do
-  case "$ac_arg" in
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c) ;;
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
-  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
-  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
-  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { { echo "$as_me:540: error: missing argument to $ac_option" >&5
+echo "$as_me: error: missing argument to $ac_option" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+              localstatedir libdir includedir oldincludedir infodir mandir \
+              exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    NONE ) ;;
+    *)  { { echo "$as_me:554: error: expected an absolute path for --$ac_var: $ac_val" >&5
+echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2;}
+   { (exit 1); exit 1; }; };;
   esac
 done
 
-# NLS nuisances.
-# Only set these to C if already set.  These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: should be removed in autoconf 3.0.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    { echo "$as_me:570: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&5
+echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2;}
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
 
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
 
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=router/router.c
+test "$silent" = yes && exec 6>/dev/null
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
   # Try the directory containing this script, then its parent.
   ac_prog=$0
-  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  ac_confdir=`echo "$ac_prog" | sed 's%/[^/][^/]*$%%'`
   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
   srcdir=$ac_confdir
   if test ! -r $srcdir/$ac_unique_file; then
@@ -575,13 +597,322 @@
 fi
 if test ! -r $srcdir/$ac_unique_file; then
   if test "$ac_srcdir_defaulted" = yes; then
-    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+    { { echo "$as_me:600: error: cannot find sources in $ac_confdir or .." >&5
+echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2;}
+   { (exit 1); exit 1; }; }
   else
-    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
-  fi
+    { { echo "$as_me:604: error: cannot find sources in $srcdir" >&5
+echo "$as_me: error: cannot find sources in $srcdir" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+srcdir=`echo "$srcdir" | sed 's%\([^/]\)/*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<EOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+EOF
+
+  cat <<EOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+EOF
+
+  cat <<\EOF
+EOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\EOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-translation=CHS Enable translation of
+ncoming text messages.
+                           Assumes --generic-library=\"... -lmcs ...\" and
+                           proper --generic-include.
+                           (See smtpserver/README.translation)
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gcc              use gcc for compilation
+  --with-generic-include=\"-I/...\"
+                            Include option for local overriders
+  --with-generic-library=\"-L/...\"
+                            Library directory option for local overriders
+  --with-zconfig=PATH     define the path and name of the zmailer.conf -file
+                          Set ZCONFIG environment, and then use --with-zconfig=no
+                          to disable usage of existing zmailer.conf -file to
+                          load existing defaults.
+  --with-zconfig-noload   Don't pre-load old values from possibly existing
+                          ZCONFIG file.
+  --with-mailbox=DIR      define the path of the mailbox directory
+  --with-postoffice=DIR   define the path of the postoffice directory
+  --with-mailshare=DIR    define the path of the mailshare directory
+  --with-mailvar=DIR      define the path of the mailvar directory
+  --with-mailbin=DIR      define the path of the mailbin directory
+  --with-logdir=DIR       define the path of the log directory
+  --with-routeuser-is-abnormal={yes,no} define if your system doesn't get
+                          homedirs for users from getpwnam() call in router.
+                          Giving here 'no' will produce errors at routing for
+                          nonexistent users, not waiting until doing delivery
+                          attempt at mailbox.
+  --with-nntpserver=HOST  define the domain name of the nntp server
+  --with-sendmailpath=PATH The location of the 'sendmail'
+  --with-rmailpath=PATH    The location of 'rmail'
+  --with-vacationpath=PATH The location of the 'vacation'
+  --with-selfaddresses=NAME,NAME  Comma separated list of names
+  --with-system-malloc    use system malloc instead of our own
+  --with-libmalloc=LIBNAME define the name of the malloc library
+                           possible values: malloc, malloc_d, system (default)
+  --with-yp                Have YP/NIS in system, and want to use it
+  --with-yp-lib='-L... -lyp'  Linker arguments for the YP/NIS in the router
+  --with-ldap-prefix=/usr  Prefix of UMich/NetScape LDAP includes, and library
+                           the directories are  PREFIX/include/ and PREFIX/lib/
+  --with-ldap-include-dir=/.. Directory of UMich/NetScape LDAP includes
+  --with-ldap-library-dir=/... Directory of UMich/NetScape LDAP libraries
+  --disable-pam            Disable PAM(3) facility autoconfig
+  --with-ipv6              Have IPv6 in system, and want to use it
+  --without-fsync          Do not use fsync() even if you have it
+  --without-maillock       Do not use maillock() even if you have it
+  --with-bundled-libresolv Use bundled libresolv source
+  --with-ipv6-replacement-libc If system has broken  getaddrinfo() and friends
+  --without-rfc822-tabs    Turn off the TABs from the rewritten headers
+  --with-tcp-wrappers=DIRPATH Where the TCP-WRAPPERS can be found
+  --with-privatembox       Use 'private/' in a part of mailbox compilations
+  --with-mboxquotacheck    Use 'CHECK_MB_SIZE' define in mailbox program.
+                           Linking is presumed to use  --with-generic-lib=DIR
+  --with-privateauth       Use 'private/' in a part of smtpserver compilations
+  --with-whoson=DIRPATH    Where the WHOSON libs can be found
+  --with-ta-mmap           TA's to use MMAP for reading the message bodies
+  --with-getpwnam-library=\"-L.. -l..\"
+                            Linking options for non-std getpwnam() libraries
+  --with-openssl-prefix=/dir/path (defines both include and lib)
+  --with-openssl-include=/dir/incl/path
+  --with-openssl-lib=/dir/lib/path
+  --with-openssl           Search for, and use OpenSSL, if it can be found
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPP         C preprocessor
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+EOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
+    cd $ac_subdir
+    # A "../" for each directory in /$ac_subdir.
+    ac_dots=`echo $ac_subdir |
+             sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
+
+    case $srcdir in
+    .) # No --srcdir option.  We are building in place.
+      ac_sub_srcdir=$srcdir ;;
+    [\\/]* | ?:[\\/]* ) # Absolute path.
+      ac_sub_srcdir=$srcdir/$ac_subdir ;;
+    *) # Relative path.
+      ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
+    esac
+
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_sub_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_sub_srcdir/configure; then
+      echo
+      $SHELL $ac_sub_srcdir/configure  --help=recursive
+    elif test -f $ac_sub_srcdir/configure.ac ||
+           test -f $ac_sub_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      { echo "$as_me:823: WARNING: no configuration information is in $ac_subdir" >&5
+echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2;}
+    fi
+    cd $ac_popdir
+  done
 fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
 
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\EOF
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+EOF
+  exit 0
+fi
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell meta-characters.
+ac_configure_args=
+ac_sep=
+for ac_arg
+do
+  case $ac_arg in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+    ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
+    ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+    ac_sep=" " ;;
+  *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
+     ac_sep=" " ;;
+  esac
+  # Get rid of the leading space.
+done
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  echo >&5
+  echo "## ----------------- ##" >&5
+  echo "## Cache variables.  ##" >&5
+  echo "## ----------------- ##" >&5
+  echo >&5
+  # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+    	  s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+        "s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} >&5
+  sed "/^$/d" confdefs.h >conftest.log
+  if test -s conftest.log; then
+    echo >&5
+    echo "## ------------ ##" >&5
+    echo "## confdefs.h.  ##" >&5
+    echo "## ------------ ##" >&5
+    echo >&5
+    cat conftest.log >&5
+  fi
+  (echo; echo) >&5
+  test "$ac_signal" != 0 &&
+    echo "$as_me: caught signal $ac_signal" >&5
+  echo "$as_me: exit $exit_status" >&5
+  rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_status=$?; ac_signal='$ac_signal'; { (exit $ac_status); exit $ac_status; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Let the site file select an alternate cache file if it wants to.
 # Prefer explicitly selected file to automatically selected ones.
 if test -z "$CONFIG_SITE"; then
   if test "x$prefix" != xNONE; then
@@ -592,271 +923,655 @@
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
-    echo "loading site script $ac_site_file"
+    { echo "$as_me:926: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    cat "$ac_site_file" >&5
     . "$ac_site_file"
   fi
 done
 
 if test -r "$cache_file"; then
-  echo "loading cache $cache_file"
-  . $cache_file
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:937: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
 else
-  echo "creating cache $cache_file"
-  > $cache_file
+  { echo "$as_me:945: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_suggest_removing_cache=false
+for ac_var in `(set) 2>&1 |
+               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:961: WARNING: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: WARNING: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_suggest_removing_cache=: ;;
+    ,set)
+      { echo "$as_me:965: WARNING: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: WARNING: \`$ac_var' was not set in the previous run" >&2;}
+      ac_suggest_removing_cache=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+        { echo "$as_me:971: WARNING: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: WARNING: \`$ac_var' has changed since the previous run:" >&2;}
+        { echo "$as_me:973: WARNING:   former value:  $ac_old_val" >&5
+echo "$as_me: WARNING:   former value:  $ac_old_val" >&2;}
+        { echo "$as_me:975: WARNING:   current value: $ac_new_val" >&5
+echo "$as_me: WARNING:   current value: $ac_new_val" >&2;}
+        ac_suggest_removing_cache=:
+      fi;;
+  esac
+done
+if $ac_suggest_removing_cache; then
+  { echo "$as_me:982: WARNING: changes in the environment can compromise the build" >&5
+echo "$as_me: WARNING: changes in the environment can compromise the build" >&2;}
+  { echo "$as_me:984: WARNING: consider removing $cache_file and starting over" >&5
+echo "$as_me: WARNING: consider removing $cache_file and starting over" >&2;}
 fi
 
 ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
-  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
-  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
-    ac_n= ac_c='
-' ac_t='	'
-  else
-    ac_n=-n ac_c= ac_t=
-  fi
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+echo "#! $SHELL" >conftest.sh
+echo  "exit 0"   >>conftest.sh
+chmod +x conftest.sh
+if { (echo "$as_me:1003: PATH=\".;.\"; conftest.sh") >&5
+  (PATH=".;."; conftest.sh) 2>&5
+  ac_status=$?
+  echo "$as_me:1006: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  ac_path_separator=';'
 else
-  ac_n= ac_c='\c' ac_t=
+  ac_path_separator=:
 fi
-
+PATH_SEPARATOR="$ac_path_separator"
+rm -f conftest.sh
 
+ac_config_headers="$ac_config_headers config.h"
 
 ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-
 #----------------------------------------------------------------------------
 #       Check if we should use gcc if available on this machine.
 #----------------------------------------------------------------------------
 use_gcc=0
+
 # Check whether --with-gcc or --without-gcc was given.
 if test "${with_gcc+set}" = set; then
   withval="$with_gcc"
   use_gcc=1
-fi
-
+fi;
 if test "$use_gcc" = 0 ; then
     CC=${CC-cc}
 else
-    # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:656: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:1044: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_CC="gcc"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC="${ac_tool_prefix}gcc"
+break
+done
+
 fi
 fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
+  echo "$as_me:1066: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:1069: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:686: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:1078: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_prog_rejected=no
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
-        ac_prog_rejected=yes
-	continue
-      fi
-      ac_cv_prog_CC="cc"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# -gt 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    set dummy "$ac_dir/$ac_word" "$@"
-    shift
-    ac_cv_prog_CC="$@"
-  fi
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC="gcc"
+break
+done
+
 fi
 fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:1100: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:1103: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
+
+  CC=$ac_ct_CC
 else
-  echo "$ac_t""no" 1>&6
+  CC="$ac_cv_prog_CC"
 fi
 
-  if test -z "$CC"; then
-    case "`uname -s`" in
-    *win32* | *WIN32*)
-      # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:737: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:1116: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_CC="cl"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC="${ac_tool_prefix}cc"
+break
+done
+
 fi
 fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
+  echo "$as_me:1138: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
 else
-  echo "$ac_t""no" 1>&6
-fi
- ;;
-    esac
-  fi
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+  echo "$as_me:1141: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:769: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:1150: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC="cc"
+break
+done
 
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:1172: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:1175: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
 
-cat > conftest.$ac_ext << EOF
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
 
-#line 780 "configure"
-#include "confdefs.h"
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:1188: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+  ac_prog_rejected=yes
+  continue
+fi
+ac_cv_prog_CC="cc"
+break
+done
 
-main(){return(0);}
-EOF
-if { (eval echo configure:785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  ac_cv_prog_cc_works=yes
-  # If we can't run a trivial program, we are probably using a cross compiler.
-  if (./conftest; exit) 2>/dev/null; then
-    ac_cv_prog_cc_cross=no
-  else
-    ac_cv_prog_cc_cross=yes
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" ${1+"$@"}
+    shift
+    ac_cv_prog_CC="$@"
   fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:1229: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  ac_cv_prog_cc_works=no
+  echo "$as_me:1232: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
-rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
-  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
-fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:811: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:816: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:1243: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.c <<EOF
-#ifdef __GNUC__
-  yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
-  ac_cv_prog_gcc=yes
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+break
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:1265: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:1268: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:1281: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC="$ac_prog"
+break
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:1303: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  ac_cv_prog_gcc=no
+  echo "$as_me:1306: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=$ac_ct_CC
 fi
+
 fi
+
+test -z "$CC" && { { echo "$as_me:1318: error: no acceptable cc found in \$PATH" >&5
+echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 1323 "configure"
+#include "confdefs.h"
 
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+int
+main ()
+{
 
-if test $ac_cv_prog_gcc = yes; then
-  GCC=yes
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compiler, and finding out an intuition
+# of exeext.
+echo "$as_me:1339: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:1342: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:1345: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `ls a.exe conftest.exe a.* conftest conftest.* 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    a.out ) # We found the default executable, but exeext='' is most
+            # certainly right.
+            break;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+          export ac_cv_exeext
+          break;;
+    * ) break;;
+  esac
+done
 else
-  GCC=
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:1362: error: C compiler cannot create executables" >&5
+echo "$as_me: error: C compiler cannot create executables" >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:1368: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:1373: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:1379: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1382: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:1389: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
 fi
+echo "$as_me:1397: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:1404: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:1406: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:1409: checking for executable suffix" >&5
+echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
+if { (eval echo "$as_me:1411: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:1414: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+          export ac_cv_exeext
+          break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:1430: error: cannot compute EXEEXT: cannot compile and link" >&5
+echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:1436: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:1442: checking for object suffix" >&5
+echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1448 "configure"
+#include "confdefs.h"
 
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:844: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:1460: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1463: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:1475: error: cannot compute OBJEXT: cannot compile" >&5
+echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:1482: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:1486: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1492 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1507: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1510: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1513: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1516: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:1528: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:1534: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1540 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1552: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1555: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1558: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1561: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_prog_cc_g=yes
 else
-  ac_cv_prog_cc_g=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_prog_cc_g=no
 fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+echo "$as_me:1571: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
 if test "$ac_test_CFLAGS" = set; then
-  CFLAGS="$ac_save_CFLAGS"
+  CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
   if test "$GCC" = yes; then
     CFLAGS="-g -O2"
@@ -870,173 +1585,399 @@
     CFLAGS=
   fi
 fi
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1598: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1601: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1604: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1607: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   ''\
+   '#include <stdlib.h>' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1619 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1632: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1635: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1638: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1641: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1651 "configure"
+#include "confdefs.h"
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1663: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1666: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1669: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1672: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+echo '#ifdef __cplusplus' >>confdefs.h
+echo $ac_declaration      >>confdefs.h
+echo '#endif'             >>confdefs.h
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
     if test "$CC" = "gcc" ; then
 	CC="gcc -Wall"
     fi
 fi
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:880: checking how to run the C preprocessor" >&5
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:1705: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-    # This must be in double quotes, not single quotes, because CPP may get
-  # substituted into the Makefile and "${CC-cc}" will confuse make.
-  CPP="${CC-cc} -E"
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp.
-  cat > conftest.$ac_ext <<EOF
-#line 895 "configure"
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      # Use a header file that comes with gcc, so configuring glibc
+# with a fresh cross-compiler works.
+# On the NeXT, cc -E runs the code through the compiler's parser,
+# not just through cpp. "Syntax error" is here to catch this case.
+ac_c_preproc_warn_flag=maybe
+cat >conftest.$ac_ext <<_ACEOF
+#line 1724 "configure"
 #include "confdefs.h"
 #include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:901: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
+Syntax error
+_ACEOF
+if { (eval echo "$as_me:1729: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:1735: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Now check whether non-existent headers can be detected and how
+# Skip if ac_cpp_err is not empty - ac_cpp is broken
+if test -z "$ac_cpp_err"; then
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1750 "configure"
+#include "confdefs.h"
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:1754: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:1760: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # cannot detect missing includes at all
+ac_cpp_err=yes
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP="${CC-cc} -E -traditional-cpp"
-  cat > conftest.$ac_ext <<EOF
-#line 912 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:918: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
+  if test "x$ac_cpp_err" = xmaybe; then
+      ac_c_preproc_warn_flag=yes
+    else
+      ac_c_preproc_warn_flag=
+    fi
+    ac_cpp_err=
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP="${CC-cc} -nologo -E"
-  cat > conftest.$ac_ext <<EOF
-#line 929 "configure"
+
+fi
+rm -f conftest.err conftest.$ac_ext
+      if test -z "$ac_cpp_err"; then
+        break
+      fi
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  # Use a header file that comes with gcc, so configuring glibc
+# with a fresh cross-compiler works.
+# On the NeXT, cc -E runs the code through the compiler's parser,
+# not just through cpp. "Syntax error" is here to catch this case.
+ac_c_preproc_warn_flag=maybe
+cat >conftest.$ac_ext <<_ACEOF
+#line 1806 "configure"
 #include "confdefs.h"
 #include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
+Syntax error
+_ACEOF
+if { (eval echo "$as_me:1811: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:1817: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP=/lib/cpp
+  ac_cpp_err=yes
 fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+  # Now check whether non-existent headers can be detected and how
+# Skip if ac_cpp_err is not empty - ac_cpp is broken
+if test -z "$ac_cpp_err"; then
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1832 "configure"
+#include "confdefs.h"
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:1836: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:1842: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
 fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+  # cannot detect missing includes at all
+ac_cpp_err=yes
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  if test "x$ac_cpp_err" = xmaybe; then
+      ac_c_preproc_warn_flag=yes
+    else
+      ac_c_preproc_warn_flag=
+    fi
+    ac_cpp_err=
 fi
-rm -f conftest*
-  ac_cv_prog_CPP="$CPP"
+rm -f conftest.err conftest.$ac_ext
 fi
-  CPP="$ac_cv_prog_CPP"
 else
-  ac_cv_prog_CPP="$CPP"
-fi
-echo "$ac_t""$CPP" 1>&6
-
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
 
-echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:961: checking for AIX" >&5
-cat > conftest.$ac_ext <<EOF
-#line 963 "configure"
+fi
+rm -f conftest.err conftest.$ac_ext
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:1875: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+if test -n "$ac_cpp_err"; then
+  { { echo "$as_me:1878: error: C preprocessor \"$CPP\" fails sanity check" >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+echo "$as_me:1888: checking for AIX" >&5
+echo $ECHO_N "checking for AIX... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line 1891 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
 #endif
 
-EOF
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "yes" >/dev/null 2>&1; then
-  rm -rf conftest*
-  echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+  echo "$as_me:1900: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+cat >>confdefs.h <<\EOF
 #define _ALL_SOURCE 1
 EOF
 
 else
-  rm -rf conftest*
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:1907: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 rm -f conftest*
 
-
-ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:986: checking for minix/config.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:1912: checking for minix/config.h" >&5
+echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 991 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1918 "configure"
 #include "confdefs.h"
 #include <minix/config.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+_ACEOF
+if { (eval echo "$as_me:1922: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:1928: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_minix_config_h=yes
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  ac_cv_header_minix_config_h=no
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+echo "$as_me:1947: result: $ac_cv_header_minix_config_h" >&5
+echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6
+if test $ac_cv_header_minix_config_h = yes; then
   MINIX=yes
 else
-  echo "$ac_t""no" 1>&6
-MINIX=
+  MINIX=
 fi
 
 if test "$MINIX" = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define _POSIX_SOURCE 1
 EOF
 
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\EOF
 #define _POSIX_1_SOURCE 2
 EOF
 
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\EOF
 #define _MINIX 1
 EOF
 
 fi
 
-echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1034: checking for POSIXized ISC" >&5
+echo "$as_me:1971: checking for POSIXized ISC" >&5
+echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6
 if test -d /etc/conf/kconfig.d &&
-  grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
+   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
-  echo "$ac_t""yes" 1>&6
+  echo "$as_me:1976: result: yes" >&5
+echo "${ECHO_T}yes" >&6
   ISC=yes # If later tests want to check for ISC.
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define _POSIX_SOURCE 1
 EOF
 
@@ -1046,107 +1987,127 @@
     CC="$CC -Xp"
   fi
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:1990: result: no" >&5
+echo "${ECHO_T}no" >&6
   ISC=
 fi
 
-
-
 MKDIR="mkdir -p"
 
 # AC_PROG_GCC_TRADITIONAL
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1060: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:1998: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftestmake <<\EOF
+  cat >conftest.make <<\EOF
 all:
 	@echo 'ac_maketemp="${MAKE}"'
 EOF
 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
 if test -n "$ac_maketemp"; then
   eval ac_cv_prog_make_${ac_make}_set=yes
 else
   eval ac_cv_prog_make_${ac_make}_set=no
 fi
-rm -f conftestmake
+rm -f conftest.make
 fi
 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  echo "$as_me:2018: result: yes" >&5
+echo "${ECHO_T}yes" >&6
   SET_MAKE=
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:2022: result: no" >&5
+echo "${ECHO_T}no" >&6
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
-
 # things get pretty tought, if the dup2() is not available ...
-echo $ac_n "checking for dup2""... $ac_c" 1>&6
-echo "configure:1089: checking for dup2" >&5
-if eval "test \"`echo '$''{'ac_cv_func_dup2'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:2028: checking for dup2" >&5
+echo $ECHO_N "checking for dup2... $ECHO_C" >&6
+if test "${ac_cv_func_dup2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1094 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 2034 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dup2(); below.  */
+    which can conflict with char dup2 (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char dup2();
+   builtin and then its argument prototype would still apply.  */
+char dup2 ();
+char (*f) ();
 
-int main() {
-
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_dup2) || defined (__stub___dup2)
 choke me
 #else
-dup2();
+f = dup2;
 #endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_dup2=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_dup2=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'dup2`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:2065: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:2068: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:2071: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:2074: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_dup2=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_dup2=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:2084: result: $ac_cv_func_dup2" >&5
+echo "${ECHO_T}$ac_cv_func_dup2" >&6
+if test $ac_cv_func_dup2 = yes; then
+  cat >>confdefs.h <<\EOF
 #define HAVE_DUP2 1
 EOF
 
 else
-  echo "$ac_t""no" 1>&6
-{ echo "configure: error: Bizzare -- the system does not have dup2()!  Is your C-compiler working ? (See config.log)" 1>&2; exit 1; }
+  { { echo "$as_me:2092: error: Bizzare -- the system does not have dup2()!  Is your C-compiler working ? (See config.log)" >&5
+echo "$as_me: error: Bizzare -- the system does not have dup2()!  Is your C-compiler working ? (See config.log)" >&2;}
+   { (exit 1); exit 1; }; }
 
 fi
 
-
-
-
 if test "x$prefix" = "xNONE" ; then
-  echo "$ac_t""!!!" 1>&6
-  echo "$ac_t""!!! You did not define  --prefix=DIR  -parameter !!!" 1>&6
-  echo "$ac_t""!!!" 1>&6
-  echo "$ac_t""!!! Define the  --prefix=DIR -parameter to tell the subtree," 1>&6
-  echo "$ac_t""!!! where the ZMailer system is to be installed." 1>&6
-  echo "$ac_t""!!!" 1>&6
+  echo "$as_me:2099: result: !!!" >&5
+echo "${ECHO_T}!!!" >&6
+  echo "$as_me:2101: result: !!! You did not define  --prefix=DIR  -parameter !!!" >&5
+echo "${ECHO_T}!!! You did not define  --prefix=DIR  -parameter !!!" >&6
+  echo "$as_me:2103: result: !!!" >&5
+echo "${ECHO_T}!!!" >&6
+  echo "$as_me:2105: result: !!! Define the  --prefix=DIR -parameter to tell the subtree," >&5
+echo "${ECHO_T}!!! Define the  --prefix=DIR -parameter to tell the subtree," >&6
+  echo "$as_me:2107: result: !!! where the ZMailer system is to be installed." >&5
+echo "${ECHO_T}!!! where the ZMailer system is to be installed." >&6
+  echo "$as_me:2109: result: !!!" >&5
+echo "${ECHO_T}!!!" >&6
   exit 1
 fi
 
@@ -1155,253 +2116,274 @@
 defSCHEDULEROPTIONS='-l ${LOGDIR}/scheduler.perflog -S -H'
 defNNTPSERVER='nntp'
 ac_default_zmconfig="${ZCONFIG-$prefix/zmailer.conf}"
-
 
-echo "$ac_t""***" 1>&6
-echo "$ac_t""*** You can set  ZCONFIG  environment variable to define" 1>&6
-echo "$ac_t""*** the location of the (default) $prefix/zmailer.conf -file" 1>&6
-echo "$ac_t""*** (You can use also   --with-zconfig=  -parameter)" 1>&6
-echo "$ac_t""***" 1>&6
-echo "$ac_t""*** Consider also setting following parameters:" 1>&6
-echo "$ac_t""***   --mandir=DIR     -- for man-pages" 1>&6
-echo "$ac_t""***   --libdir=DIR     -- for libzmailer(3)" 1>&6
-echo "$ac_t""***   --includedir=DIR -- for libzmailer(3)" 1>&6
-echo "$ac_t""*** (They can be outside the --prefix=DIR -tree)" 1>&6
-echo "$ac_t""***" 1>&6
-echo "$ac_t""*** You can also set CC, CFLAGS, and CPPFLAGS  environment variables" 1>&6
-echo "$ac_t""*** to choose the C-compiler, and its options, especially at systems" 1>&6
-echo "$ac_t""*** where there are multiple choices to use ..." 1>&6
-echo "$ac_t""*** (Also doing CPPFLAGS="-I/local/include" may be something you need" 1>&6
-echo "$ac_t""***  to find oddly located headers of some utility libraries.)" 1>&6
-echo "$ac_t""***" 1>&6
+echo "$as_me:2120: result: ***" >&5
+echo "${ECHO_T}***" >&6
+echo "$as_me:2122: result: *** You can set  ZCONFIG  environment variable to define" >&5
+echo "${ECHO_T}*** You can set  ZCONFIG  environment variable to define" >&6
+echo "$as_me:2124: result: *** the location of the (default) $prefix/zmailer.conf -file" >&5
+echo "${ECHO_T}*** the location of the (default) $prefix/zmailer.conf -file" >&6
+echo "$as_me:2126: result: *** (You can use also   --with-zconfig=  -parameter)" >&5
+echo "${ECHO_T}*** (You can use also   --with-zconfig=  -parameter)" >&6
+echo "$as_me:2128: result: ***" >&5
+echo "${ECHO_T}***" >&6
+echo "$as_me:2130: result: *** Consider also setting following parameters:" >&5
+echo "${ECHO_T}*** Consider also setting following parameters:" >&6
+echo "$as_me:2132: result: ***   --mandir=DIR     -- for man-pages" >&5
+echo "${ECHO_T}***   --mandir=DIR     -- for man-pages" >&6
+echo "$as_me:2134: result: ***   --libdir=DIR     -- for libzmailer(3)" >&5
+echo "${ECHO_T}***   --libdir=DIR     -- for libzmailer(3)" >&6
+echo "$as_me:2136: result: ***   --includedir=DIR -- for libzmailer(3)" >&5
+echo "${ECHO_T}***   --includedir=DIR -- for libzmailer(3)" >&6
+echo "$as_me:2138: result: *** (They can be outside the --prefix=DIR -tree)" >&5
+echo "${ECHO_T}*** (They can be outside the --prefix=DIR -tree)" >&6
+echo "$as_me:2140: result: ***" >&5
+echo "${ECHO_T}***" >&6
+echo "$as_me:2142: result: *** You can also set CC, CFLAGS, and CPPFLAGS  environment variables" >&5
+echo "${ECHO_T}*** You can also set CC, CFLAGS, and CPPFLAGS  environment variables" >&6
+echo "$as_me:2144: result: *** to choose the C-compiler, and its options, especially at systems" >&5
+echo "${ECHO_T}*** to choose the C-compiler, and its options, especially at systems" >&6
+echo "$as_me:2146: result: *** where there are multiple choices to use ..." >&5
+echo "${ECHO_T}*** where there are multiple choices to use ..." >&6
+echo "$as_me:2148: result: *** (Also doing CPPFLAGS=\"-I/local/include\" may be something you need" >&5
+echo "${ECHO_T}*** (Also doing CPPFLAGS=\"-I/local/include\" may be something you need" >&6
+echo "$as_me:2150: result: ***  to find oddly located headers of some utility libraries.)" >&5
+echo "${ECHO_T}***  to find oddly located headers of some utility libraries.)" >&6
+echo "$as_me:2152: result: ***" >&5
+echo "${ECHO_T}***" >&6
 
 sleep 3  # delay a bit, then continue..
 
-
 # Extract the first word of "ln", so it can be a program name with args.
 set dummy ln; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1185: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_LN'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:2159: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_LN+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$LN" in
-  /*)
+  case $LN in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_LN="$LN" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_LN="$LN" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_LN="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_LN="$ac_dir/$ac_word"
+   break
+fi
+done
+
   test -z "$ac_cv_path_LN" && ac_cv_path_LN="ln"
   ;;
 esac
 fi
-LN="$ac_cv_path_LN"
+LN=$ac_cv_path_LN
+
 if test -n "$LN"; then
-  echo "$ac_t""$LN" 1>&6
+  echo "$as_me:2187: result: $LN" >&5
+echo "${ECHO_T}$LN" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:2190: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 # Extract the first word of "mv", so it can be a program name with args.
 set dummy mv; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1220: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:2195: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MV+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$MV" in
-  /*)
+  case $MV in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_MV="$MV" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_MV="$MV" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_MV="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_MV="$ac_dir/$ac_word"
+   break
+fi
+done
+
   test -z "$ac_cv_path_MV" && ac_cv_path_MV="mv"
   ;;
 esac
 fi
-MV="$ac_cv_path_MV"
+MV=$ac_cv_path_MV
+
 if test -n "$MV"; then
-  echo "$ac_t""$MV" 1>&6
+  echo "$as_me:2223: result: $MV" >&5
+echo "${ECHO_T}$MV" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:2226: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 # Extract the first word of "rm", so it can be a program name with args.
 set dummy rm; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1255: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:2231: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_RM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$RM" in
-  /*)
+  case $RM in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_RM="$RM" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_RM="$RM" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_RM="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_RM="$ac_dir/$ac_word"
+   break
+fi
+done
+
   test -z "$ac_cv_path_RM" && ac_cv_path_RM="rm"
   ;;
 esac
 fi
-RM="$ac_cv_path_RM"
+RM=$ac_cv_path_RM
+
 if test -n "$RM"; then
-  echo "$ac_t""$RM" 1>&6
+  echo "$as_me:2259: result: $RM" >&5
+echo "${ECHO_T}$RM" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:2262: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 # Extract the first word of "true", so it can be a program name with args.
 set dummy true; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1290: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_TRUE'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:2267: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_TRUE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$TRUE" in
-  /*)
+  case $TRUE in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_TRUE="$TRUE" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_TRUE="$TRUE" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_TRUE="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_TRUE="$ac_dir/$ac_word"
+   break
+fi
+done
+
   test -z "$ac_cv_path_TRUE" && ac_cv_path_TRUE="true"
   ;;
 esac
 fi
-TRUE="$ac_cv_path_TRUE"
+TRUE=$ac_cv_path_TRUE
+
 if test -n "$TRUE"; then
-  echo "$ac_t""$TRUE" 1>&6
+  echo "$as_me:2295: result: $TRUE" >&5
+echo "${ECHO_T}$TRUE" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:2298: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1325: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:2303: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PERL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$PERL" in
-  /*)
+  case $PERL in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_PERL="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_PERL="$ac_dir/$ac_word"
+   break
+fi
+done
+
   test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="perl"
   ;;
 esac
 fi
-PERL="$ac_cv_path_PERL"
+PERL=$ac_cv_path_PERL
+
 if test -n "$PERL"; then
-  echo "$ac_t""$PERL" 1>&6
+  echo "$as_me:2331: result: $PERL" >&5
+echo "${ECHO_T}$PERL" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:2334: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 # Extract the first word of "gzip", so it can be a program name with args.
 set dummy gzip; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1360: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GZIP'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:2339: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GZIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$GZIP" in
-  /*)
+  case $GZIP in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_GZIP="$GZIP" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_GZIP="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_GZIP="$ac_dir/$ac_word"
+   break
+fi
+done
+
   test -z "$ac_cv_path_GZIP" && ac_cv_path_GZIP="gzip"
   ;;
 esac
 fi
-GZIP="$ac_cv_path_GZIP"
+GZIP=$ac_cv_path_GZIP
+
 if test -n "$GZIP"; then
-  echo "$ac_t""$GZIP" 1>&6
+  echo "$as_me:2367: result: $GZIP" >&5
+echo "${ECHO_T}$GZIP" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:2370: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-
 CPPDEP=${CPPDEP-"gcc -MM"}
 
-echo "$ac_t""** Using C compiler: $CC" 1>&6
-echo "$ac_t""** Using CFLAGS:     $CFLAGS" 1>&6
-echo "$ac_t""** Using CPPDEP:     $CPPDEP" 1>&6
+echo "$as_me:2376: result: ** Using C compiler: $CC" >&5
+echo "${ECHO_T}** Using C compiler: $CC" >&6
+echo "$as_me:2378: result: ** Using CFLAGS:     $CFLAGS" >&5
+echo "${ECHO_T}** Using CFLAGS:     $CFLAGS" >&6
+echo "$as_me:2380: result: ** Using CPPDEP:     $CPPDEP" >&5
+echo "${ECHO_T}** Using CPPDEP:     $CPPDEP" >&6
 
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<EOF
 #define CONFIGURE_CMD "CC='$CC' CFLAGS='$CFLAGS' $0 $ac_configure_args"
 EOF
 
-
-
 ac_aux_dir=
 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
   if test -f $ac_dir/install-sh; then
@@ -1412,14 +2394,20 @@
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install.sh -c"
     break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+  { { echo "$as_me:2404: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -1428,31 +2416,39 @@
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1437: checking for a BSD compatible install" >&5
+echo "$as_me:2424: checking for a BSD compatible install" >&5
+echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
 if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
+    ac_save_IFS=$IFS; IFS=$ac_path_separator
   for ac_dir in $PATH; do
+    IFS=$ac_save_IFS
     # Account for people who put trailing slashes in PATH elements.
-    case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    case $ac_dir/ in
+    / | ./ | .// | /cC/* \
+    | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
+    | /usr/ucb/* ) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
       # Don't use installbsd from OSF since it installs stuff as root
       # by default.
       for ac_prog in ginstall scoinst install; do
-        if test -f $ac_dir/$ac_prog; then
+        if $as_executable_p "$ac_dir/$ac_prog"; then
 	  if test $ac_prog = install &&
-            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+            grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
 	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
 	  else
 	    ac_cv_path_install="$ac_dir/$ac_prog -c"
 	    break 2
@@ -1462,349 +2458,448 @@
       ;;
     esac
   done
-  IFS="$ac_save_IFS"
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
-    INSTALL="$ac_cv_path_install"
+    INSTALL=$ac_cv_path_install
   else
     # As a last resort, use the slow shell script.  We don't cache a
     # path for INSTALL within a source directory, because that will
     # break other packages using the cache if that directory is
     # removed, or if the path is relative.
-    INSTALL="$ac_install_sh"
+    INSTALL=$ac_install_sh
   fi
 fi
-echo "$ac_t""$INSTALL" 1>&6
+echo "$as_me:2473: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-# Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1492: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:2487: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_RANLIB="ranlib"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+break
+done
+
 fi
 fi
-RANLIB="$ac_cv_prog_RANLIB"
+RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  echo "$ac_t""$RANLIB" 1>&6
+  echo "$as_me:2509: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:2512: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:2521: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_RANLIB="ranlib"
+break
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:2544: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:2547: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
 # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1522: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:2558: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$AR" in
-  /*)
+  case $AR in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_AR="$AR" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_AR="$AR" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_AR="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_AR="$ac_dir/$ac_word"
+   break
+fi
+done
+
   test -z "$ac_cv_path_AR" && ac_cv_path_AR="ar"
   ;;
 esac
 fi
-AR="$ac_cv_path_AR"
+AR=$ac_cv_path_AR
+
 if test -n "$AR"; then
-  echo "$ac_t""$AR" 1>&6
+  echo "$as_me:2586: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:2589: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 # Extract the first word of "ld", so it can be a program name with args.
 set dummy ld; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1557: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:2594: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$LD" in
-  /*)
+  case $LD in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_LD="$LD" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_LD="$LD" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_LD="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_LD="$ac_dir/$ac_word"
+   break
+fi
+done
+
   test -z "$ac_cv_path_LD" && ac_cv_path_LD="ld"
   ;;
 esac
 fi
-LD="$ac_cv_path_LD"
+LD=$ac_cv_path_LD
+
 if test -n "$LD"; then
-  echo "$ac_t""$LD" 1>&6
+  echo "$as_me:2622: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:2625: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 for ac_prog in 'bison -y' byacc
 do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1594: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:2632: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_YACC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_YACC="$ac_prog"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_YACC="$ac_prog"
+break
+done
+
 fi
 fi
-YACC="$ac_cv_prog_YACC"
+YACC=$ac_cv_prog_YACC
 if test -n "$YACC"; then
-  echo "$ac_t""$YACC" 1>&6
+  echo "$as_me:2654: result: $YACC" >&5
+echo "${ECHO_T}$YACC" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:2657: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-test -n "$YACC" && break
+  test -n "$YACC" && break
 done
 test -n "$YACC" || YACC="yacc"
 
-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1625: checking whether ln -s works" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  rm -f conftestdata
-if ln -s X conftestdata 2>/dev/null
-then
-  rm -f conftestdata
-  ac_cv_prog_LN_S="ln -s"
-else
-  ac_cv_prog_LN_S=ln
-fi
-fi
-LN_S="$ac_cv_prog_LN_S"
-if test "$ac_cv_prog_LN_S" = "ln -s"; then
-  echo "$ac_t""yes" 1>&6
+echo "$as_me:2665: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  echo "$as_me:2669: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me:2672: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:2676: checking whether sys/types.h defines makedev" >&5
+echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6
+if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$ac_t""no" 1>&6
-fi
-
-echo $ac_n "checking whether sys/types.h defines makedev""... $ac_c" 1>&6
-echo "configure:1646: checking whether sys/types.h defines makedev" >&5
-if eval "test \"`echo '$''{'ac_cv_header_sys_types_h_makedev'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1651 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 2682 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-int main() {
+
+int
+main ()
+{
 return makedev(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:1658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:2695: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:2698: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:2701: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:2704: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_header_sys_types_h_makedev=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_sys_types_h_makedev=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_header_sys_types_h_makedev=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 
 fi
-
-echo "$ac_t""$ac_cv_header_sys_types_h_makedev" 1>&6
+echo "$as_me:2715: result: $ac_cv_header_sys_types_h_makedev" >&5
+echo "${ECHO_T}$ac_cv_header_sys_types_h_makedev" >&6
 
 if test $ac_cv_header_sys_types_h_makedev = no; then
-ac_safe=`echo "sys/mkdev.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for sys/mkdev.h""... $ac_c" 1>&6
-echo "configure:1676: checking for sys/mkdev.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:2719: checking for sys/mkdev.h" >&5
+echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_mkdev_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1681 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 2725 "configure"
 #include "confdefs.h"
 #include <sys/mkdev.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+_ACEOF
+if { (eval echo "$as_me:2729: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:2735: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_sys_mkdev_h=yes
+else
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  ac_cv_header_sys_mkdev_h=no
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
+echo "$as_me:2754: result: $ac_cv_header_sys_mkdev_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6
+if test $ac_cv_header_sys_mkdev_h = yes; then
+
+cat >>confdefs.h <<\EOF
 #define MAJOR_IN_MKDEV 1
 EOF
 
-else
-  echo "$ac_t""no" 1>&6
 fi
 
-
   if test $ac_cv_header_sys_mkdev_h = no; then
-ac_safe=`echo "sys/sysmacros.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for sys/sysmacros.h""... $ac_c" 1>&6
-echo "configure:1714: checking for sys/sysmacros.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    echo "$as_me:2765: checking for sys/sysmacros.h" >&5
+echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1719 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 2771 "configure"
 #include "confdefs.h"
 #include <sys/sysmacros.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+_ACEOF
+if { (eval echo "$as_me:2775: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:2781: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_sys_sysmacros_h=yes
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  ac_cv_header_sys_sysmacros_h=no
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
+echo "$as_me:2800: result: $ac_cv_header_sys_sysmacros_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6
+if test $ac_cv_header_sys_sysmacros_h = yes; then
+
+cat >>confdefs.h <<\EOF
 #define MAJOR_IN_SYSMACROS 1
 EOF
 
-else
-  echo "$ac_t""no" 1>&6
 fi
 
   fi
 fi
-
 
-echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:1753: checking whether byte ordering is bigendian" >&5
-if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:2813: checking whether byte ordering is bigendian" >&5
+echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
+if test "${ac_cv_c_bigendian+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
-cat > conftest.$ac_ext <<EOF
-#line 1760 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 2821 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
-int main() {
 
+int
+main ()
+{
 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
  bogus endian macros
 #endif
-; return 0; }
-EOF
-if { (eval echo configure:1771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2838: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:2841: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:2844: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:2847: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   # It does; now see whether it defined to BIG_ENDIAN or not.
-cat > conftest.$ac_ext <<EOF
-#line 1775 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 2851 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
-int main() {
 
+int
+main ()
+{
 #if BYTE_ORDER != BIG_ENDIAN
  not big endian
 #endif
-; return 0; }
-EOF
-if { (eval echo configure:1786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2868: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:2871: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:2874: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:2877: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_c_bigendian=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_c_bigendian=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_c_bigendian=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 if test $ac_cv_c_bigendian = unknown; then
 if test "$cross_compiling" = yes; then
-    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+  { { echo "$as_me:2893: error: cannot run test program while cross compiling" >&5
+echo "$as_me: error: cannot run test program while cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1806 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 2898 "configure"
 #include "confdefs.h"
-main () {
+int
+main ()
+{
   /* Are we little or big endian?  From Harbison&Steele.  */
   union
   {
@@ -1814,275 +2909,1560 @@
   u.l = 1;
   exit (u.c[sizeof (long) - 1] == 1);
 }
-EOF
-if { (eval echo configure:1819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:2914: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:2917: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:2919: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:2922: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_c_bigendian=no
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_c_bigendian=yes
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_c_bigendian=yes
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
 fi
 fi
-
-echo "$ac_t""$ac_cv_c_bigendian" 1>&6
+echo "$as_me:2935: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6
 if test $ac_cv_c_bigendian = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define WORDS_BIGENDIAN 1
 EOF
 
 fi
+
+echo "$as_me:2945: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line 2953 "configure"
+#include "confdefs.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3002: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3005: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3008: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3011: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:3028: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:3031: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
 
-echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1843: checking for inline" >&5
-if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:3036: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
-  cat > conftest.$ac_ext <<EOF
-#line 1850 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3044 "configure"
 #include "confdefs.h"
-
-int main() {
-} $ac_kw foo() {
-; return 0; }
-EOF
-if { (eval echo configure:1857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+#ifndef __cplusplus
+static $ac_kw int static_foo () {return 0; }
+$ac_kw int foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3053: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3056: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3059: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3062: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_c_inline=$ac_kw; break
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-
-echo "$ac_t""$ac_cv_c_inline" 1>&6
-case "$ac_cv_c_inline" in
+echo "$as_me:3073: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
+case $ac_cv_c_inline in
   inline | yes) ;;
-  no) cat >> confdefs.h <<\EOF
-#define inline 
+  no)
+cat >>confdefs.h <<\EOF
+#define inline
 EOF
  ;;
-  *)  cat >> confdefs.h <<EOF
+  *)  cat >>confdefs.h <<EOF
 #define inline $ac_cv_c_inline
 EOF
  ;;
 esac
 
-echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:1883: checking size of void *" >&5
-if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:3088: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3094 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+_ACEOF
+if { (eval echo "$as_me:3102: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:3108: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3130 "configure"
+#include "confdefs.h"
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3148 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
   if test "$cross_compiling" = yes; then
-    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+  :
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1891 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3169 "configure"
 #include "confdefs.h"
-#include <stdio.h>
-main()
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+                     || ('j' <= (c) && (c) <= 'r') \
+                     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
 {
-  FILE *f=fopen("conftestval", "w");
-  if (!f) exit(1);
-  fprintf(f, "%d\n", sizeof(void *));
-  exit(0);
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+        || toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
 }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:3195: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:3198: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:3200: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3203: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_header_stdc=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:3216: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\EOF
+#define STDC_HEADERS 1
 EOF
-if { (eval echo configure:1902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  ac_cv_sizeof_void_p=`cat conftestval`
+
+fi
+
+for ac_header in stdlib.h string.h memory.h strings.h inttypes.h unistd.h
+do
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:3229: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3235 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:3239: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:3245: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  echo "configure: failed program was:" >&5
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_sizeof_void_p=0
+  eval "$ac_ac_Header=no"
 fi
-rm -fr conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
+echo "$as_me:3264: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
+EOF
+
+fi
+done
 
+echo "$as_me:3274: checking for void *" >&5
+echo $ECHO_N "checking for void *... $ECHO_C" >&6
+if test "${ac_cv_type_void_p+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3280 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+if ((void * *) 0)
+  return 0;
+if (sizeof (void *))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3295: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3298: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3301: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3304: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_void_p=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_void_p=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:3314: result: $ac_cv_type_void_p" >&5
+echo "${ECHO_T}$ac_cv_type_void_p" >&6
+
+echo "$as_me:3317: checking size of void *" >&5
+echo $ECHO_N "checking size of void *... $ECHO_C" >&6
+if test "${ac_cv_sizeof_void_p+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$ac_cv_type_void_p" = yes; then
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+#line 3326 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (void *)) >= 0)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3338: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3341: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3344: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3347: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+#line 3352 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (void *)) <= $ac_mid)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3364: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3367: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3370: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3373: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+#line 3389 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (void *)) >= $ac_mid)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3401: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3404: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3407: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3410: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  done
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3426 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (void *)) <= $ac_mid)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3438: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3441: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3444: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3447: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_lo=`expr $ac_mid + 1`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+ac_cv_sizeof_void_p=$ac_lo
+else
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:3460: error: cannot run test program while cross compiling" >&5
+echo "$as_me: error: cannot run test program while cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3465 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+FILE *f = fopen ("conftest.val", "w");
+if (!f)
+  exit (1);
+fprintf (f, "%d", (sizeof (void *)));
+fclose (f);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:3481: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:3484: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:3486: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3489: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_void_p=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+else
+  ac_cv_sizeof_void_p=0
+fi
 fi
-echo "$ac_t""$ac_cv_sizeof_void_p" 1>&6
-cat >> confdefs.h <<EOF
+echo "$as_me:3505: result: $ac_cv_sizeof_void_p" >&5
+echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6
+cat >>confdefs.h <<EOF
 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
 EOF
 
-
-echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1922: checking size of short" >&5
-if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:3511: checking for short" >&5
+echo $ECHO_N "checking for short... $ECHO_C" >&6
+if test "${ac_cv_type_short+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3517 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+if ((short *) 0)
+  return 0;
+if (sizeof (short))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3532: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3535: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3538: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3541: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_short=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_short=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:3551: result: $ac_cv_type_short" >&5
+echo "${ECHO_T}$ac_cv_type_short" >&6
+
+echo "$as_me:3554: checking size of short" >&5
+echo $ECHO_N "checking size of short... $ECHO_C" >&6
+if test "${ac_cv_sizeof_short+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
+  if test "$ac_cv_type_short" = yes; then
   if test "$cross_compiling" = yes; then
-    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+#line 3563 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (short)) >= 0)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3575: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3578: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3581: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3584: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+#line 3589 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (short)) <= $ac_mid)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3601: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3604: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3607: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3610: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1930 "configure"
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+#line 3626 "configure"
 #include "confdefs.h"
-#include <stdio.h>
-main()
+$ac_includes_default
+int
+main ()
 {
-  FILE *f=fopen("conftestval", "w");
-  if (!f) exit(1);
-  fprintf(f, "%d\n", sizeof(short));
-  exit(0);
+int _array_ [1 - 2 * !((sizeof (short)) >= $ac_mid)]
+  ;
+  return 0;
 }
-EOF
-if { (eval echo configure:1941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  ac_cv_sizeof_short=`cat conftestval`
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3638: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3641: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3644: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3647: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  done
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3663 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (short)) <= $ac_mid)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3675: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3678: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3681: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3684: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_lo=`expr $ac_mid + 1`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+ac_cv_sizeof_short=$ac_lo
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_sizeof_short=0
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:3697: error: cannot run test program while cross compiling" >&5
+echo "$as_me: error: cannot run test program while cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3702 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+FILE *f = fopen ("conftest.val", "w");
+if (!f)
+  exit (1);
+fprintf (f, "%d", (sizeof (short)));
+fclose (f);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:3718: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:3721: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:3723: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3726: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_short=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
+fi
+rm -f conftest.val
+else
+  ac_cv_sizeof_short=0
 fi
-echo "$ac_t""$ac_cv_sizeof_short" 1>&6
-cat >> confdefs.h <<EOF
+fi
+echo "$as_me:3742: result: $ac_cv_sizeof_short" >&5
+echo "${ECHO_T}$ac_cv_sizeof_short" >&6
+cat >>confdefs.h <<EOF
 #define SIZEOF_SHORT $ac_cv_sizeof_short
 EOF
-
 
-echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1961: checking size of int" >&5
-if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:3748: checking for int" >&5
+echo $ECHO_N "checking for int... $ECHO_C" >&6
+if test "${ac_cv_type_int+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3754 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+if ((int *) 0)
+  return 0;
+if (sizeof (int))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3769: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3772: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3775: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3778: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_int=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_int=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:3788: result: $ac_cv_type_int" >&5
+echo "${ECHO_T}$ac_cv_type_int" >&6
+
+echo "$as_me:3791: checking size of int" >&5
+echo $ECHO_N "checking size of int... $ECHO_C" >&6
+if test "${ac_cv_sizeof_int+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$ac_cv_type_int" = yes; then
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+#line 3800 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (int)) >= 0)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3812: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3815: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3818: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3821: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+#line 3826 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (int)) <= $ac_mid)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3838: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3841: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3844: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3847: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  done
 else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+#line 3863 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (int)) >= $ac_mid)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3875: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3878: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3881: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3884: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  done
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3900 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (int)) <= $ac_mid)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3912: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3915: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3918: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3921: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_lo=`expr $ac_mid + 1`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+ac_cv_sizeof_int=$ac_lo
+else
   if test "$cross_compiling" = yes; then
-    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+  { { echo "$as_me:3934: error: cannot run test program while cross compiling" >&5
+echo "$as_me: error: cannot run test program while cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1969 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3939 "configure"
 #include "confdefs.h"
-#include <stdio.h>
-main()
+$ac_includes_default
+int
+main ()
 {
-  FILE *f=fopen("conftestval", "w");
-  if (!f) exit(1);
-  fprintf(f, "%d\n", sizeof(int));
-  exit(0);
+FILE *f = fopen ("conftest.val", "w");
+if (!f)
+  exit (1);
+fprintf (f, "%d", (sizeof (int)));
+fclose (f);
+  ;
+  return 0;
 }
-EOF
-if { (eval echo configure:1980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  ac_cv_sizeof_int=`cat conftestval`
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:3955: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:3958: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:3960: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3963: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_int=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
   ac_cv_sizeof_int=0
 fi
-rm -fr conftest*
 fi
+echo "$as_me:3979: result: $ac_cv_sizeof_int" >&5
+echo "${ECHO_T}$ac_cv_sizeof_int" >&6
+cat >>confdefs.h <<EOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+EOF
 
+echo "$as_me:3985: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6
+if test "${ac_cv_type_long+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3991 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+if ((long *) 0)
+  return 0;
+if (sizeof (long))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4006: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4009: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4012: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4015: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_long=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_long=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:4025: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6
+
+echo "$as_me:4028: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6
+if test "${ac_cv_sizeof_long+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$ac_cv_type_long" = yes; then
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+#line 4037 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (long)) >= 0)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4049: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4052: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4055: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4058: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+#line 4063 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (long)) <= $ac_mid)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4075: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4078: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4081: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4084: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+#line 4100 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (long)) >= $ac_mid)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4112: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4115: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4118: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4121: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  done
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4137 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (long)) <= $ac_mid)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4149: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4152: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4155: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4158: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_lo=`expr $ac_mid + 1`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+ac_cv_sizeof_long=$ac_lo
+else
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:4171: error: cannot run test program while cross compiling" >&5
+echo "$as_me: error: cannot run test program while cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4176 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+FILE *f = fopen ("conftest.val", "w");
+if (!f)
+  exit (1);
+fprintf (f, "%d", (sizeof (long)));
+fclose (f);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:4192: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:4195: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:4197: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4200: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_long=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+else
+  ac_cv_sizeof_long=0
+fi
 fi
-echo "$ac_t""$ac_cv_sizeof_int" 1>&6
-cat >> confdefs.h <<EOF
-#define SIZEOF_INT $ac_cv_sizeof_int
+echo "$as_me:4216: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6
+cat >>confdefs.h <<EOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
 EOF
 
-
-echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:2000: checking size of long" >&5
-if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:4222: checking for double" >&5
+echo $ECHO_N "checking for double... $ECHO_C" >&6
+if test "${ac_cv_type_double+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$cross_compiling" = yes; then
-    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4228 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+if ((double *) 0)
+  return 0;
+if (sizeof (double))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4243: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4246: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4249: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4252: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_double=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_double=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:4262: result: $ac_cv_type_double" >&5
+echo "${ECHO_T}$ac_cv_type_double" >&6
+
+echo "$as_me:4265: checking size of double" >&5
+echo $ECHO_N "checking size of double... $ECHO_C" >&6
+if test "${ac_cv_sizeof_double+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2008 "configure"
+  if test "$ac_cv_type_double" = yes; then
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+#line 4274 "configure"
 #include "confdefs.h"
-#include <stdio.h>
-main()
+$ac_includes_default
+int
+main ()
 {
-  FILE *f=fopen("conftestval", "w");
-  if (!f) exit(1);
-  fprintf(f, "%d\n", sizeof(long));
-  exit(0);
+int _array_ [1 - 2 * !((sizeof (double)) >= 0)]
+  ;
+  return 0;
 }
-EOF
-if { (eval echo configure:2019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  ac_cv_sizeof_long=`cat conftestval`
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4286: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4289: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4292: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4295: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+#line 4300 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (double)) <= $ac_mid)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4312: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4315: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4318: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4321: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_sizeof_long=0
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+#line 4337 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (double)) >= $ac_mid)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4349: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4352: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4355: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4358: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -fr conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+  done
 fi
-
+rm -f conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4374 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+int _array_ [1 - 2 * !((sizeof (double)) <= $ac_mid)]
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4386: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4389: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4392: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4395: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_lo=`expr $ac_mid + 1`
 fi
-echo "$ac_t""$ac_cv_sizeof_long" 1>&6
-cat >> confdefs.h <<EOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
-EOF
-
-
-echo $ac_n "checking size of double""... $ac_c" 1>&6
-echo "configure:2039: checking size of double" >&5
-if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+ac_cv_sizeof_double=$ac_lo
 else
   if test "$cross_compiling" = yes; then
-    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+  { { echo "$as_me:4408: error: cannot run test program while cross compiling" >&5
+echo "$as_me: error: cannot run test program while cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2047 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4413 "configure"
 #include "confdefs.h"
-#include <stdio.h>
-main()
+$ac_includes_default
+int
+main ()
 {
-  FILE *f=fopen("conftestval", "w");
-  if (!f) exit(1);
-  fprintf(f, "%d\n", sizeof(double));
-  exit(0);
+FILE *f = fopen ("conftest.val", "w");
+if (!f)
+  exit (1);
+fprintf (f, "%d", (sizeof (double)));
+fclose (f);
+  ;
+  return 0;
 }
-EOF
-if { (eval echo configure:2058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  ac_cv_sizeof_double=`cat conftestval`
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:4429: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:4432: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:4434: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4437: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_double=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
   ac_cv_sizeof_double=0
 fi
-rm -fr conftest*
-fi
-
 fi
-echo "$ac_t""$ac_cv_sizeof_double" 1>&6
-cat >> confdefs.h <<EOF
+echo "$as_me:4453: result: $ac_cv_sizeof_double" >&5
+echo "${ECHO_T}$ac_cv_sizeof_double" >&6
+cat >>confdefs.h <<EOF
 #define SIZEOF_DOUBLE $ac_cv_sizeof_double
 EOF
 
-
-
-
 # Check whether --with-generic-include or --without-generic-include was given.
 if test "${with_generic_include+set}" = set; then
   withval="$with_generic_include"
   use_genincl=1
 else
   use_genincl=0
-fi
-
+fi;
 if test "$use_genincl" = 1; then
   GENINCL="$withval"
   CPPFLAGS="$CPPFLAGS $withval"
@@ -2094,22 +4474,26 @@
   use_genlib=1
 else
   use_genlib=0
-fi
-
+fi;
 if test "$use_genlib" = 1; then
   GENLIB="$withval"
   LIBS="$LIBS $GENLIB"
 fi
 
-
-
 use_zcfg=0
+
 # Check whether --with-zconfig or --without-zconfig was given.
 if test "${with_zconfig+set}" = set; then
   withval="$with_zconfig"
   use_zcfg=1
-fi
+fi;
+load_zcfg=1
 
+# Check whether --with-zconfig-noload or --without-zconfig-noload was given.
+if test "${with_zconfig_noload+set}" = set; then
+  withval="$with_zconfig_noload"
+  load_zcfg=0
+fi;
 if test "$use_zcfg" = "0" ; then
 	ZMAILERCFGFILE="${ZMAILERCFGFILE-$ac_default_zmconfig}"
 	use_zcfg=1
@@ -2122,22 +4506,23 @@
 	ZMAILERCFGFILE="${ZMAILERCFGFILE-$ac_default_zmconfig}"
     fi
 fi
-echo "$ac_t""Using ZMailer parametrization file path: $ZMAILERCFGFILE" 1>&6
+echo "$as_me:4509: result: Using ZMailer parametrization file path: $ZMAILERCFGFILE" >&5
+echo "${ECHO_T}Using ZMailer parametrization file path: $ZMAILERCFGFILE" >&6
 
-if test -r $ZMAILERCFGFILE -a "$use_zcfg" != "0" ; then
+if test -r $ZMAILERCFGFILE -a "$load_zcfg" != "0" ; then
   # Source the previous configuration values for various environment parameters
   . $ZMAILERCFGFILE
-  echo "$ac_t""   The file exists, we use its values as defaults" 1>&6
+  echo "$as_me:4515: result:    The file exists, we use its values as defaults" >&5
+echo "${ECHO_T}   The file exists, we use its values as defaults" >&6
 fi
 
-
 use_mailbox=0
+
 # Check whether --with-mailbox or --without-mailbox was given.
 if test "${with_mailbox+set}" = set; then
   withval="$with_mailbox"
   use_mailbox=1
-fi
-
+fi;
 if test "$use_mailbox" = 0 ; then
     # No explicite value given, make some guesses as to where it might be..
     for DEFMAILBOX in /var/mail /var/spool/mail /usr/mail /usr/spool/mail x
@@ -2159,16 +4544,16 @@
 else
     MAILBOX="$withval"
 fi
-echo "$ac_t""Using ZMailer MAILBOX directory path: $MAILBOX" 1>&6
-
+echo "$as_me:4547: result: Using ZMailer MAILBOX directory path: $MAILBOX" >&5
+echo "${ECHO_T}Using ZMailer MAILBOX directory path: $MAILBOX" >&6
 
 use_postoffice=0
+
 # Check whether --with-postoffice or --without-postoffice was given.
 if test "${with_postoffice+set}" = set; then
   withval="$with_postoffice"
   use_postoffice=1
-fi
-
+fi;
 if test "$use_postoffice" = 0 ; then
     # No explicite value given, make some guesses as to where it might be..
     # XX: Should see what the MAILBOX value is, and then default between
@@ -2183,77 +4568,76 @@
 else
     POSTOFFICE="$withval"
 fi
-echo "$ac_t""Using ZMailer POSTOFFICE path: $POSTOFFICE" 1>&6
-
+echo "$as_me:4571: result: Using ZMailer POSTOFFICE path: $POSTOFFICE" >&5
+echo "${ECHO_T}Using ZMailer POSTOFFICE path: $POSTOFFICE" >&6
 
-
 use_mailshare=0
+
 # Check whether --with-mailshare or --without-mailshare was given.
 if test "${with_mailshare+set}" = set; then
   withval="$with_mailshare"
   use_mailshare=1
-fi
-
+fi;
 if test "$use_mailshare" = 0 ; then
     eval MAILSHARE="${MAILSHARE-$prefix}"
 else
     MAILSHARE="$withval"
 fi
-echo "$ac_t""Using ZMailer MAILSHARE directory path: $MAILSHARE" 1>&6
+echo "$as_me:4586: result: Using ZMailer MAILSHARE directory path: $MAILSHARE" >&5
+echo "${ECHO_T}Using ZMailer MAILSHARE directory path: $MAILSHARE" >&6
 
-
 use_mailvar=0
+
 # Check whether --with-mailvar or --without-mailvar was given.
 if test "${with_mailvar+set}" = set; then
   withval="$with_mailvar"
   use_mailvar=1
-fi
-
+fi;
 if test "$use_mailvar" = 0 ; then
     eval MAILVAR="${MAILVAR-$prefix}"
 else
     MAILVAR="$withval"
 fi
-echo "$ac_t""Using ZMailer MAILVAR directory path: $MAILVAR" 1>&6
+echo "$as_me:4601: result: Using ZMailer MAILVAR directory path: $MAILVAR" >&5
+echo "${ECHO_T}Using ZMailer MAILVAR directory path: $MAILVAR" >&6
 
-
 use_mailbin=0
+
 # Check whether --with-mailbin or --without-mailbin was given.
 if test "${with_mailbin+set}" = set; then
   withval="$with_mailbin"
   use_mailbin=1
-fi
-
+fi;
 if test "$use_mailbin" = 0 ; then
     eval MAILBIN="${MAILBIN-${MAILSHARE}/bin}"
 else
     MAILBIN="$withval"
 fi
-echo "$ac_t""Using ZMailer MAILBIN directory path: $MAILBIN" 1>&6
+echo "$as_me:4616: result: Using ZMailer MAILBIN directory path: $MAILBIN" >&5
+echo "${ECHO_T}Using ZMailer MAILBIN directory path: $MAILBIN" >&6
 
-
 use_logdir=0
+
 # Check whether --with-logdir or --without-logdir was given.
 if test "${with_logdir+set}" = set; then
   withval="$with_logdir"
   use_logdir=1
-fi
-
+fi;
 if test "$use_logdir" = 0; then
     LOGDIR=${LOGDIR-/var/log/mail}
 else
     LOGDIR="$withval"
 fi
-echo "$ac_t""Using ZMailer LOGDIR directory path: $LOGDIR" 1>&6
+echo "$as_me:4631: result: Using ZMailer LOGDIR directory path: $LOGDIR" >&5
+echo "${ECHO_T}Using ZMailer LOGDIR directory path: $LOGDIR" >&6
 
-
 use_routeuser=0
+
 # Check whether --with-routeuser-is-abnormal or --without-routeuser-is-abnormal was given.
 if test "${with_routeuser_is_abnormal+set}" = set; then
   withval="$with_routeuser_is_abnormal"
   use_routeuser=1
-fi
-
+fi;
 if test "$use_routeuser" = 0; then
     # When not defined, ASSUME ABNORMAL UNIX, unless  ZCONFIG file
     # was read in, and it had some value for this..
@@ -2265,86 +4649,88 @@
 else
     ROUTEUSER_IN_ABNORMAL_UNIX=abnormal
 fi
-echo "$ac_t""Using ZMailer ROUTEUSER_IN_ABNORMAL_UNIX value: '$ROUTEUSER_IN_ABNORMAL_UNIX'" 1>&6
+echo "$as_me:4652: result: Using ZMailer ROUTEUSER_IN_ABNORMAL_UNIX value: '$ROUTEUSER_IN_ABNORMAL_UNIX'" >&5
+echo "${ECHO_T}Using ZMailer ROUTEUSER_IN_ABNORMAL_UNIX value: '$ROUTEUSER_IN_ABNORMAL_UNIX'" >&6
 
-
-
-
 use_nntpserver=0
+
 # Check whether --with-nntpserver or --without-nntpserver was given.
 if test "${with_nntpserver+set}" = set; then
   withval="$with_nntpserver"
   use_nntpserver=1
-fi
-
+fi;
 if test "$use_nntpserver" = 0; then
     NNTPSERVER="${NNTPSERVER-$defNNTPSERVER}"
 else
     NNTPSERVER="$withval"
 fi
-echo "$ac_t""Using ZMailer NNTPSERVER host name: $NNTPSERVER" 1>&6
+echo "$as_me:4667: result: Using ZMailer NNTPSERVER host name: $NNTPSERVER" >&5
+echo "${ECHO_T}Using ZMailer NNTPSERVER host name: $NNTPSERVER" >&6
 
 if test "x$INEWSBIN" = "x" ; then
   # Extract the first word of "inews", so it can be a program name with args.
 set dummy inews; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2292: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_INEWS'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:4673: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_INEWS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$INEWS" in
-  /*)
+  case $INEWS in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_INEWS="$INEWS" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_INEWS="$INEWS" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_INEWS="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_INEWS="$ac_dir/$ac_word"
+   break
+fi
+done
+
   test -z "$ac_cv_path_INEWS" && ac_cv_path_INEWS="inews"
   ;;
 esac
 fi
-INEWS="$ac_cv_path_INEWS"
+INEWS=$ac_cv_path_INEWS
+
 if test -n "$INEWS"; then
-  echo "$ac_t""$INEWS" 1>&6
+  echo "$as_me:4701: result: $INEWS" >&5
+echo "${ECHO_T}$INEWS" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:4704: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
 else
-  
+
   INEWS="$INEWSBIN"
 fi
-echo "$ac_t""Using ZMailer INEWS program path: $INEWS" 1>&6
+echo "$as_me:4712: result: Using ZMailer INEWS program path: $INEWS" >&5
+echo "${ECHO_T}Using ZMailer INEWS program path: $INEWS" >&6
 
-
 SCHEDULEROPTIONS="${SCHEDULEROPTIONS-$defSCHEDULEROPTIONS}"
-echo "$ac_t""Using ZMailer SCHEDULEROPTIONS='$SCHEDULEROPTIONS'" 1>&6
+echo "$as_me:4716: result: Using ZMailer SCHEDULEROPTIONS='$SCHEDULEROPTIONS'" >&5
+echo "${ECHO_T}Using ZMailer SCHEDULEROPTIONS='$SCHEDULEROPTIONS'" >&6
 
 ROUTEROPTIONS="${ROUTEROPTIONS-$defROUTEROPTIONS}"
-echo "$ac_t""Using ZMailer ROUTEROPTIONS='$ROUTEROPTIONS'" 1>&6
+echo "$as_me:4720: result: Using ZMailer ROUTEROPTIONS='$ROUTEROPTIONS'" >&5
+echo "${ECHO_T}Using ZMailer ROUTEROPTIONS='$ROUTEROPTIONS'" >&6
 
 SMTPOPTIONS="${SMTPOPTIONS-$defSMTPOPTIONS}"
-echo "$ac_t""Using ZMailer SMTPOPTIONS='$SMTPOPTIONS'" 1>&6
-
+echo "$as_me:4724: result: Using ZMailer SMTPOPTIONS='$SMTPOPTIONS'" >&5
+echo "${ECHO_T}Using ZMailer SMTPOPTIONS='$SMTPOPTIONS'" >&6
 
 use_sendmailpath=0
+
 # Check whether --with-sendmailpath or --without-sendmailpath was given.
 if test "${with_sendmailpath+set}" = set; then
   withval="$with_sendmailpath"
   use_sendmailpath=1
-fi
-
+fi;
 if test "$use_sendmailpath" = 0 ; then
   # Ok, no value given, make some guesses; /usr/sbin ??
   for SENDMAILDEF in /usr/sbin/sendmail /usr/lib/sendmail x ; do
@@ -2369,17 +4755,18 @@
         SENDMAILPATH="$withval"
     fi
 fi
-echo "$ac_t""Using ZMailer SENDMAILPATH: $SENDMAILPATH" 1>&6
+echo "$as_me:4758: result: Using ZMailer SENDMAILPATH: $SENDMAILPATH" >&5
+echo "${ECHO_T}Using ZMailer SENDMAILPATH: $SENDMAILPATH" >&6
 
 oldRMAILPATH="$RMAILPATH"
 
 use_rmailpath=0
+
 # Check whether --with-rmailpath or --without-rmailpath was given.
 if test "${with_rmailpath+set}" = set; then
   withval="$with_rmailpath"
   use_rmailpath=1
-fi
-
+fi;
 if test "$use_rmailpath" = 0 ; then
   # Ok, no value given, make some guesses; /usr/bin ?? (last is default)
   for RMAILDEF in /sbin/rmail /usr/sbin/rmail /usr/bin/rmail /bin/rmail; do
@@ -2395,16 +4782,16 @@
 else
   RMAILPATH="$withval"
 fi
-echo "$ac_t""Using ZMailer RMAILPATH: $RMAILPATH" 1>&6
+echo "$as_me:4785: result: Using ZMailer RMAILPATH: $RMAILPATH" >&5
+echo "${ECHO_T}Using ZMailer RMAILPATH: $RMAILPATH" >&6
 
-
 use_vacationpath=0
+
 # Check whether --with-vacationpath or --without-vacationpath was given.
 if test "${with_vacationpath+set}" = set; then
   withval="$with_vacationpath"
   use_vacationpath=1
-fi
-
+fi;
 if test "$use_vacationpath" = 0 ; then
   # Ok, no value given, make some guesses; /usr/sbin ??
   for VACATIONDEF in /bin/vacation /usr/ucb/vacation /usr/bin/vacation ; do
@@ -2420,42 +4807,39 @@
         VACATIONPATH="$withval"
     fi
 fi
-echo "$ac_t""Using ZMailer VACATIONPATH: $VACATIONPATH" 1>&6
+echo "$as_me:4810: result: Using ZMailer VACATIONPATH: $VACATIONPATH" >&5
+echo "${ECHO_T}Using ZMailer VACATIONPATH: $VACATIONPATH" >&6
 
-
 oldSELFADDRESSES="$SELFADDRESSES"
 
 # Check whether --with-selfaddresses or --without-selfaddresses was given.
 if test "${with_selfaddresses+set}" = set; then
   withval="$with_selfaddresses"
   use_selfaddresses=1
-fi
-
+fi;
 if test "x$use_selfaddresses" != "x" ; then
     SELFADDRESSES="$withval"
 else
     SELFADDRESSES="$oldSELFADDRESSES"
 fi
-echo "$ac_t""Using ZMailer SELFADDRESSES: $SELFADDRESSES" 1>&6
+echo "$as_me:4825: result: Using ZMailer SELFADDRESSES: $SELFADDRESSES" >&5
+echo "${ECHO_T}Using ZMailer SELFADDRESSES: $SELFADDRESSES" >&6
 
 sleep 2  # Sleep a bit here too
 
-
-
-
 MALLOCEXT=""
+
 # Check whether --with-system-malloc or --without-system-malloc was given.
 if test "${with_system_malloc+set}" = set; then
   withval="$with_system_malloc"
   use_system_malloc=1
-fi
+fi;
 
 # Check whether --with-libmalloc or --without-libmalloc was given.
 if test "${with_libmalloc+set}" = set; then
   withval="$with_libmalloc"
   use_libmalloc=1
-fi
-
+fi;
 if test "x$use_system_malloc" = x1 ; then
   LIBMALLOC=""
   MALLOC="system"
@@ -2482,33 +4866,31 @@
     fi
   fi
 fi
-echo "$ac_t""Using ZMailer malloc library of type: $MALLOC" 1>&6
+echo "$as_me:4869: result: Using ZMailer malloc library of type: $MALLOC" >&5
+echo "${ECHO_T}Using ZMailer malloc library of type: $MALLOC" >&6
 
 #
 # Following is rather painfull to do fully automatic, thus I choose
 # to do it in dumb way -- explicitely, INCLUDING LINKER STUFF !
 #
 
-
 # Check whether --with-yp or --without-yp was given.
 if test "${with_yp+set}" = set; then
   withval="$with_yp"
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\EOF
 #define HAVE_YP 1
 EOF
-
-fi
-
 
+fi;
 
 LIBNIS=""
+
 # Check whether --with-yp-lib or --without-yp-lib was given.
 if test "${with_yp_lib+set}" = set; then
   withval="$with_yp_lib"
   LIBNIS="$withval"
-fi
+fi;
 
-
 #AC_CHECK_HEADERS(rpc/rpc.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
 #if test "$ac_cv_header_rpc_rpc.h" = yes			\
 #	-a "$ac_cv_header_rpcsvc_yp_prot_h" = yes	\
@@ -2519,65 +4901,82 @@
 #    AC_DEFINE(HAVE_YP)
 #fi
 
-echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2524: checking for sys/wait.h that is POSIX.1 compatible" >&5
-if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:4904: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6
+if test "${ac_cv_header_sys_wait_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2529 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4910 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
 #ifndef WEXITSTATUS
-#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
 #endif
 #ifndef WIFEXITED
-#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
 #endif
-int main() {
-int s;
-wait (&s);
-s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
-; return 0; }
-EOF
-if { (eval echo configure:2545: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+
+int
+main ()
+{
+  int s;
+  wait (&s);
+  s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4932: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4935: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4938: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4941: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_header_sys_wait_h=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_sys_wait_h=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_header_sys_wait_h=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
+echo "$as_me:4951: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
 if test $ac_cv_header_sys_wait_h = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define HAVE_SYS_WAIT_H 1
 EOF
 
 fi
 
-echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6
-echo "configure:2566: checking for wait3 that fills in rusage" >&5
-if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:4961: checking for wait3 that fills in rusage" >&5
+echo $ECHO_N "checking for wait3 that fills in rusage... $ECHO_C" >&6
+if test "${ac_cv_func_wait3_rusage+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
   ac_cv_func_wait3_rusage=no
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2574 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4970 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <stdio.h>
 /* HP-UX has wait3 but does not fill in rusage at all.  */
-main() {
+int
+main ()
+{
   struct rusage r;
   int i;
   /* Use a field that we can force nonzero --
@@ -2588,36 +4987,48 @@
   r.ru_stime.tv_sec = 0;
   r.ru_stime.tv_usec = 0;
   r.ru_majflt = r.ru_minflt = 0;
-  switch (fork()) {
-  case 0: /* Child.  */
-    sleep(1); /* Give up the CPU.  */
-    _exit(0);
-  case -1: _exit(0); /* What can we do?  */
-  default: /* Parent.  */
-    wait3(&i, 0, &r);
-    sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines.  */
-    exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
-	 && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
-  }
+  switch (fork ())
+    {
+    case 0: /* Child.  */
+      sleep(1); /* Give up the CPU.  */
+      _exit(0);
+    case -1: /* What can we do?  */
+      _exit(0);
+    default: /* Parent.  */
+      wait3(&i, 0, &r);
+      /* Avoid "text file busy" from rm on fast HP-UX machines.  */
+      sleep(2);
+      exit (r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
+	    && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
+    }
 }
-EOF
-if { (eval echo configure:2605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:5007: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5010: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:5012: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5015: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_func_wait3_rusage=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_func_wait3_rusage=no
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_wait3_rusage=no
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
 fi
-
-echo "$ac_t""$ac_cv_func_wait3_rusage" 1>&6
+echo "$as_me:5027: result: $ac_cv_func_wait3_rusage" >&5
+echo "${ECHO_T}$ac_cv_func_wait3_rusage" >&6
 if test $ac_cv_func_wait3_rusage = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define HAVE_WAIT3 1
 EOF
 
@@ -2625,340 +5036,415 @@
 
 for ac_func in waitpid wait4
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2630: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:5040: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2635 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5046 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
-int main() {
-
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5077: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5080: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5083: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5086: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:5096: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:2658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
 for ac_func in getenv putenv setenv unsetenv
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2685: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:5109: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2690 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5115 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
-int main() {
-
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5146: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5149: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5152: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5155: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:5165: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:2713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
-
 #
 #  Study shared library generation
 #
 
-
-
-
-
-
-
 ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:2753: checking for $ac_hdr that defines DIR" >&5
-if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+  ac_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $ac_tr_sh`
+echo "$as_me:5182: checking for $ac_hdr that defines DIR" >&5
+echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2758 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5188 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
-int main() {
+
+int
+main ()
+{
 DIR *dirp = 0;
-; return 0; }
-EOF
-if { (eval echo configure:2766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  eval "ac_cv_header_dirent_$ac_safe=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_dirent_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5202: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5205: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5208: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5211: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:5221: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_hdr" | $ac_tr_cpp` 1
 EOF
- ac_header_dirent=$ac_hdr; break
-else
-  echo "$ac_t""no" 1>&6
+
+ac_header_dirent=$ac_hdr; break
 fi
+
 done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
-echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:2791: checking for opendir in -ldir" >&5
-ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:5234: checking for opendir in -ldir" >&5
+echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
+if test "${ac_cv_lib_dir_opendir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldir  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2799 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 5242 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char opendir();
-
-int main() {
-opendir()
-; return 0; }
-EOF
-if { (eval echo configure:2810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+   builtin and then its argument prototype would still apply.  */
+char opendir ();
+int
+main ()
+{
+opendir ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5261: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5264: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5267: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5270: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dir_opendir=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dir_opendir=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:5281: result: $ac_cv_lib_dir_opendir" >&5
+echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
+if test $ac_cv_lib_dir_opendir = yes; then
   LIBS="$LIBS -ldir"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 else
-echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:2832: checking for opendir in -lx" >&5
-ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:5288: checking for opendir in -lx" >&5
+echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
+if test "${ac_cv_lib_x_opendir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lx  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2840 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 5296 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char opendir();
-
-int main() {
-opendir()
-; return 0; }
-EOF
-if { (eval echo configure:2851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+   builtin and then its argument prototype would still apply.  */
+char opendir ();
+int
+main ()
+{
+opendir ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5315: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5318: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5321: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5324: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_x_opendir=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_x_opendir=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:5335: result: $ac_cv_lib_x_opendir" >&5
+echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
+if test $ac_cv_lib_x_opendir = yes; then
   LIBS="$LIBS -lx"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
 
-echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6
-echo "configure:2874: checking whether closedir returns void" >&5
-if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:5343: checking whether closedir returns void" >&5
+echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6
+if test "${ac_cv_func_closedir_void+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
   ac_cv_func_closedir_void=yes
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2882 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5352 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_header_dirent>
-int closedir(); main() { exit(closedir(opendir(".")) != 0); }
-EOF
-if { (eval echo configure:2888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+
+int closedir ();
+int
+main ()
+{
+  exit (closedir (opendir (".")) != 0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:5365: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5368: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:5370: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5373: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_func_closedir_void=no
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_func_closedir_void=yes
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_closedir_void=yes
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
 fi
-
-echo "$ac_t""$ac_cv_func_closedir_void" 1>&6
+echo "$as_me:5385: result: $ac_cv_func_closedir_void" >&5
+echo "${ECHO_T}$ac_cv_func_closedir_void" >&6
 if test $ac_cv_func_closedir_void = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define CLOSEDIR_VOID 1
 EOF
 
 fi
 
-
-echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2912: checking for uid_t in sys/types.h" >&5
-if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:5395: checking for uid_t in sys/types.h" >&5
+echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6
+if test "${ac_cv_type_uid_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2917 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5401 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-EOF
+
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "uid_t" >/dev/null 2>&1; then
-  rm -rf conftest*
   ac_cv_type_uid_t=yes
 else
-  rm -rf conftest*
   ac_cv_type_uid_t=no
 fi
 rm -f conftest*
 
 fi
-
-echo "$ac_t""$ac_cv_type_uid_t" 1>&6
+echo "$as_me:5415: result: $ac_cv_type_uid_t" >&5
+echo "${ECHO_T}$ac_cv_type_uid_t" >&6
 if test $ac_cv_type_uid_t = no; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define uid_t int
 EOF
 
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\EOF
 #define gid_t int
 EOF
 
 fi
 
-echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:2946: checking type of array argument to getgroups" >&5
-if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:5429: checking type of array argument to getgroups" >&5
+echo $ECHO_N "checking type of array argument to getgroups... $ECHO_C" >&6
+if test "${ac_cv_type_getgroups+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
   ac_cv_type_getgroups=cross
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2954 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5438 "configure"
 #include "confdefs.h"
-
 /* Thanks to Mike Rendell for this test.  */
 #include <sys/types.h>
 #define NGID 256
 #undef MAX
 #define MAX(x, y) ((x) > (y) ? (x) : (y))
-main()
+
+int
+main ()
 {
   gid_t gidset[NGID];
   int i, n;
@@ -2973,227 +5459,167 @@
      happens when gid_t is short but getgroups modifies an array of ints.  */
   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
 }
-
-EOF
-if { (eval echo configure:2979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-    ac_cv_type_getgroups=gid_t
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:5464: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5467: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:5469: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5472: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_getgroups=gid_t
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_type_getgroups=int
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_getgroups=int
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
 if test $ac_cv_type_getgroups = cross; then
-        cat > conftest.$ac_ext <<EOF
-#line 2993 "configure"
+        cat >conftest.$ac_ext <<_ACEOF
+#line 5485 "configure"
 #include "confdefs.h"
 #include <unistd.h>
-EOF
+
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
-  rm -rf conftest*
   ac_cv_type_getgroups=gid_t
 else
-  rm -rf conftest*
   ac_cv_type_getgroups=int
 fi
 rm -f conftest*
 
 fi
 fi
+echo "$as_me:5500: result: $ac_cv_type_getgroups" >&5
+echo "${ECHO_T}$ac_cv_type_getgroups" >&6
 
-echo "$ac_t""$ac_cv_type_getgroups" 1>&6
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<EOF
 #define GETGROUPS_T $ac_cv_type_getgroups
 EOF
-
-
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3017: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 3022 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  ac_cv_header_stdc=yes
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
 
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 3047 "configure"
-#include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "memchr" >/dev/null 2>&1; then
-  :
+echo "$as_me:5507: checking for mode_t" >&5
+echo $ECHO_N "checking for mode_t... $ECHO_C" >&6
+if test "${ac_cv_type_mode_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  rm -rf conftest*
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 3065 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5513 "configure"
 #include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "free" >/dev/null 2>&1; then
-  :
-else
-  rm -rf conftest*
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
-  :
+$ac_includes_default
+int
+main ()
+{
+if ((mode_t *) 0)
+  return 0;
+if (sizeof (mode_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5528: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5531: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5534: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5537: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_mode_t=yes
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3086 "configure"
-#include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
-
-EOF
-if { (eval echo configure:3097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_mode_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:5547: result: $ac_cv_type_mode_t" >&5
+echo "${ECHO_T}$ac_cv_type_mode_t" >&6
+if test $ac_cv_type_mode_t = yes; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_header_stdc=no
-fi
-rm -fr conftest*
-fi
-
-fi
-fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
-  cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
-
-fi
-
-echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:3121: checking for mode_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 3126 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_mode_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_mode_t=no
-fi
-rm -f conftest*
 
-fi
-echo "$ac_t""$ac_cv_type_mode_t" 1>&6
-if test $ac_cv_type_mode_t = no; then
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<EOF
 #define mode_t int
 EOF
 
 fi
 
-echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3154: checking for off_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:5559: checking for off_t" >&5
+echo $ECHO_N "checking for off_t... $ECHO_C" >&6
+if test "${ac_cv_type_off_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3159 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5565 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
+$ac_includes_default
+int
+main ()
+{
+if ((off_t *) 0)
+  return 0;
+if (sizeof (off_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5580: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5583: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5586: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5589: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_type_off_t=yes
 else
-  rm -rf conftest*
-  ac_cv_type_off_t=no
-fi
-rm -f conftest*
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_off_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:5599: result: $ac_cv_type_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_off_t" >&6
+if test $ac_cv_type_off_t = yes; then
+  :
+else
 
-fi
-echo "$ac_t""$ac_cv_type_off_t" 1>&6
-if test $ac_cv_type_off_t = no; then
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<EOF
 #define off_t long
 EOF
 
 fi
 
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3187: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:5611: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
+if test "${ac_cv_type_signal+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3192 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5617 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
 #ifdef signal
-#undef signal
+# undef signal
 #endif
 #ifdef __cplusplus
 extern "C" void (*signal (int, void (*)(int)))(int);
@@ -3201,244 +5627,323 @@
 void (*signal ()) ();
 #endif
 
-int main() {
+int
+main ()
+{
 int i;
-; return 0; }
-EOF
-if { (eval echo configure:3209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5639: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5642: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5645: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5648: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_type_signal=void
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_type_signal=int
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_signal=int
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
+echo "$as_me:5658: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6
 
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<EOF
 #define RETSIGTYPE $ac_cv_type_signal
 EOF
-
 
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3228: checking for size_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:5665: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+if test "${ac_cv_type_size_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3233 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5671 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
+$ac_includes_default
+int
+main ()
+{
+if ((size_t *) 0)
+  return 0;
+if (sizeof (size_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5686: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5689: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5692: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5695: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_type_size_t=yes
 else
-  rm -rf conftest*
-  ac_cv_type_size_t=no
-fi
-rm -f conftest*
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_size_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:5705: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6
+if test $ac_cv_type_size_t = yes; then
+  :
+else
 
-fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<EOF
 #define size_t unsigned
 EOF
 
 fi
 
-echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3261: checking for uid_t in sys/types.h" >&5
-if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:5717: checking for uid_t in sys/types.h" >&5
+echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6
+if test "${ac_cv_type_uid_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3266 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5723 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-EOF
+
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "uid_t" >/dev/null 2>&1; then
-  rm -rf conftest*
   ac_cv_type_uid_t=yes
 else
-  rm -rf conftest*
   ac_cv_type_uid_t=no
 fi
 rm -f conftest*
 
 fi
-
-echo "$ac_t""$ac_cv_type_uid_t" 1>&6
+echo "$as_me:5737: result: $ac_cv_type_uid_t" >&5
+echo "${ECHO_T}$ac_cv_type_uid_t" >&6
 if test $ac_cv_type_uid_t = no; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define uid_t int
 EOF
 
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\EOF
 #define gid_t int
 EOF
 
 fi
 
-echo $ac_n "checking for ino_t""... $ac_c" 1>&6
-echo "configure:3295: checking for ino_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_ino_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:5751: checking for ino_t" >&5
+echo $ECHO_N "checking for ino_t... $ECHO_C" >&6
+if test "${ac_cv_type_ino_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3300 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5757 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])ino_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
+$ac_includes_default
+int
+main ()
+{
+if ((ino_t *) 0)
+  return 0;
+if (sizeof (ino_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5772: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5775: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5778: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5781: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_type_ino_t=yes
 else
-  rm -rf conftest*
-  ac_cv_type_ino_t=no
-fi
-rm -f conftest*
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_ino_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:5791: result: $ac_cv_type_ino_t" >&5
+echo "${ECHO_T}$ac_cv_type_ino_t" >&6
+if test $ac_cv_type_ino_t = yes; then
+  :
+else
 
-fi
-echo "$ac_t""$ac_cv_type_ino_t" 1>&6
-if test $ac_cv_type_ino_t = no; then
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<EOF
 #define ino_t unsigned long
 EOF
 
 fi
 
+echo "$as_me:5803: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5809 "configure"
+#include "confdefs.h"
 
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3329: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 3334 "configure"
-#include "confdefs.h"
-
-int main() {
-
-/* Ultrix mips cc rejects this.  */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this.  */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this.  */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
-   It does not let you subtract one const X* pointer from another in an arm
-   of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this.  */
-  char *t;
-  char const *s = 0 ? (char *) 0 : (char const *) 0;
-
-  *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-  int x[] = {25, 17};
-  const int *foo = &x[0];
-  ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-  typedef const int *iptr;
-  iptr p = 0;
-  ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
-     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-  struct s { int j; const int *ap[3]; };
-  struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-  const int foo = 10;
-}
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this.  */
+  typedef int charset[2];
+  const charset x;
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *ccp;
+  char **p;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  ccp = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++ccp;
+  p = (char**) ccp;
+  ccp = (char const *const *) p;
+  { /* SCO 3.2v4 cc rejects this.  */
+    char *t;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
 
-; return 0; }
-EOF
-if { (eval echo configure:3383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+    *t++ = 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; };
+    struct s *b; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+  }
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5867: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5870: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5873: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5876: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_c_const=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_c_const=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_c_const=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_c_const" 1>&6
+echo "$as_me:5886: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
 if test $ac_cv_c_const = no; then
-  cat >> confdefs.h <<\EOF
-#define const 
+
+cat >>confdefs.h <<\EOF
+#define const
 EOF
 
 fi
 
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3404: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:5896: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3409 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5902 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
 #include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3417: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
+
+_ACEOF
+if { (eval echo "$as_me:5910: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:5916: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
   ac_cv_header_stdc=yes
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
   ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 3434 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5938 "configure"
 #include "confdefs.h"
 #include <string.h>
-EOF
+
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "memchr" >/dev/null 2>&1; then
   :
 else
-  rm -rf conftest*
   ac_cv_header_stdc=no
 fi
 rm -f conftest*
@@ -3447,16 +5952,16 @@
 
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 3452 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5956 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
-EOF
+
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "free" >/dev/null 2>&1; then
   :
 else
-  rm -rf conftest*
   ac_cv_header_stdc=no
 fi
 rm -f conftest*
@@ -3465,254 +5970,369 @@
 
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
+  if test "$cross_compiling" = yes; then
   :
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3473 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5977 "configure"
 #include "confdefs.h"
 #include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+                     || ('j' <= (c) && (c) <= 'r') \
+                     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
 
-EOF
-if { (eval echo configure:3484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+        || toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:6003: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6006: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:6008: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6011: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_header_stdc=no
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_header_stdc=no
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
 fi
 fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
+echo "$as_me:6024: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
 if test $ac_cv_header_stdc = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define STDC_HEADERS 1
 EOF
 
 fi
 
-
 # Timezones are always a pain in... everybody has their own ways :-(
-for ac_hdr in sys/time.h
+
+for ac_header in sys/time.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3513: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:6039: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6045 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:6049: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:6055: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3518 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:6074: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3550: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:6084: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
+if test "${ac_cv_header_time+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3555 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6090 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
 #include <time.h>
-int main() {
+
+int
+main ()
+{
 struct tm *tp;
-; return 0; }
-EOF
-if { (eval echo configure:3564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6105: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6108: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6111: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6114: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_header_time=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_time=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_header_time=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_header_time" 1>&6
+echo "$as_me:6124: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6
 if test $ac_cv_header_time = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define TIME_WITH_SYS_TIME 1
 EOF
 
 fi
 
-echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3585: checking whether struct tm is in sys/time.h or time.h" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:6134: checking whether struct tm is in sys/time.h or time.h" >&5
+echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6
+if test "${ac_cv_struct_tm+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3590 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6140 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
-int main() {
+
+int
+main ()
+{
 struct tm *tp; tp->tm_sec;
-; return 0; }
-EOF
-if { (eval echo configure:3598: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6154: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6157: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6160: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6163: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_struct_tm=time.h
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_struct_tm=sys/time.h
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_struct_tm=sys/time.h
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_struct_tm" 1>&6
+echo "$as_me:6173: result: $ac_cv_struct_tm" >&5
+echo "${ECHO_T}$ac_cv_struct_tm" >&6
 if test $ac_cv_struct_tm = sys/time.h; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define TM_IN_SYS_TIME 1
 EOF
 
 fi
 
-echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3619: checking for tm_zone in struct tm" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:6183: checking for struct tm.tm_zone" >&5
+echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6
+if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3624 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6189 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
-int main() {
-struct tm tm; tm.tm_zone;
-; return 0; }
-EOF
-if { (eval echo configure:3632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_struct_tm_zone=yes
+
+int
+main ()
+{
+struct tm foo;
+foo.tm_zone;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6204: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6207: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6210: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6213: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_member_struct_tm_tm_zone=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_struct_tm_zone=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_member_struct_tm_tm_zone=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:6223: result: $ac_cv_member_struct_tm_tm_zone" >&5
+echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6
+if test $ac_cv_member_struct_tm_tm_zone = yes; then
+
+cat >>confdefs.h <<EOF
+#define HAVE_STRUCT_TM_TM_ZONE 1
+EOF
+
 fi
+
+if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
 
-echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
-if test "$ac_cv_struct_tm_zone" = yes; then
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\EOF
 #define HAVE_TM_ZONE 1
 EOF
 
 else
-  echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3652: checking for tzname" >&5
-if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:6240: checking for tzname" >&5
+echo $ECHO_N "checking for tzname... $ECHO_C" >&6
+if test "${ac_cv_var_tzname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3657 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6246 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
 #endif
-int main() {
+
+int
+main ()
+{
 atoi(*tzname);
-; return 0; }
-EOF
-if { (eval echo configure:3667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6262: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6265: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6268: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6271: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_var_tzname=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_var_tzname=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_var_tzname=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_var_tzname" 1>&6
+echo "$as_me:6281: result: $ac_cv_var_tzname" >&5
+echo "${ECHO_T}$ac_cv_var_tzname" >&6
   if test $ac_cv_var_tzname = yes; then
-    cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define HAVE_TZNAME 1
 EOF
 
   fi
 fi
 
-echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3689: checking whether struct tm is in sys/time.h or time.h" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:6292: checking whether struct tm is in sys/time.h or time.h" >&5
+echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6
+if test "${ac_cv_struct_tm+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3694 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6298 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
-int main() {
+
+int
+main ()
+{
 struct tm *tp; tp->tm_sec;
-; return 0; }
-EOF
-if { (eval echo configure:3702: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6312: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6315: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6318: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6321: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_struct_tm=time.h
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_struct_tm=sys/time.h
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_struct_tm=sys/time.h
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_struct_tm" 1>&6
+echo "$as_me:6331: result: $ac_cv_struct_tm" >&5
+echo "${ECHO_T}$ac_cv_struct_tm" >&6
 if test $ac_cv_struct_tm = sys/time.h; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define TM_IN_SYS_TIME 1
 EOF
 
@@ -3721,101 +6341,140 @@
 #
 # Timezones are always a pain in... everybody has their own ways :-(
 #
-echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6
-echo "configure:3726: checking for tm_gmtoff in struct tm" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_tm_gmtoff'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:6344: checking for tm_gmtoff in struct tm" >&5
+echo $ECHO_N "checking for tm_gmtoff in struct tm... $ECHO_C" >&6
+if test "${ac_cv_struct_tm_gmtoff+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3731 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6350 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
-int main() {
+int
+main ()
+{
 struct tm tm; tm.tm_gmtoff;
-; return 0; }
-EOF
-if { (eval echo configure:3739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6363: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6366: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6369: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6372: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_struct_tm_gmtoff=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_struct_tm_gmtoff=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_struct_tm_gmtoff=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_struct_tm_gmtoff" 1>&6
+echo "$as_me:6382: result: $ac_cv_struct_tm_gmtoff" >&5
+echo "${ECHO_T}$ac_cv_struct_tm_gmtoff" >&6
 if test "$ac_cv_struct_tm_gmtoff" = yes; then
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\EOF
 #define HAVE_TM_GMTOFF 1
 EOF
 
 else
-  echo $ac_n "checking for altzone""... $ac_c" 1>&6
-echo "configure:3759: checking for altzone" >&5
-if eval "test \"`echo '$''{'ac_cv_var_altzone'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:6390: checking for altzone" >&5
+echo $ECHO_N "checking for altzone... $ECHO_C" >&6
+if test "${ac_cv_var_altzone+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3764 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6396 "configure"
 #include "confdefs.h"
 #include <time.h>
 static int tt;
-int main() {
+int
+main ()
+{
 tt = (int)altzone;
-; return 0; }
-EOF
-if { (eval echo configure:3772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6409: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6412: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6415: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6418: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_var_altzone=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_var_altzone=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_var_altzone" 1>&6
-  echo $ac_n "checking for timezone""... $ac_c" 1>&6
-echo "configure:3786: checking for timezone" >&5
-if eval "test \"`echo '$''{'ac_cv_var_timezone'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_var_altzone=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:6428: result: $ac_cv_var_altzone" >&5
+echo "${ECHO_T}$ac_cv_var_altzone" >&6
+  echo "$as_me:6430: checking for timezone" >&5
+echo $ECHO_N "checking for timezone... $ECHO_C" >&6
+if test "${ac_cv_var_timezone+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3791 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6436 "configure"
 #include "confdefs.h"
 #include <time.h>
 static int tt;
-int main() {
+int
+main ()
+{
 tt = (int)timezone;
-; return 0; }
-EOF
-if { (eval echo configure:3799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6449: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6452: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6455: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6458: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_var_timezone=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_var_timezone=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_var_timezone=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_var_timezone" 1>&6
+echo "$as_me:6468: result: $ac_cv_var_timezone" >&5
+echo "${ECHO_T}$ac_cv_var_timezone" >&6
   if test "$ac_cv_var_altzone" = yes; then
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_ALTZONE 1
 EOF
 
   fi
   if test "$ac_cv_var_timezone" = yes; then
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_TIMEZONE 1
 EOF
 
@@ -3823,171 +6482,123 @@
 fi
 if test "x$ac_cv_var_altzone" = xno -a x$ac_cv_struct_tm_gmtoff = xno -a \
         "x$ac_cv_var_timezone" = xno ; then
-  echo "$ac_t""Aiee, autoconfig did not recognize timezone mechanism!  Time-zone offset calculation may give wrong results" 1>&6
-fi
-
-
-echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:3832: checking for st_blocks in struct stat" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 3837 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-int main() {
-struct stat s; s.st_blocks;
-; return 0; }
-EOF
-if { (eval echo configure:3845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_struct_st_blocks=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_struct_st_blocks=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_struct_st_blocks" 1>&6
-if test $ac_cv_struct_st_blocks = yes; then
-  cat >> confdefs.h <<\EOF
-#define HAVE_ST_BLOCKS 1
-EOF
-
-else
-  LIBOBJS="$LIBOBJS fileblocks.${ac_objext}"
-fi
-
-echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:3868: checking for st_blksize in struct stat" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 3873 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-int main() {
-struct stat s; s.st_blksize;
-; return 0; }
-EOF
-if { (eval echo configure:3881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_struct_st_blksize=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_struct_st_blksize=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
-if test $ac_cv_struct_st_blksize = yes; then
-  cat >> confdefs.h <<\EOF
-#define HAVE_ST_BLKSIZE 1
-EOF
-
+  echo "$as_me:6485: result: Aiee, autoconfig did not recognize timezone mechanism!  Time-zone offset calculation may give wrong results" >&5
+echo "${ECHO_T}Aiee, autoconfig did not recognize timezone mechanism!  Time-zone offset calculation may give wrong results" >&6
 fi
 
+# AC_STRUCT_ST_BLOCKS
+# AC_STRUCT_ST_BLKSIZE
 
-echo "$ac_t""Scanning possible database libraries in preferrence order:" 1>&6
-echo "$ac_t""   NDBM, SDBM, GDBM, BSD DB 1.x, SleepyCat DB 2.x" 1>&6
-echo "$ac_t"" ( Hash, Hash, Hash, BTree,      BTree )" 1>&6
-echo "$ac_t""Last one of them found will be system default DB format." 1>&6
+echo "$as_me:6492: result: Scanning possible database libraries in preferrence order:" >&5
+echo "${ECHO_T}Scanning possible database libraries in preferrence order:" >&6
+echo "$as_me:6494: result:    NDBM, SDBM, GDBM, BSD DB 1.x, SleepyCat DB 2.x" >&5
+echo "${ECHO_T}   NDBM, SDBM, GDBM, BSD DB 1.x, SleepyCat DB 2.x" >&6
+echo "$as_me:6496: result:  ( Hash, Hash, Hash, BTree,      BTree )" >&5
+echo "${ECHO_T} ( Hash, Hash, Hash, BTree,      BTree )" >&6
+echo "$as_me:6498: result: Last one of them found will be system default DB format." >&5
+echo "${ECHO_T}Last one of them found will be system default DB format." >&6
 
 DEFDBTYPE="$DBTYPE" # From possible entry in  zmailer.conf above...
  # Default db-type, unless we figure out something.
   # Default db-extension (pag/db) for FILE OPEN
  # Default db-extension (pag/db) for FILE AGE TESTS
-for ac_hdr in ndbm.h sdbm.h gdbm.h db.h db1/db.h db_185.h
+
+for ac_header in ndbm.h sdbm.h gdbm.h db.h db1/db.h db_185.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3915: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:6509: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6515 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:6519: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:6525: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3920 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:6544: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
-for ac_hdr in db2/db.h db2/db_185.h db3/db.h db3/db_185.h
+for ac_header in db2/db.h db2/db_185.h db3/db.h db3/db_185.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3955: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:6557: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3960 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6563 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3965: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:6567: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:6573: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:6592: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
-
 dblocation=""
 
 LIBNDBM=""
@@ -4010,46 +6621,72 @@
 	  DBTYPE="ndbm"
 	fi
       else
-	cat > conftest.$ac_ext <<EOF
-#line 4015 "configure"
+	cat >conftest.$ac_ext <<_ACEOF
+#line 6625 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 dbm_open();
-; return 0; }
-EOF
-if { (eval echo configure:4022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6637: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6640: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6643: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6646: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_c_dbm_open=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_c_dbm_open=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_c_dbm_open=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 	if test "$ac_cv_lib_c_dbm_open" = no; then
 	  if test "x$ac_cv_lib_dbm_dbm_open" = x; then # not set
 	    t_oldLibs="$LIBS"
 	    LIBS="$LIBS -ldbm"
-	    cat > conftest.$ac_ext <<EOF
-#line 4037 "configure"
+	    cat >conftest.$ac_ext <<_ACEOF
+#line 6660 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 dbm_open();
-; return 0; }
-EOF
-if { (eval echo configure:4044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6672: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6675: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6678: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6681: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_dbm_dbm_open=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_dbm_dbm_open=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dbm_dbm_open=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 	    LIBS="$t_oldLibs"
 	    if test "$ac_cv_lib_dbm_dbm_open" = yes; then
 	      LIBNDBM="-ldbm"
@@ -4057,36 +6694,52 @@
 	      DBTYPE="ndbm"
 	    else
 	      LIBS="$t_oldLibs -ldb"
-	      cat > conftest.$ac_ext <<EOF
-#line 4062 "configure"
+	      cat >conftest.$ac_ext <<_ACEOF
+#line 6698 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 dbm_open();
-; return 0; }
-EOF
-if { (eval echo configure:4069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6710: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6713: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6716: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6719: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_db_dbm_open=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_db_dbm_open=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_db_dbm_open=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 	      LIBS="$t_oldLibs"
 	      if test "$ac_cv_lib_db_dbm_open" = yes ; then
 		  LIBNDBM="-ldb"
 		  t_found_at="db library"
 		  DBTYPE="ndbm"
 	      else
-		  echo "$ac_t""??? Has <ndbm.h>, but dbm_open() is not at libc, libndbm, nor at libdb ???" 1>&6
+		  echo "$as_me:6734: result: ??? Has <ndbm.h>, but dbm_open() is not at libc, libndbm, nor at libdb ???" >&5
+echo "${ECHO_T}??? Has <ndbm.h>, but dbm_open() is not at libc, libndbm, nor at libdb ???" >&6
 	      fi
 	    fi
 	  else
 	    if test "$ac_cv_lib_dbm_dbm_open" = yes ; then
-	      { echo "configure: error: config.cache inconsistency! (ndbm) Delete it, and redo!" 1>&2; exit 1; }
+	      { { echo "$as_me:6740: error: config.cache inconsistency! (ndbm) Delete it, and redo!" >&5
+echo "$as_me: error: config.cache inconsistency! (ndbm) Delete it, and redo!" >&2;}
+   { (exit 1); exit 1; }; }
 	    fi
 	  fi
 	else # Has it in the libc!
@@ -4101,28 +6754,43 @@
     # If we have BSD DB's compability mode in use, it does not have
     # dbm_error() function.  Check at it!
     LIBS="$LIBS $LIBNDBM"
-    cat > conftest.$ac_ext <<EOF
-#line 4106 "configure"
+    cat >conftest.$ac_ext <<_ACEOF
+#line 6758 "configure"
 #include "confdefs.h"
 #include <ndbm.h>
-int main() {
+int
+main ()
+{
 DBM *db;int i = dbm_error(db);
-; return 0; }
-EOF
-if { (eval echo configure:4113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cat >> confdefs.h <<\EOF
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6770: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6773: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6776: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6779: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cat >>confdefs.h <<\EOF
 #define HAVE_DBM_ERROR 1
 EOF
 
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
     LIBS="$t_oldLibs"
   fi
-  echo "$ac_t""Located NDBM's  dbm_open()  routine at $t_found_at" 1>&6
+  echo "$as_me:6792: result: Located NDBM's  dbm_open()  routine at $t_found_at" >&5
+echo "${ECHO_T}Located NDBM's  dbm_open()  routine at $t_found_at" >&6
   if test "$t_found_at" != nowhere; then
     dblocation="$dblocation;$t_found_at"
   fi
@@ -4131,30 +6799,45 @@
 if test -n "$LIBNDBM" ; then
   if test -z "ac_cv_ndbm_dbm_pagfno" ; then
     LIBS="$LIBS $LIBNDBM"
-    cat > conftest.$ac_ext <<EOF
-#line 4136 "configure"
+    cat >conftest.$ac_ext <<_ACEOF
+#line 6803 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <ndbm.h>
-int main() {
+int
+main ()
+{
 DBM *tdbm; int fd = dbm_pagfno(tdbm);
-; return 0; }
-EOF
-if { (eval echo configure:4144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6816: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6819: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6822: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6825: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_ndbm_dbm_pagfno=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_ndbm_dbm_pagfno=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_ndbm_dbm_pagfno=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
     LIBS="$t_oldLibs"
   fi
   if test "$ac_cv_ndbm_dbm_pagfno" = no ; then
-	echo "$ac_t""WARNING: <ndbm.h> sighted, but linkage of dbm_pagfno() function fails!" 1>&6
-	echo "$ac_t""WARNING: YOU WILL PROPABLY BE IN A PICKLE DUE TO THIS!" 1>&6
+	echo "$as_me:6837: result: WARNING: <ndbm.h> sighted, but linkage of dbm_pagfno() function fails!" >&5
+echo "${ECHO_T}WARNING: <ndbm.h> sighted, but linkage of dbm_pagfno() function fails!" >&6
+	echo "$as_me:6839: result: WARNING: YOU WILL PROPABLY BE IN A PICKLE DUE TO THIS!" >&5
+echo "${ECHO_T}WARNING: YOU WILL PROPABLY BE IN A PICKLE DUE TO THIS!" >&6
   fi
 fi
 
@@ -4162,10 +6845,14 @@
 # Sometimes it is in libc, sometimes at separate lib...
 # Umm...
 if test "$ac_cv_header_sdbm_h" = yes ; then
-  echo "$ac_t""Note:  SDBM  support is not really integrated!" 1>&6
-  echo "$ac_t""Note2: Usually the <sdbm.h> is installed as  <ndbm.h> and the library" 1>&6
-  echo "$ac_t""       is installed as  libdbm.a, and it is indistinguishable" 1>&6
-  echo "$ac_t""       (at source level) from a real NDBM." 1>&6
+  echo "$as_me:6848: result: Note:  SDBM  support is not really integrated!" >&5
+echo "${ECHO_T}Note:  SDBM  support is not really integrated!" >&6
+  echo "$as_me:6850: result: Note2: Usually the <sdbm.h> is installed as  <ndbm.h> and the library" >&5
+echo "${ECHO_T}Note2: Usually the <sdbm.h> is installed as  <ndbm.h> and the library" >&6
+  echo "$as_me:6852: result:        is installed as  libdbm.a, and it is indistinguishable" >&5
+echo "${ECHO_T}       is installed as  libdbm.a, and it is indistinguishable" >&6
+  echo "$as_me:6854: result:        (at source level) from a real NDBM." >&5
+echo "${ECHO_T}       (at source level) from a real NDBM." >&6
   t_found_at="nowhere"
   if test "$ac_cv_lib_c_dbm_open" = yes ; then
     LIBSDBM=""
@@ -4177,57 +6864,86 @@
       t_found_at="sdbm library"
       DBTYPE="ndbm"
     else
-      cat > conftest.$ac_ext <<EOF
-#line 4182 "configure"
+      cat >conftest.$ac_ext <<_ACEOF
+#line 6868 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 dbm_open();
-; return 0; }
-EOF
-if { (eval echo configure:4189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6880: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6883: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6886: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6889: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_c_dbm_open=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_c_dbm_open=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_c_dbm_open=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
       if test "$ac_cv_lib_c_dbm_open" = no; then
 	if test "x$ac_cv_lib_sdbm_dbm_open" = x; then # not set
 	  t_oldLibs="$LIBS"
 	  LIBS="$LIBS -lsdbm"
-	  cat > conftest.$ac_ext <<EOF
-#line 4204 "configure"
+	  cat >conftest.$ac_ext <<_ACEOF
+#line 6903 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 dbm_open();
-; return 0; }
-EOF
-if { (eval echo configure:4211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6915: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6918: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6921: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6924: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_sdbm_dbm_open=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_sdbm_dbm_open=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_sdbm_dbm_open=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 	  LIBS="$t_oldLibs"
 	  if test "$ac_cv_lib_sdbm_dbm_open" = yes; then
 	    LIBSDBM="-lsdbm"
 	    t_found_at="sdbm library"
 	    DBTYPE="ndbm"
 	  else
-	    echo "$ac_t""??? Has <sdbm.h>, but dbm_open() is not at libc, nor at libsdbm ???" 1>&6
+	    echo "$as_me:6939: result: ??? Has <sdbm.h>, but dbm_open() is not at libc, nor at libsdbm ???" >&5
+echo "${ECHO_T}??? Has <sdbm.h>, but dbm_open() is not at libc, nor at libsdbm ???" >&6
 	  fi
 	else
 	  if test "$ac_cv_lib_sdbm_dbm_open" = yes ; then
-	    { echo "configure: error: config.cache inconsistency! (sdbm) Delete it, and redo!" 1>&2; exit 1; }
+	    { { echo "$as_me:6944: error: config.cache inconsistency! (sdbm) Delete it, and redo!" >&5
+echo "$as_me: error: config.cache inconsistency! (sdbm) Delete it, and redo!" >&2;}
+   { (exit 1); exit 1; }; }
 	  fi
 	fi
       else # Has it in the libc!
@@ -4237,7 +6953,8 @@
       fi
     fi
   fi
-  echo "$ac_t""Located SDBM's  dbm_open()  routine at $t_found_at" 1>&6
+  echo "$as_me:6956: result: Located SDBM's  dbm_open()  routine at $t_found_at" >&5
+echo "${ECHO_T}Located SDBM's  dbm_open()  routine at $t_found_at" >&6
   if test "$t_found_at" != nowhere; then
     dblocation="$dblocation;$t_found_at"
   fi
@@ -4257,58 +6974,87 @@
       t_found_at="gdbm library"
       DBTYPE="gdbm"
     else
-      cat > conftest.$ac_ext <<EOF
-#line 4262 "configure"
+      cat >conftest.$ac_ext <<_ACEOF
+#line 6978 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 gdbm_open();
-; return 0; }
-EOF
-if { (eval echo configure:4269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6990: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6993: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6996: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6999: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_c_gdbm_open=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_c_gdbm_open=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_c_gdbm_open=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
       if test "$ac_cv_lib_c_gdbm_open" = no; then
 	if test "x$ac_cv_lib_gdbm_gdbm_open" = x; then # not set
 	  t_oldLibs="$LIBS"
 	  LIBS="$LIBS -lgdbm"
-	  cat > conftest.$ac_ext <<EOF
-#line 4284 "configure"
+	  cat >conftest.$ac_ext <<_ACEOF
+#line 7013 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 gdbm_open();
-; return 0; }
-EOF
-if { (eval echo configure:4291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7025: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7028: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7031: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7034: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_gdbm_gdbm_open=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_gdbm_gdbm_open=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gdbm_gdbm_open=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 	  LIBS="$t_oldLibs"
 	  if test "$ac_cv_lib_gdbm_gdbm_open" = yes; then
 	    LIBGDBM="-lgdbm"
 	    t_found_at="gdbm library"
 	    DBTYPE="gdbm"
 	  else
-	    echo "$ac_t""??? Has <gdbm.h>, but gdbm_open() is not at libc, nor at libgdbm ???" 1>&6
-	    
+	    echo "$as_me:7049: result: ??? Has <gdbm.h>, but gdbm_open() is not at libc, nor at libgdbm ???" >&5
+echo "${ECHO_T}??? Has <gdbm.h>, but gdbm_open() is not at libc, nor at libgdbm ???" >&6
+
 	  fi
 	else
 	  if test "$ac_cv_lib_gdbm_gdbm_open" = yes ; then
-	    { echo "configure: error: config.cache inconsistency! (gdbm) Delete it, and redo!" 1>&2; exit 1; }
+	    { { echo "$as_me:7055: error: config.cache inconsistency! (gdbm) Delete it, and redo!" >&5
+echo "$as_me: error: config.cache inconsistency! (gdbm) Delete it, and redo!" >&2;}
+   { (exit 1); exit 1; }; }
 	  fi
 	fi
       else # Has it in the libc!
@@ -4318,7 +7064,8 @@
       fi
     fi
   fi
-  echo "$ac_t""Located GNU GDBM's  gdbm_open()  routine at $t_found_at" 1>&6
+  echo "$as_me:7067: result: Located GNU GDBM's  gdbm_open()  routine at $t_found_at" >&5
+echo "${ECHO_T}Located GNU GDBM's  gdbm_open()  routine at $t_found_at" >&6
   if test "$t_found_at" != nowhere; then
     dblocation="$dblocation;$t_found_at"
   fi
@@ -4339,57 +7086,86 @@
     DBTYPE="btree"
   else
     if test "x$ac_cv_lib_c_dbopen1" = x ; then # not set
-      cat > conftest.$ac_ext <<EOF
-#line 4344 "configure"
+      cat >conftest.$ac_ext <<_ACEOF
+#line 7090 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 dbopen();
-; return 0; }
-EOF
-if { (eval echo configure:4351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7102: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7105: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7108: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7111: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_c_dbopen1=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_c_dbopen1=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_c_dbopen1=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
     fi
     if test "$ac_cv_lib_c_dbopen1" = no ; then
       if test "x$ac_cv_lib_db1_dbopen1" = x ; then # not set
         t_oldLibs="$LIBS"
         LIBS="$LIBS -ldb1"
-        cat > conftest.$ac_ext <<EOF
-#line 4367 "configure"
+        cat >conftest.$ac_ext <<_ACEOF
+#line 7126 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 dbopen();
-; return 0; }
-EOF
-if { (eval echo configure:4374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7138: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7141: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7144: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7147: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_db1_dbopen1=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_db1_dbopen1=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_db1_dbopen1=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
         LIBS="$t_oldLibs"
         if test "$ac_cv_lib_db1_dbopen1" = yes ; then
           LIBDB="-ldb1"
           t_found_at="db1 library"
           DBTYPE="btree"
         else
-          echo "$ac_t""??? Has <db_185.h>, but dbopen() is not at libc, nor at libdb ???" 1>&6
+          echo "$as_me:7162: result: ??? Has <db_185.h>, but dbopen() is not at libc, nor at libdb ???" >&5
+echo "${ECHO_T}??? Has <db_185.h>, but dbopen() is not at libc, nor at libdb ???" >&6
         fi
       elif test "$ac_cv_lib_db1_dbopen1" = yes ; then
-        { echo "configure: error: config.cache inconsistency! (db1) Delete it, and redo!" 1>&2; exit 1; }
+        { { echo "$as_me:7166: error: config.cache inconsistency! (db1) Delete it, and redo!" >&5
+echo "$as_me: error: config.cache inconsistency! (db1) Delete it, and redo!" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     else # Has it in the libc!
       LIBDB=""
@@ -4398,15 +7174,19 @@
     fi
   fi
   if test "$t_found_at" = nowhere ; then
-    echo "$ac_t""Didn't locate BSD DB 1.x  dbopen()  anywhere, although <db_185.h> file exists." 1>&6
+    echo "$as_me:7177: result: Didn't locate BSD DB 1.x  dbopen()  anywhere, although <db_185.h> file exists." >&5
+echo "${ECHO_T}Didn't locate BSD DB 1.x  dbopen()  anywhere, although <db_185.h> file exists." >&6
   else
-    echo "$ac_t""Located BSD DB 1.x  dbopen()  routine at $t_found_at" 1>&6
+    echo "$as_me:7180: result: Located BSD DB 1.x  dbopen()  routine at $t_found_at" >&5
+echo "${ECHO_T}Located BSD DB 1.x  dbopen()  routine at $t_found_at" >&6
     if test "x$LIBDB" != "x" -a "x$LIBDB" = "x$LIBNDBM" ; then
         # Well, both at the same library ( -ldb ), which propably
         # means that  <ndbm.h>  is just an emulation mode at BSD DB.
         LIBNDBM=""
-      echo "$ac_t""Note: It looks like your NDBM is actually BSD DB compability wrapper at" 1>&6
-      echo "$ac_t""      libdb -library. If so, your NDBM databases are actually BSD DB_HASH ones.." 1>&6
+      echo "$as_me:7186: result: Note: It looks like your NDBM is actually BSD DB compability wrapper at" >&5
+echo "${ECHO_T}Note: It looks like your NDBM is actually BSD DB compability wrapper at" >&6
+      echo "$as_me:7188: result:       libdb -library. If so, your NDBM databases are actually BSD DB_HASH ones.." >&5
+echo "${ECHO_T}      libdb -library. If so, your NDBM databases are actually BSD DB_HASH ones.." >&6
     fi
     if test "$t_found_at" != nowhere; then
       dblocation="$dblocation;$t_found_at"
@@ -4414,7 +7194,6 @@
   fi
 fi
 
-
 if test "$ac_cv_header_db_h" = yes -o "$ac_cv_header_db1_db_h" = yes ; then
   t_found_at="nowhere"
   if test "$ac_cv_lib_c_dbopen" = yes ; then
@@ -4431,69 +7210,108 @@
     DBTYPE="btree"
   else
     if test "x$ac_cv_lib_c_dbopen" = x ; then # not set
-      cat > conftest.$ac_ext <<EOF
-#line 4436 "configure"
+      cat >conftest.$ac_ext <<_ACEOF
+#line 7214 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 dbopen();
-; return 0; }
-EOF
-if { (eval echo configure:4443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7226: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7229: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7232: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7235: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_c_dbopen=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_c_dbopen=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_c_dbopen=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
     fi
     if test "$ac_cv_lib_c_dbopen" = no ; then
       if test "x$ac_cv_lib_db1_dbopen" = x ; then # not set
         t_oldLibs="$LIBS"
         LIBS="$LIBS -ldb1"
-        cat > conftest.$ac_ext <<EOF
-#line 4459 "configure"
+        cat >conftest.$ac_ext <<_ACEOF
+#line 7250 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 dbopen();
-; return 0; }
-EOF
-if { (eval echo configure:4466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7262: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7265: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7268: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7271: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_db1_dbopen=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_db1_dbopen=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_db1_dbopen=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
         LIBS="$t_oldLibs"
         if test "$ac_cv_lib_db1_dbopen" = no ; then
           t_oldLibs="$LIBS"
           LIBS="$LIBS -ldb"
-          cat > conftest.$ac_ext <<EOF
-#line 4481 "configure"
+          cat >conftest.$ac_ext <<_ACEOF
+#line 7285 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 dbopen();
-; return 0; }
-EOF
-if { (eval echo configure:4488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7297: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7300: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7303: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7306: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_db_dbopen=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_db_dbopen=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_db_dbopen=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
           LIBS="$t_oldLibs"
         fi
         if test "$ac_cv_lib_db1_dbopen" = yes ; then
@@ -4505,10 +7323,13 @@
           t_found_at="db library"
           DBTYPE="btree"
         else
-          echo "$ac_t""??? Has <db.h>, but dbopen() is not at libc, at libdb, nor at libdb1 ???" 1>&6
+          echo "$as_me:7326: result: ??? Has <db.h>, but dbopen() is not at libc, at libdb, nor at libdb1 ???" >&5
+echo "${ECHO_T}??? Has <db.h>, but dbopen() is not at libc, at libdb, nor at libdb1 ???" >&6
         fi
       elif test "$ac_cv_lib_db_dbopen" = yes ; then
-        { echo "configure: error: config.cache inconsistency! (db) Delete it, and redo!" 1>&2; exit 1; }
+        { { echo "$as_me:7330: error: config.cache inconsistency! (db) Delete it, and redo!" >&5
+echo "$as_me: error: config.cache inconsistency! (db) Delete it, and redo!" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     else # Has it in the libc!
       LIBDB=""
@@ -4517,15 +7338,19 @@
     fi
   fi
   if test "$t_found_at" = nowhere ; then
-    echo "$ac_t""Didn't locate BSD DB 1.x  dbopen()  anywhere, although <db.h> file exists." 1>&6
+    echo "$as_me:7341: result: Didn't locate BSD DB 1.x  dbopen()  anywhere, although <db.h> file exists." >&5
+echo "${ECHO_T}Didn't locate BSD DB 1.x  dbopen()  anywhere, although <db.h> file exists." >&6
   else
-    echo "$ac_t""Located BSD DB 1.x  dbopen()  routine at $t_found_at" 1>&6
+    echo "$as_me:7344: result: Located BSD DB 1.x  dbopen()  routine at $t_found_at" >&5
+echo "${ECHO_T}Located BSD DB 1.x  dbopen()  routine at $t_found_at" >&6
     if test "x$LIBDB" != "x" -a "x$LIBDB" = "x$LIBNDBM" ; then
         # Well, both at the same library ( -ldb ), which propably
         # means that  <ndbm.h>  is just an emulation mode at BSD DB.
         LIBNDBM=""
-      echo "$ac_t""Note: It looks like your NDBM is actually BSD DB compability wrapper at" 1>&6
-      echo "$ac_t""      libdb -library. If so, your NDBM databases are actually BSD DB_HASH ones.." 1>&6
+      echo "$as_me:7350: result: Note: It looks like your NDBM is actually BSD DB compability wrapper at" >&5
+echo "${ECHO_T}Note: It looks like your NDBM is actually BSD DB compability wrapper at" >&6
+      echo "$as_me:7352: result:       libdb -library. If so, your NDBM databases are actually BSD DB_HASH ones.." >&5
+echo "${ECHO_T}      libdb -library. If so, your NDBM databases are actually BSD DB_HASH ones.." >&6
     fi
     if test "$t_found_at" != nowhere; then
       dblocation="$dblocation;$t_found_at"
@@ -4533,14 +7358,13 @@
   fi
 fi
 
-
 if test "$ac_cv_header_db_h" = yes -o "$ac_cv_header_db2_db_h" = yes ; then
   t_found_at="nowhere"
   if test "$ac_cv_lib_c_db_open2" = yes ; then
     LIBDB=""
     t_found_at="libc(3)"
     DBTYPE="btree"
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_DB_OPEN2 1
 EOF
 
@@ -4548,7 +7372,7 @@
     LIBDB="-ldb2"
     t_found_at="db2 library"
     DBTYPE="btree"
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_DB_OPEN2 1
 EOF
 
@@ -4556,81 +7380,120 @@
     LIBDB="-ldb"
     t_found_at="db library"
     DBTYPE="btree"
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_DB_OPEN2 1
 EOF
 
   else
     if test "x$ac_cv_lib_c_db_open2" = x ; then # not set
-      cat > conftest.$ac_ext <<EOF
-#line 4567 "configure"
+      cat >conftest.$ac_ext <<_ACEOF
+#line 7390 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 db_open();
-; return 0; }
-EOF
-if { (eval echo configure:4574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7402: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7405: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7408: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7411: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_c_db_open2=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_c_db_open2=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_c_db_open2=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
     fi
     if test "$ac_cv_lib_c_db_open2" = no ; then
       if test "x$ac_cv_lib_db_db_open2" = x ; then # not set
         t_oldLibs="$LIBS"
         LIBS="$LIBS -ldb"
-        cat > conftest.$ac_ext <<EOF
-#line 4590 "configure"
+        cat >conftest.$ac_ext <<_ACEOF
+#line 7426 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 db_open();
-; return 0; }
-EOF
-if { (eval echo configure:4597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7438: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7441: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7444: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7447: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_db_db_open2=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_db_db_open2=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_db_db_open2=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
         LIBS="$t_oldLibs"
         if test "$ac_cv_lib_db_db_open2" = no ; then
           LIBS="$LIBS -ldb2"
-          cat > conftest.$ac_ext <<EOF
-#line 4611 "configure"
+          cat >conftest.$ac_ext <<_ACEOF
+#line 7460 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 db_open();
-; return 0; }
-EOF
-if { (eval echo configure:4618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7472: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7475: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7478: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7481: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_db2_db_open2=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_db2_db_open2=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_db2_db_open2=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
           LIBS="$t_oldLibs"
         fi
         if test "$ac_cv_lib_db2_db_open2" = yes ; then
           LIBDB="-ldb2"
           t_found_at="db2 library"
           DBTYPE="btree"
-          cat >> confdefs.h <<\EOF
+          cat >>confdefs.h <<\EOF
 #define HAVE_DB_OPEN2 1
 EOF
 
@@ -4638,7 +7501,7 @@
           LIBDB="-ldb"
           t_found_at="db library"
           DBTYPE="btree"
-          cat >> confdefs.h <<\EOF
+          cat >>confdefs.h <<\EOF
 #define HAVE_DB_OPEN2 1
 EOF
 
@@ -4647,107 +7510,142 @@
                   "$ac_cv_lib_c_dbopen"    != yes -a \
                   "$ac_cv_lib_db1_dbopen1" != yes -a \
                   "$ac_cv_lib_c_dbopen1"   != yes ; then
-            echo "$ac_t""??? Has <db.h> or <db2/db.h>, but db_open() is not at libc, nor at -ldb or -ldb2 ???" 1>&6
+            echo "$as_me:7513: result: ??? Has <db.h> or <db2/db.h>, but db_open() is not at libc, nor at -ldb or -ldb2 ???" >&5
+echo "${ECHO_T}??? Has <db.h> or <db2/db.h>, but db_open() is not at libc, nor at -ldb or -ldb2 ???" >&6
           fi
         fi
       else
         if test "$ac_cv_lib_db_db_open2" = yes ; then
-          { echo "configure: error: config.cache inconsistency! (db2) Delete it, and redo!" 1>&2; exit 1; }
+          { { echo "$as_me:7519: error: config.cache inconsistency! (db2) Delete it, and redo!" >&5
+echo "$as_me: error: config.cache inconsistency! (db2) Delete it, and redo!" >&2;}
+   { (exit 1); exit 1; }; }
         fi
       fi
     else # Has it in the libc!
       LIBDB=""
       t_found_at="libc(4)"
       DBTYPE="btree"
-      cat >> confdefs.h <<\EOF
+      cat >>confdefs.h <<\EOF
 #define HAVE_DB_OPEN2 1
 EOF
 
     fi
   fi
   if test "$t_found_at" = nowhere ; then
-    echo "$ac_t""Didn't locate SleepyCat DB 2.x  db_open()  anywhere, although <db.h> file exists." 1>&6
+    echo "$as_me:7535: result: Didn't locate SleepyCat DB 2.x  db_open()  anywhere, although <db.h> file exists." >&5
+echo "${ECHO_T}Didn't locate SleepyCat DB 2.x  db_open()  anywhere, although <db.h> file exists." >&6
   else
-    echo "$ac_t""Located SleepyCat DB 2.x  db_open()  routine at $t_found_at" 1>&6
+    echo "$as_me:7538: result: Located SleepyCat DB 2.x  db_open()  routine at $t_found_at" >&5
+echo "${ECHO_T}Located SleepyCat DB 2.x  db_open()  routine at $t_found_at" >&6
     # Does (db->cursor)(...) have 3 or 4 args ?
     if test -z "$ac_cv_db_cursor_4" ; then # not set
       if test "$ac_cv_header_db2_db_h" = yes ; then
-        cat > conftest.$ac_ext <<EOF
-#line 4677 "configure"
+        cat >conftest.$ac_ext <<_ACEOF
+#line 7544 "configure"
 #include "confdefs.h"
 #include <db2/db.h>
-int main() {
+int
+main ()
+{
 DB *db; DBC *curs;
 int err = (db->cursor)(db, NULL, &curs, 0);
-; return 0; }
-EOF
-if { (eval echo configure:4685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7557: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7560: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7563: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7566: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_db_cursor_4=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_db_cursor_4=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_db_cursor_4=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
       elif test "$ac_cv_header_db_h" = yes ; then
-        cat > conftest.$ac_ext <<EOF
-#line 4697 "configure"
+        cat >conftest.$ac_ext <<_ACEOF
+#line 7577 "configure"
 #include "confdefs.h"
 #include <db.h>
-int main() {
+int
+main ()
+{
 DB *db; DBC *curs;
 int err = (db->cursor)(db, NULL, &curs, 0);
-; return 0; }
-EOF
-if { (eval echo configure:4705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7590: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7593: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7596: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7599: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_db_cursor_4=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_db_cursor_4=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_db_cursor_4=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
       else
-        echo "$ac_t""  Hmm.. No <db2/db.h>, nor <db.h> ??" 1>&6
+        echo "$as_me:7609: result:   Hmm.. No <db2/db.h>, nor <db.h> ??" >&5
+echo "${ECHO_T}  Hmm.. No <db2/db.h>, nor <db.h> ??" >&6
       fi
     fi
     if test "$ac_cv_db_cursor_4" = yes ; then
-      echo "$ac_t""  (db->cursor)() method function seems to want 4 args." 1>&6
-      cat >> confdefs.h <<\EOF
+      echo "$as_me:7614: result:   (db->cursor)() method function seems to want 4 args." >&5
+echo "${ECHO_T}  (db->cursor)() method function seems to want 4 args." >&6
+      cat >>confdefs.h <<\EOF
 #define HAVE_DB_CURSOR4 1
 EOF
 
     else
-      echo "$ac_t""  (db->cursor)() method function seems to want 3 args." 1>&6
+      echo "$as_me:7621: result:   (db->cursor)() method function seems to want 3 args." >&5
+echo "${ECHO_T}  (db->cursor)() method function seems to want 3 args." >&6
     fi
   fi
   if test -n "$LIBDB" -a "$LIBDB" = "$LIBNDBM" ; then
         # Well, both at the same library ( -ldb ), which propably
         # means that  <ndbm.h>  is just an emulation mode at BSD DB.
         LIBNDBM=""
-    echo "$ac_t""Note: It looks like your NDBM is actually BSD DB compability wrapper at" 1>&6
-    echo "$ac_t""      libdb -library. If so, your NDBM databases are actually BSD DB_HASH ones.." 1>&6
+    echo "$as_me:7629: result: Note: It looks like your NDBM is actually BSD DB compability wrapper at" >&5
+echo "${ECHO_T}Note: It looks like your NDBM is actually BSD DB compability wrapper at" >&6
+    echo "$as_me:7631: result:       libdb -library. If so, your NDBM databases are actually BSD DB_HASH ones.." >&5
+echo "${ECHO_T}      libdb -library. If so, your NDBM databases are actually BSD DB_HASH ones.." >&6
   fi
   if test "$t_found_at" != nowhere; then
     dblocation="$dblocation;$t_found_at"
   fi
 fi
 
-
 LIBLDAP=""
 INCLLDAP=""
+
 # Check whether --with-ldap-prefix or --without-ldap-prefix was given.
 if test "${with_ldap_prefix+set}" = set; then
   withval="$with_ldap_prefix"
   use_ldap=1
-fi
-
+fi;
 if test "$use_ldap" = 1 ; then
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_LDAP 1
 EOF
 
@@ -4758,14 +7656,14 @@
     fi
 fi
 use_ldap=0
+
 # Check whether --with-ldap-include-dir or --without-ldap-include-dir was given.
 if test "${with_ldap_include_dir+set}" = set; then
   withval="$with_ldap_include_dir"
   use_ldap=1
-fi
-
+fi;
 if test "$use_ldap" = 1 ; then
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_LDAP 1
 EOF
 
@@ -4775,14 +7673,14 @@
     fi
 fi
 use_ldap=0
+
 # Check whether --with-ldap-library-dir or --without-ldap-library-dir was given.
 if test "${with_ldap_library_dir+set}" = set; then
   withval="$with_ldap_library_dir"
   use_ldap=1
-fi
-
+fi;
 if test "$use_ldap" = 1 ; then
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_LDAP 1
 EOF
 
@@ -4794,7 +7692,6 @@
 
 # Lets build a nice single substitute variable
 
-
 # GDBM must be last as if we have LIBDB at the system instead of real
 # LIBNDBM, we still have ndbm routines, but want to use (likely)
 # ones from LIBDB instead of LIBGDBM...
@@ -4828,10 +7725,14 @@
 fi
 
 if test "$dblocation" = "" ; then
-  echo "$ac_t"">>> OOPS!  You don't have any kind of modern DBMs in your" 1>&6
-  echo "$ac_t"">>>        system!  We will not use ancient single-db using" 1>&6
-  echo "$ac_t"">>>        <dbm.h> even if you had it.  Now you have only" 1>&6
-  echo "$ac_t"">>>        relation (external) db types: ordered, unordered" 1>&6
+  echo "$as_me:7728: result: >>> OOPS!  You don't have any kind of modern DBMs in your" >&5
+echo "${ECHO_T}>>> OOPS!  You don't have any kind of modern DBMs in your" >&6
+  echo "$as_me:7730: result: >>>        system!  We will not use ancient single-db using" >&5
+echo "${ECHO_T}>>>        system!  We will not use ancient single-db using" >&6
+  echo "$as_me:7732: result: >>>        <dbm.h> even if you had it.  Now you have only" >&5
+echo "${ECHO_T}>>>        <dbm.h> even if you had it.  Now you have only" >&6
+  echo "$as_me:7734: result: >>>        relation (external) db types: ordered, unordered" >&5
+echo "${ECHO_T}>>>        relation (external) db types: ordered, unordered" >&6
 fi
 
 # ... this is pointless test ...
@@ -4860,92 +7761,106 @@
 	;;
 esac
 
-for ac_hdr in string.h fcntl.h limits.h errno.h unistd.h stdlib.h \
+for ac_header in string.h fcntl.h limits.h errno.h unistd.h stdlib.h \
     sys/param.h sys/statfs.h sys/fstyp.h mnttab.h mntent.h utime.h \
     sys/statvfs.h sys/vfs.h sys/mount.h sys/filsys.h sys/fs_types.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4870: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:7769: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 7775 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:7779: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:7785: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 4875 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:7804: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
-for ac_hdr in sys/utsname.h maillock.h arpa/inet.h
+for ac_header in sys/utsname.h maillock.h arpa/inet.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4910: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:7817: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 4915 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 7823 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:7827: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:7833: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:7852: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
-
-
-
 use_pam=1
+
 # Check whether --with-pam or --without-pam was given.
 if test "${with_pam+set}" = set; then
   withval="$with_pam"
@@ -4956,47 +7871,55 @@
 	 fi
 else
   use_pam=1
-fi
+fi;
 
-
 if test "$use_pam" = 1 ; then
-    for ac_hdr in security/pam_appl.h shadow.h
+
+for ac_header in security/pam_appl.h shadow.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4968: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:7881: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 7887 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:7891: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:7897: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 4973 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:7916: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
@@ -5004,45 +7927,71 @@
 	# Some systems need only "-lpam", others need also "-ldl"
 	t_oldLibs="$LIBS"
 	LIBS="$LIBS -lpam"
-        cat > conftest.$ac_ext <<EOF
-#line 5009 "configure"
+        cat >conftest.$ac_ext <<_ACEOF
+#line 7931 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-int main() {
+int
+main ()
+{
 pam_end(NULL,0);
-; return 0; }
-EOF
-if { (eval echo configure:5016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  AUTHLIB="-lpam" 
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  AUTHLIB="-lpam -ldl"
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7943: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7946: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7949: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7952: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  AUTHLIB="-lpam"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+AUTHLIB="-lpam -ldl"
 fi
-rm -f conftest*;
+rm -f conftest$ac_exeext conftest.$ac_ext;
         LIBS="$t_oldLibs"
     else
         if test "$ac_cv_header_shadow_h" = "yes"; then
-	    cat > conftest.$ac_ext <<EOF
-#line 5030 "configure"
+	    cat >conftest.$ac_ext <<_ACEOF
+#line 7965 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 getspnam("foo");
-; return 0; }
-EOF
-if { (eval echo configure:5037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7977: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7980: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7983: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7986: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   AUTHLIB=""
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  AUTHLIB="-lshadow"
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+AUTHLIB="-lshadow"
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
         else
 	    AUTHLIB=""
         fi
@@ -5055,261 +8004,344 @@
 # The API specs say: <netinet/in.h>,  but some people disagree...
 #
 
-for ac_hdr in netinet/in.h sys/un.h sys/socket.h
+for ac_header in netinet/in.h sys/un.h sys/socket.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5063: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:8010: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8016 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:8020: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:8026: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5068 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:8045: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
 if test "$ac_cv_header_netinet_in_h" = no ; then
-    echo "$ac_t""%%% AIEEE!  NO  <netinet/in.h>  HEADER ?!" 1>&6
+    echo "$as_me:8056: result: %%% AIEEE!  NO  <netinet/in.h>  HEADER ?!" >&5
+echo "${ECHO_T}%%% AIEEE!  NO  <netinet/in.h>  HEADER ?!" >&6
 fi
 
-cat > conftest.$ac_ext <<EOF
-#line 5104 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 8061 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
-int main() {
+int
+main ()
+{
 socklen_t sl = 2;
-; return 0; }
-EOF
-if { (eval echo configure:5112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  cat >> confdefs.h <<\EOF
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8074: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8077: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8080: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8083: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cat >>confdefs.h <<\EOF
 #define HAVE_SOCKLEN_T 1
 EOF
 
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 
 # Check whether --with-ipv6 or --without-ipv6 was given.
 if test "${with_ipv6+set}" = set; then
   withval="$with_ipv6"
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\EOF
 #define INET6 1
 EOF
 
 	ac_with_ipv6=yes
-	
-fi
 
+fi;
 
 if test "$ac_with_ipv6" = yes; then
   if test "x$ac_cv_af_inet6" = "x"; then
-    cat > conftest.$ac_ext <<EOF
-#line 5139 "configure"
+    cat >conftest.$ac_ext <<_ACEOF
+#line 8109 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
-int main() {
+int
+main ()
+{
 int af = AF_INET6;
-; return 0; }
-EOF
-if { (eval echo configure:5147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8122: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8125: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8128: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8131: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_af_inet6=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_af_inet6=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_af_inet6=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
     if test "$ac_cv_af_inet6" = yes; then
-	cat > conftest.$ac_ext <<EOF
-#line 5159 "configure"
+	cat >conftest.$ac_ext <<_ACEOF
+#line 8142 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
-int main() {
+int
+main ()
+{
 /* Has AF_INET6, but does one have all related things ? */
 		     struct in6_addr sin6;
-; return 0; }
-EOF
-if { (eval echo configure:5169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8157: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8160: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8163: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8166: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_struct_in6_addr=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_struct_in6_addr=no
-fi
-rm -f conftest*
-	echo "$ac_t""We have <sys/socket.h> defining  AF_INET6, but do we have properly .." 1>&6
-	echo "$ac_t"".. structured <netinet/in.h> headers with 'struct in6_addr' ? $ac_cv_struct_in6_addr" 1>&6
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_struct_in6_addr=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+	echo "$as_me:8175: result: We have <sys/socket.h> defining  AF_INET6, but do we have properly .." >&5
+echo "${ECHO_T}We have <sys/socket.h> defining  AF_INET6, but do we have properly .." >&6
+	echo "$as_me:8177: result: .. structured <netinet/in.h> headers with 'struct in6_addr' ? $ac_cv_struct_in6_addr" >&5
+echo "${ECHO_T}.. structured <netinet/in.h> headers with 'struct in6_addr' ? $ac_cv_struct_in6_addr" >&6
 	if test "$ac_cv_struct_in6_addr" != yes; then
 
-	    for ac_hdr in netinet/in6.h
+for ac_header in netinet/in6.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5187: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:8184: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8190 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:8194: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:8200: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5192 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:8219: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
 	    if test "$ac_cv_header_netinet_in6_h" != "yes" ; then
-		for ac_hdr in netinet6/in6.h
+
+for ac_header in netinet6/in6.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5228: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:8234: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8240 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:8244: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:8250: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5233 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:8269: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
 		if test "$ac_cv_header_netinet6_in6_h" != "yes" ; then
 
-		    for ac_hdr in linux/in6.h
+for ac_header in linux/in6.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5270: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:8284: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8290 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:8294: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:8300: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5275 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:8319: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
 		    if test "$ac_cv_header_linux_in6_h" != "yes" ; then
-			echo "$ac_t""***  You have a SOME system with  <sys/socket.h>  defining AF_INET6, however" 1>&6
-			echo "$ac_t""***  the system does not have all required includes " 1>&6
-			echo "$ac_t""***  for the compilation to succeed. " 1>&6
-			echo "$ac_t""***  I know of some releases of Linux 2.0.* systems doing this." 1>&6
-			echo "$ac_t""***  If you have one, edit the  <linux/socket.h>,  and" 1>&6
-			echo "$ac_t""***  remove the define of   AF_INET6 " 1>&6
-			{ echo "configure: error: AF_INET6 feature error" 1>&2; exit 1; }
+			echo "$as_me:8330: result: ***  You have a SOME system with  <sys/socket.h>  defining AF_INET6, however" >&5
+echo "${ECHO_T}***  You have a SOME system with  <sys/socket.h>  defining AF_INET6, however" >&6
+			echo "$as_me:8332: result: ***  the system does not have all required includes " >&5
+echo "${ECHO_T}***  the system does not have all required includes " >&6
+			echo "$as_me:8334: result: ***  for the compilation to succeed. " >&5
+echo "${ECHO_T}***  for the compilation to succeed. " >&6
+			echo "$as_me:8336: result: ***  I know of some releases of Linux 2.0.* systems doing this." >&5
+echo "${ECHO_T}***  I know of some releases of Linux 2.0.* systems doing this." >&6
+			echo "$as_me:8338: result: ***  If you have one, edit the  <linux/socket.h>,  and" >&5
+echo "${ECHO_T}***  If you have one, edit the  <linux/socket.h>,  and" >&6
+			echo "$as_me:8340: result: ***  remove the define of   AF_INET6 " >&5
+echo "${ECHO_T}***  remove the define of   AF_INET6 " >&6
+			{ { echo "$as_me:8342: error: AF_INET6 feature error" >&5
+echo "$as_me: error: AF_INET6 feature error" >&2;}
+   { (exit 1); exit 1; }; }
 		    fi
 		fi
 	    fi
@@ -5321,19 +8353,19 @@
 	# thus we can (with confidence) do following, and only one is
 	# defined as an end result..
 	if test "$ac_cv_header_netinet_in6_h" = yes; then
-	    cat >> confdefs.h <<\EOF
+	    cat >>confdefs.h <<\EOF
 #define HAVE_NETINET_IN6_H 1
 EOF
 
 	fi
 	if test "$ac_cv_header_netinet6_in6_h" = yes; then
-	    cat >> confdefs.h <<\EOF
+	    cat >>confdefs.h <<\EOF
 #define HAVE_NETINET6_IN6_H 1
 EOF
 
 	fi
 	if test "$ac_cv_header_linux_in6_h" = yes; then
-	    cat >> confdefs.h <<\EOF
+	    cat >>confdefs.h <<\EOF
 #define HAVE_LINUX_IN6_H 1
 EOF
 
@@ -5342,175 +8374,210 @@
   fi
 fi # End of:  --with-ipv6
 
-
-for ac_hdr in varargs.h stdarg.h
+for ac_header in varargs.h stdarg.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5351: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:8380: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8386 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:8390: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:8396: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5356 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:8415: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
 for ac_func in flock lockf lstat
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5390: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:8428: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5395 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8434 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
-int main() {
-
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8465: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8468: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8471: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8474: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:8484: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:5418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
-
 without_fsync=0
+
 # Check whether --with-fsync or --without-fsync was given.
 if test "${with_fsync+set}" = set; then
   withval="$with_fsync"
   without_fsync=1
-fi
-
+fi;
 if test $without_fsync = 0; then
-	for ac_func in fsync
+
+for ac_func in fsync
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5454: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:8506: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5459 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8512 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8543: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8546: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8549: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8552: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:8562: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:5482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
 fi
 
 without_maillock=0
+
 # Check whether --with-maillock or --without-maillock was given.
 if test "${with_maillock+set}" = set; then
   withval="$with_maillock"
   without_maillock=1
-fi
-
+fi;
 if test without_maillock = 0; then
 	#
 #  Test for SVR4  maillock()/mailunlock() mechanism (Solaris et.al.)
@@ -5522,44 +8589,72 @@
   if test "$ac_cv_header_maillock_h" = "yes" ; then
     t_oldLibs="$LIBS"
     LIBS="$LIBS -lmail"
-    cat > conftest.$ac_ext <<EOF
-#line 5527 "configure"
+    cat >conftest.$ac_ext <<_ACEOF
+#line 8593 "configure"
 #include "confdefs.h"
 #include <maillock.h>
-int main() {
+int
+main ()
+{
 mailunlock();
-; return 0; }
-EOF
-if { (eval echo configure:5534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8605: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8608: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8611: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8614: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
 	ac_cv_func_maillock_lmail=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
     LIBS="$t_oldLibs"
     if test "x$ac_cv_func_maillock_lmail" = "x"; then
       # On some Debian systems this exists as  -llockfile  :-/
       LIBS="$LIBS -llockfile"
-      cat > conftest.$ac_ext <<EOF
-#line 5548 "configure"
+      cat >conftest.$ac_ext <<_ACEOF
+#line 8628 "configure"
 #include "confdefs.h"
 #include <maillock.h>
-int main() {
+int
+main ()
+{
 mailunlock();
-; return 0; }
-EOF
-if { (eval echo configure:5555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8640: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8643: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8646: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8649: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
 		ac_cv_func_maillock_llockfile=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
       LIBS="$t_oldLibs"
     fi
   else
@@ -5568,748 +8663,927 @@
   fi
 fi
 if test "$ac_cv_func_maillock_lmail" = "yes"; then
-	cat >> confdefs.h <<\EOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_MAILLOCK 1
 EOF
 
 	LIBMAIL="-lmail"
-	echo "$ac_t""System has  maillock()  with -lmail" 1>&6
+	echo "$as_me:8671: result: System has  maillock()  with -lmail" >&5
+echo "${ECHO_T}System has  maillock()  with -lmail" >&6
 else
   if test "$ac_cv_func_maillock_llockfile" = "yes"; then
-	cat >> confdefs.h <<\EOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_MAILLOCK 1
 EOF
 
 	LIBMAIL="-llockfile"
-	echo "$ac_t""System has  maillock()  with -llockfile" 1>&6
+	echo "$as_me:8680: result: System has  maillock()  with -llockfile" >&5
+echo "${ECHO_T}System has  maillock()  with -llockfile" >&6
   else
-	cat >> confdefs.h <<\EOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_DOTLOCK 1
 EOF
 
-	echo "$ac_t""Using traditional UNIX 'dot-lock' mailbox locks" 1>&6
+	echo "$as_me:8687: result: Using traditional UNIX 'dot-lock' mailbox locks" >&5
+echo "${ECHO_T}Using traditional UNIX 'dot-lock' mailbox locks" >&6
   fi
-fi  
+fi
 else
-	cat >> confdefs.h <<\EOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_DOTLOCK 1
 EOF
 
 fi
-              
 
 for ac_func in mkdir mktime mkstemp rename rmdir strcpy strdup strstr \
 		strchr strrchr setvbuf strerror strsignal setreuid \
 		setregid sigprocmask sigpending sigsuspend gethostid
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5607: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:8703: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5612 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8709 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8740: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8743: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8746: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8749: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:8759: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:5635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
 # If the system does not have the following (library) calls,
 # we use emulations (replacements):
+
 for ac_func in mkdir mktime rename rmdir strcpy strdup strstr \
 		 strchr strrchr setvbuf strerror strsignal strtoul
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5665: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:8776: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5670 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8782 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
-int main() {
-
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8813: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8816: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8819: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8822: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:8832: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:5693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
 else
-  echo "$ac_t""no" 1>&6
-LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
+  LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
 fi
 done
-
 
-
-echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
-echo "configure:5721: checking for sys_siglist declaration in signal.h or unistd.h" >&5
-if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:8844: checking for sys_siglist declaration in signal.h or unistd.h" >&5
+echo $ECHO_N "checking for sys_siglist declaration in signal.h or unistd.h... $ECHO_C" >&6
+if test "${ac_cv_decl_sys_siglist+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5726 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8850 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
 /* NetBSD declares sys_siglist in unistd.h.  */
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
 #endif
-int main() {
+
+int
+main ()
+{
 char *msg = *(sys_siglist + 1);
-; return 0; }
-EOF
-if { (eval echo configure:5738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8868: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8871: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8874: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8877: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_decl_sys_siglist=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_decl_sys_siglist=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_decl_sys_siglist=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
+echo "$as_me:8887: result: $ac_cv_decl_sys_siglist" >&5
+echo "${ECHO_T}$ac_cv_decl_sys_siglist" >&6
 if test $ac_cv_decl_sys_siglist = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define SYS_SIGLIST_DECLARED 1
 EOF
 
 fi
 
+echo "$as_me:8897: checking existence of char **sys_siglist" >&5
+echo $ECHO_N "checking existence of char **sys_siglist... $ECHO_C" >&6
+if test "${ac_cv_arr_sys_siglist+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
-echo $ac_n "checking existence of char **sys_siglist""... $ac_c" 1>&6
-echo "configure:5760: checking existence of char **sys_siglist" >&5
-if eval "test \"`echo '$''{'ac_cv_arr_sys_siglist'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-cat > conftest.$ac_ext <<EOF
-#line 5766 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 8904 "configure"
 #include "confdefs.h"
 extern char *sys_siglist[]; static char *s;
-int main() {
-s = sys_siglist[2]; 
-; return 0; }
-EOF
-if { (eval echo configure:5773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cat >> confdefs.h <<\EOF
+int
+main ()
+{
+s = sys_siglist[2];
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8916: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8919: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8922: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8925: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_arr_sys_siglist=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+
+fi
+echo "$as_me:8935: result: $ac_cv_arr_sys_siglist" >&5
+echo "${ECHO_T}$ac_cv_arr_sys_siglist" >&6
+if test "$ac_cv_arr_sys_siglist" = yes ; then
+    cat >>confdefs.h <<\EOF
 #define HAVE_SYS_SIGLIST 1
 EOF
 
-		 ac_cv_arr_sys_siglist=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-
 fi
 
-echo "$ac_t""$ac_cv_arr_sys_siglist" 1>&6
-
-
 # Additional tests for the emulations..
+
 for ac_func in index rindex
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5795: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:8949: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5800 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8955 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8986: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8989: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8992: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8995: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:9005: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:5823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
 # more tests..
+
 for ac_func in endgrent fchdir ftime getcwd getgroups setgroups \
 		getmntinfo gettimeofday isascii memcpy memchr mkfifo   \
 		getpgrp setsid seteuid setuid
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5853: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:9022: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5858 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9028 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
-int main() {
-
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9059: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9062: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9065: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9068: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:9078: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:5881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
 for ac_func in setrlimit fchown utimes utime sysconf fpathconf
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5908: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:9091: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5913 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9097 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
-int main() {
-
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9128: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9131: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9134: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9137: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:9147: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:5936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
 # Networking stuff is in deep trouble, if sockets are not found..
-for ac_hdr in netdb.h syslog.h sys/resource.h \
+
+for ac_header in netdb.h syslog.h sys/resource.h \
 		protocols/rwhod.h select.h sys/select.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5966: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:9163: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9169 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:9173: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:9179: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5971 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:9198: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
-for ac_hdr in ifaddrs.h
+for ac_header in ifaddrs.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6006: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:9211: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6011 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9217 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:9221: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:9227: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:9246: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
 for ac_func in select syslog getdtablesize setpriority
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6045: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:9259: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6050 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9265 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9296: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9299: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9302: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9305: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:9315: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:6073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
 for ac_func in getifaddrs freeifaddrs
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6100: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:9328: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6105 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9334 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9365: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9368: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9371: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9374: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:9384: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:6128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
-
 #
 # Test to see, if we have BSD4.4  sa_len -field in the "struct sockaddr*"
 #
 #
 # Test to see, if we have BSD4.4  sa_len -field in the "struct sockaddr*"
 #
-echo $ac_n "checking for 'sa_len' in 'struct sockaddr'""... $ac_c" 1>&6
-echo "configure:6160: checking for 'sa_len' in 'struct sockaddr'" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_sa_len'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:9400: checking for 'sa_len' in 'struct sockaddr'" >&5
+echo $ECHO_N "checking for 'sa_len' in 'struct sockaddr'... $ECHO_C" >&6
+if test "${ac_cv_struct_sa_len+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6165 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9406 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
-int main() {
-struct sockaddr sa; sa.sa_len = 0; 
-; return 0; }
-EOF
-if { (eval echo configure:6173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+int
+main ()
+{
+struct sockaddr sa; sa.sa_len = 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:9419: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:9422: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:9425: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9428: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_struct_sa_len=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_struct_sa_len=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_struct_sa_len=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_struct_sa_len" 1>&6
+echo "$as_me:9438: result: $ac_cv_struct_sa_len" >&5
+echo "${ECHO_T}$ac_cv_struct_sa_len" >&6
 if test "$ac_cv_struct_sa_len" = yes; then
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\EOF
 #define HAVE_SA_LEN 1
 EOF
 
 fi
 
-
-echo $ac_n "checking for res_init""... $ac_c" 1>&6
-echo "configure:6195: checking for res_init" >&5
-if eval "test \"`echo '$''{'ac_cv_func_res_init'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:9447: checking for res_init" >&5
+echo $ECHO_N "checking for res_init... $ECHO_C" >&6
+if test "${ac_cv_func_res_init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6200 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9453 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char res_init(); below.  */
+    which can conflict with char res_init (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char res_init();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char res_init ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_res_init) || defined (__stub___res_init)
 choke me
 #else
-res_init();
+f = res_init;
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:6223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_res_init=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_res_init=no"
-fi
-rm -f conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9484: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9487: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9490: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9493: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_res_init=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_res_init=no
 fi
-
-if eval "test \"`echo '$ac_cv_func_'res_init`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
+echo "$as_me:9503: result: $ac_cv_func_res_init" >&5
+echo "${ECHO_T}$ac_cv_func_res_init" >&6
   # Can be found without any libs ?  Or needs BIND libresolv ?
-echo $ac_n "checking for res_mkquery""... $ac_c" 1>&6
-echo "configure:6243: checking for res_mkquery" >&5
-if eval "test \"`echo '$''{'ac_cv_func_res_mkquery'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:9506: checking for res_mkquery" >&5
+echo $ECHO_N "checking for res_mkquery... $ECHO_C" >&6
+if test "${ac_cv_func_res_mkquery+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6248 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9512 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char res_mkquery(); below.  */
+    which can conflict with char res_mkquery (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char res_mkquery();
+   builtin and then its argument prototype would still apply.  */
+char res_mkquery ();
+char (*f) ();
 
-int main() {
-
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_res_mkquery) || defined (__stub___res_mkquery)
 choke me
 #else
-res_mkquery();
+f = res_mkquery;
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:6271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_res_mkquery=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_res_mkquery=no"
-fi
-rm -f conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9543: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9546: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9549: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9552: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_res_mkquery=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_res_mkquery=no
 fi
-
-if eval "test \"`echo '$ac_cv_func_'res_mkquery`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
+echo "$as_me:9562: result: $ac_cv_func_res_mkquery" >&5
+echo "${ECHO_T}$ac_cv_func_res_mkquery" >&6
 
-
-
-
-
 use_resolvopt=0
+
 # Check whether --with-bundled-libresolv or --without-bundled-libresolv was given.
 if test "${with_bundled_libresolv+set}" = set; then
   withval="$with_bundled_libresolv"
   use_resolvopt=1
-fi
-
+fi;
 if test "$use_resolvopt" = 0 ; then
     if test $ac_cv_func_res_mkquery = yes ; then
 	LIBRESOLV="" #  res_mkquery() is at system libc
-	echo "$ac_t""Using no -lresolv; res_mkquery() in libc ?" 1>&6
+	echo "$as_me:9575: result: Using no -lresolv; res_mkquery() in libc ?" >&5
+echo "${ECHO_T}Using no -lresolv; res_mkquery() in libc ?" >&6
     else
 	LIBRESOLV="-lresolv"
-	echo "$ac_t""Using system supplied -lresolv -- hope it works.." 1>&6
+	echo "$as_me:9579: result: Using system supplied -lresolv -- hope it works.." >&5
+echo "${ECHO_T}Using system supplied -lresolv -- hope it works.." >&6
     fi
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_GETHOSTBYNAME 1
 EOF
 
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_RESOLVER 1
 EOF
 
@@ -6318,54 +9592,68 @@
 else
     # We have bundled BIND 4.9.4 resolver, which can make things
     # so much simpler to ourselves (except at BSD machines..)
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_GETHOSTBYNAME 1
 EOF
 
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_RESOLVER 1
 EOF
 
     LIBRESOLV="-lresolv"
     INCLRESOLV='-I$(TOPDIR)/libresolv'
     LIBRESOLVA="libresolv.a"
-    echo "$ac_t""Using bundled (bind 4.9.4-REL) libresolv" 1>&6
+    echo "$as_me:9606: result: Using bundled (bind 4.9.4-REL) libresolv" >&5
+echo "${ECHO_T}Using bundled (bind 4.9.4-REL) libresolv" >&6
 fi
 
 #
 # Test to see, if we have cd and ad fields in "struct HEADER"
 #
-echo $ac_n "checking for cd and ad in HEADER struct (BIND 8)""... $ac_c" 1>&6
-echo "configure:6340: checking for cd and ad in HEADER struct (BIND 8)" >&5
-if eval "test \"`echo '$''{'zm_cv_struct_HEADER_cd_ac'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:9613: checking for cd and ad in HEADER struct (BIND 8)" >&5
+echo $ECHO_N "checking for cd and ad in HEADER struct (BIND 8)... $ECHO_C" >&6
+if test "${zm_cv_struct_HEADER_cd_ac+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6345 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9619 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/nameser.h>
-int main() {
+int
+main ()
+{
 struct HEADER a; a.ad = a.cd = 0;
-; return 0; }
-EOF
-if { (eval echo configure:6355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:9634: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:9637: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:9640: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9643: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   zm_cv_struct_HEADER_cd_ac=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  zm_cv_struct_HEADER_cd_ac=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+zm_cv_struct_HEADER_cd_ac=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$zm_cv_struct_HEADER_cd_ac" 1>&6
+echo "$as_me:9653: result: $zm_cv_struct_HEADER_cd_ac" >&5
+echo "${ECHO_T}$zm_cv_struct_HEADER_cd_ac" >&6
 if test "$zm_cv_struct_HEADER_cd_ac" = yes; then
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_HEADER_CD_AD 1
 EOF
 
@@ -6377,247 +9665,334 @@
 #    The hallmark is  connect()  routine (we presume)
 #
 ac_cv_libsocket_both=1
-echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:6382: checking for connect" >&5
-if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:9668: checking for connect" >&5
+echo $ECHO_N "checking for connect... $ECHO_C" >&6
+if test "${ac_cv_func_connect+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6387 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9674 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char connect(); below.  */
+    which can conflict with char connect (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char connect();
+   builtin and then its argument prototype would still apply.  */
+char connect ();
+char (*f) ();
 
-int main() {
-
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_connect) || defined (__stub___connect)
 choke me
 #else
-connect();
+f = connect;
 #endif
-
-; return 0; }
-EOF
-if { (eval echo configure:6410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_connect=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_connect=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9705: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9708: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9711: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9714: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_connect=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_connect=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:9724: result: $ac_cv_func_connect" >&5
+echo "${ECHO_T}$ac_cv_func_connect" >&6
+if test $ac_cv_func_connect = yes; then
   ac_cv_libsocket_both=0
-else
-  echo "$ac_t""no" 1>&6
 fi
 
-echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:6430: checking for gethostbyname" >&5
-if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:9730: checking for gethostbyname" >&5
+echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
+if test "${ac_cv_func_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6435 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9736 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char gethostbyname(); below.  */
+    which can conflict with char gethostbyname (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char gethostbyname();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char gethostbyname ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
 choke me
 #else
-gethostbyname();
+f = gethostbyname;
 #endif
-
-; return 0; }
-EOF
-if { (eval echo configure:6458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_gethostbyname=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_gethostbyname=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9767: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9770: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9773: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9776: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_gethostbyname=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_gethostbyname=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:9786: result: $ac_cv_func_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
+if test $ac_cv_func_gethostbyname = yes; then
   ac_cv_libsocket_both=0
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 if test "$ac_cv_libsocket_both" = 1 ; then
   # Check cache
   if test "$ac_cv_func_socket_lxnet" = yes ; then
-    echo "$ac_t""need -lxnet library (cached)" 1>&6
+    echo "$as_me:9795: result: need -lxnet library (cached)" >&5
+echo "${ECHO_T}need -lxnet library (cached)" >&6
     LIBSOCKET="-lnsl -lsocket -lxnet"
   else
   if test "$ac_cv_func_socket_lsocket" = yes ; then
-    echo "$ac_t""need -lsocket library (cached)" 1>&6
+    echo "$as_me:9800: result: need -lsocket library (cached)" >&5
+echo "${ECHO_T}need -lsocket library (cached)" >&6
     LIBSOCKET="-lsocket"
     if test "$ac_cv_func_gethostbyname_lnsl" = yes ; then
 	LIBSOCKET="-lnsl -lsocket"
     fi
   else
     # Well, will this work ?  SysVR4, but not Sun Solaris ?
-    echo $ac_n "checking for connect in -lxnet""... $ac_c" 1>&6
-echo "configure:6492: checking for connect in -lxnet" >&5
-ac_lib_var=`echo xnet'_'connect | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    echo "$as_me:9808: checking for connect in -lxnet" >&5
+echo $ECHO_N "checking for connect in -lxnet... $ECHO_C" >&6
+if test "${ac_cv_lib_xnet_connect+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lxnet  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6500 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9816 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char connect();
-
-int main() {
-connect()
-; return 0; }
-EOF
-if { (eval echo configure:6511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+   builtin and then its argument prototype would still apply.  */
+char connect ();
+int
+main ()
+{
+connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9835: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9838: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9841: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9844: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_xnet_connect=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_xnet_connect=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9855: result: $ac_cv_lib_xnet_connect" >&5
+echo "${ECHO_T}$ac_cv_lib_xnet_connect" >&6
+if test $ac_cv_lib_xnet_connect = yes; then
   LIBSOCKET="-lnsl -lsocket -lxnet"
 				 ac_cv_func_socket_lsocket=no
 				 ac_cv_func_socket_lxnet=yes
 else
-  echo "$ac_t""no" 1>&6
 
-      echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:6533: checking for connect in -lsocket" >&5
-ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+      echo "$as_me:9863: checking for connect in -lsocket" >&5
+echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
+if test "${ac_cv_lib_socket_connect+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6541 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9871 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char connect();
-
-int main() {
-connect()
-; return 0; }
-EOF
-if { (eval echo configure:6552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+   builtin and then its argument prototype would still apply.  */
+char connect ();
+int
+main ()
+{
+connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9890: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9893: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9896: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9899: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_socket_connect=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_socket_connect=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9910: result: $ac_cv_lib_socket_connect" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
+if test $ac_cv_lib_socket_connect = yes; then
   LIBSOCKET="-lsocket"
 				     ac_cv_func_socket_lsocket=yes
 else
-  echo "$ac_t""no" 1>&6
-ac_cv_func_socket_lsocket=no
+  ac_cv_func_socket_lsocket=no
 fi
 
       if test "$ac_cv_func_socket_lsocket" = yes ; then
         t_oldLibs="$LIBS"
         LIBS="$LIBS -lsocket $LIBRESOLV"
-        cat > conftest.$ac_ext <<EOF
-#line 6578 "configure"
+        cat >conftest.$ac_ext <<_ACEOF
+#line 9923 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 gethostbyname();
-; return 0; }
-EOF
-if { (eval echo configure:6585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9935: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9938: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9941: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9944: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
 	  LIBS="$LIBS -lnsl" # Add this Solaris library..
-	  cat > conftest.$ac_ext <<EOF
-#line 6594 "configure"
+	  cat >conftest.$ac_ext <<_ACEOF
+#line 9953 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 gethostbyname();
-; return 0; }
-EOF
-if { (eval echo configure:6601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9965: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9968: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9971: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9974: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
 			LIBSOCKET="-lsocket -lnsl"
 			ac_cv_func_gethostbyname_lnsl=yes
-		
+
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  
-		   { echo "configure: error: Weird, '$LIBS' not enough to find  gethostnyname() ?!" 1>&2; exit 1; }
-		
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+		   { { echo "$as_me:9984: error: Weird, '$LIBS' not enough to find  gethostnyname() ?!" >&5
+echo "$as_me: error: Weird, '$LIBS' not enough to find  gethostnyname() ?!" >&2;}
+   { (exit 1); exit 1; }; }
+
 fi
-rm -f conftest*
-	  
+rm -f conftest$ac_exeext conftest.$ac_ext
+
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
         LIBS="$t_oldLibs"
       fi
-    
+
 fi
 
   fi
@@ -6633,28 +10008,43 @@
   # will not fail on other systems...  It did! It did!
   # Many systems don't have idemponent headers, they need specific
   # includes before latter ones, or the latter ones won't be successful...
-  cat > conftest.$ac_ext <<EOF
-#line 6638 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10012 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/nameser.h>
 #include <resolv.h>
-int main() {
+int
+main ()
+{
 _res.options = RES_INIT;
-; return 0; }
-EOF
-if { (eval echo configure:6649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10028: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10031: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10034: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10037: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_var__res_options=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -f conftest*;
+rm -f conftest$ac_exeext conftest.$ac_ext;
   if test "$ac_cv_var__res_options" != "yes"; then
-    echo "$ac_t""Can't do without  -lresolv  to link resolver's  _res.options" 1>&6
+    echo "$as_me:10046: result: Can't do without  -lresolv  to link resolver's  _res.options" >&5
+echo "${ECHO_T}Can't do without  -lresolv  to link resolver's  _res.options" >&6
     LIBRESOLV="-lresolv"
   fi
   LIBS="$t_oldLibs"
@@ -6662,58 +10052,73 @@
 
 # See about the routines that possibly exist at the libraries..
 LIBS="$t_oldLibs $LIBSOCKET"
+
 for ac_func in socket socketpair
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6669: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:10059: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6674 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10065 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10096: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10099: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10102: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10105: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:10115: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:6697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
@@ -6721,128 +10126,193 @@
 
 if test "$ac_cv_func_socket" = no -a "$LIBSOCKET" != ""; then
   LIBS="$LIBS $LIBSOCKET"
-  cat > conftest.$ac_ext <<EOF
-#line 6726 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10130 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 socket();
-; return 0; }
-EOF
-if { (eval echo configure:6733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10142: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10145: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10148: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10151: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_func_socket=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
   if test $ac_cv_func_socket = yes; then
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_SOCKET 1
 EOF
 
-    echo "$ac_t""Has  socket()  when using  $LIBSOCKET" 1>&6
+    echo "$as_me:10164: result: Has  socket()  when using  $LIBSOCKET" >&5
+echo "${ECHO_T}Has  socket()  when using  $LIBSOCKET" >&6
   fi
   LIBS="$t_oldLibs"
 fi
 if test "$ac_cv_func_socketpair" = no -a "$LIBSOCKET" != ""; then
   LIBS="$LIBS $LIBSOCKET"
-  cat > conftest.$ac_ext <<EOF
-#line 6753 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10172 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 socketpair();
-; return 0; }
-EOF
-if { (eval echo configure:6760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10184: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10187: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10190: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10193: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_func_socketpair=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
   if test $ac_cv_func_socketpair = yes; then
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_SOCKETPAIR 1
 EOF
 
-    echo "$ac_t""Has  socketpair()  when using  $LIBSOCKET" 1>&6
+    echo "$as_me:10206: result: Has  socketpair()  when using  $LIBSOCKET" >&5
+echo "${ECHO_T}Has  socketpair()  when using  $LIBSOCKET" >&6
   fi
   LIBS="$t_oldLibs"
 fi
 
 ac_with_ipv6_replacement_libc=0
+
 # Check whether --with-ipv6-replacement-libc or --without-ipv6-replacement-libc was given.
 if test "${with_ipv6_replacement_libc+set}" = set; then
   withval="$with_ipv6_replacement_libc"
   ac_with_ipv6_replacement_libc=1
-fi
-
+fi;
 
 if test "$ac_with_ipv6_replacement_libc" = 1 ; then
   LIBOBJS="$LIBOBJS inet_ntop.o inet_pton.o getaddrinfo.o getnameinfo.o gai_strerror.o"
-  
+
+  cat >>confdefs.h <<\EOF
+#define HAVE_GETNAMEINFO 1
+EOF
+
+  cat >>confdefs.h <<\EOF
+#define HAVE_GETADDRINFO 1
+EOF
+
+  cat >>confdefs.h <<\EOF
+#define HAVE__GETADDRINFO_ 1
+EOF
+
+  cat >>confdefs.h <<\EOF
+#define HAVE_INET_NTOP 1
+EOF
+
+  cat >>confdefs.h <<\EOF
+#define HAVE_INET_PTON 1
+EOF
+
 else
 
   t_oldLibs="$LIBS"
   LIBS="$LIBS $LIBSOCKET"
 
   #  Following stuff may exist in our LIBC, or in separate -linet6
-  for ac_func in inet_ntop inet_pton getaddrinfo getnameinfo gai_strerror
+
+for ac_func in inet_ntop inet_pton getaddrinfo getnameinfo gai_strerror
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6798: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:10253: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6803 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10259 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10290: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10293: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10296: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10299: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:10309: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:6826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
@@ -6850,29 +10320,44 @@
   #  THEN call the AC_REPLACE_FUNCS()
   if test "$ac_cv_func_gai_strerror" = no ; then
     LIBS="$LIBS -linet6"
-    cat > conftest.$ac_ext <<EOF
-#line 6855 "configure"
+    cat >conftest.$ac_ext <<_ACEOF
+#line 10324 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 gai_strerror();
-; return 0; }
-EOF
-if { (eval echo configure:6862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10336: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10339: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10342: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10345: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_func_gai_strerror=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
     LIBS="$t_oldLibs"
     if test "$ac_cv_func_gai_strerror" = yes; then
       LIBSOCKET="$LIBSOCKET -linet6"
-      echo "$ac_t""Has IPv6 API  gai_strerror()  when using  $LIBSOCKET" 1>&6
+      echo "$as_me:10356: result: Has IPv6 API  gai_strerror()  when using  $LIBSOCKET" >&5
+echo "${ECHO_T}Has IPv6 API  gai_strerror()  when using  $LIBSOCKET" >&6
     else
       LIBOBJS="$LIBOBJS inet_ntop.o inet_pton.o getaddrinfo.o getnameinfo.o gai_strerror.o"
-      
+
     fi
   fi
 
@@ -6880,7 +10365,6 @@
 
 fi
 
-
 # Check whether --with-rfc822-tabs or --without-rfc822-tabs was given.
 if test "${with_rfc822_tabs+set}" = set; then
   withval="$with_rfc822_tabs"
@@ -6891,16 +10375,15 @@
 	 fi
 else
   use_rfc822_tabs=1
-fi
-
+fi;
 RFC822TABS="$use_rfc822_tabs"
-echo "$ac_t""RFC-822 TABs setting: $use_rfc822_tabs" 1>&6
-
-
+echo "$as_me:10380: result: RFC-822 TABs setting: $use_rfc822_tabs" >&5
+echo "${ECHO_T}RFC-822 TABs setting: $use_rfc822_tabs" >&6
 
 LIBWRAP=""
 INCLWRAP=""
 use_tcpwrappers=0
+
 # Check whether --with-tcp-wrappers or --without-tcp-wrappers was given.
 if test "${with_tcp_wrappers+set}" = set; then
   withval="$with_tcp_wrappers"
@@ -6909,52 +10392,59 @@
 	 else
 	   use_tcpwrappers=1
 	 fi
-fi
+fi;
 
-
 t_oldLibs="$LIBS"
 t_oldCpp="$CPPFLAGS"
 
 if test "$use_tcpwrappers" != 0 ; then
     if test "$use_tcpwrappers" = 2 ; then
 
-	for ac_hdr in tcpd.h
+for ac_header in tcpd.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6926: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:10406: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10412 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:10416: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:10422: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6931 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:10441: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
@@ -6987,11 +10477,11 @@
 	fi
 	LIBS="$LIBS $LIBSOCKET $LIBWRAP"
 	CPPFLAGS="$CPPFLAGS $INCLWRAP"
-	if eval "test \"`echo '$''{'ac_cv_lib_tcpwrap'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+	if test "${ac_cv_lib_tcpwrap+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6995 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10484 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <sys/types.h>
@@ -7000,33 +10490,47 @@
 #include <tcpd.h>
 struct request_info request;
 int deny_severity, allow_severity;
-int main() {
+int
+main ()
+{
 hosts_access(&request);
-; return 0; }
-EOF
-if { (eval echo configure:7008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10502: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10505: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10508: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10511: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_tcpwrap=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_tcpwrap=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_tcpwrap=no
 fi
-rm -f conftest*
-	
+rm -f conftest$ac_exeext conftest.$ac_ext
+
 fi
 
 	if test "$ac_cv_lib_tcpwrap" = yes; then
-	    echo "$ac_t""Tcp-wrapper available at $wraploc: -lwrap !" 1>&6;
+	    echo "$as_me:10524: result: Tcp-wrapper available at $wraploc: -lwrap !" >&5
+echo "${ECHO_T}Tcp-wrapper available at $wraploc: -lwrap !" >&6;
 	else
 	    LIBS="$t_oldLibs $LIBSOCKET -lnsl $LIBWRAP"
 	    CPPFLAGS="$CPPFLAGS $INCLWRAP"
-	    if eval "test \"`echo '$''{'ac_cv_lib_tcpwrap_nsl'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+	    if test "${ac_cv_lib_tcpwrap_nsl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7030 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10533 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <sys/types.h>
@@ -7035,30 +10539,45 @@
 #include <tcpd.h>
 struct request_info request;
 int deny_severity, allow_severity;
-int main() {
+int
+main ()
+{
 hosts_access(&request);
-; return 0; }
-EOF
-if { (eval echo configure:7043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10551: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10554: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10557: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10560: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_tcpwrap_nsl=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_tcpwrap_nsl=no
-fi
-rm -f conftest*
-	    
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_tcpwrap_nsl=no
 fi
+rm -f conftest$ac_exeext conftest.$ac_ext
 
+fi
 
 	    if test "$ac_cv_lib_tcpwrap_nsl" = yes; then
-		echo "$ac_t""Tcp-wrapper available at $wraploc: -lwrap !" 1>&6;
-		echo "$ac_t""  NEEDED TO ADD  -lnsl  TO THE LIBSOCKET!" 1>&6;
-		LIBSOCKET="$LIBSOCKET -lnsl"		
+		echo "$as_me:10573: result: Tcp-wrapper available at $wraploc: -lwrap !" >&5
+echo "${ECHO_T}Tcp-wrapper available at $wraploc: -lwrap !" >&6;
+		echo "$as_me:10575: result:   NEEDED TO ADD  -lnsl  TO THE LIBSOCKET!" >&5
+echo "${ECHO_T}  NEEDED TO ADD  -lnsl  TO THE LIBSOCKET!" >&6;
+		LIBSOCKET="$LIBSOCKET -lnsl"
 	    else
-		echo "$ac_t""No tcp-wrapper available at system default locations ?" 1>&6
+		echo "$as_me:10579: result: No tcp-wrapper available at system default locations ?" >&5
+echo "${ECHO_T}No tcp-wrapper available at system default locations ?" >&6
 		LIBWRAP=""
 		INCLWRAP=""
 	    fi
@@ -7067,16 +10586,17 @@
       LIBWRAP="-L$withval -lwrap"
       INCLWRAP="-I$withval"
       unset ac_cv_lib_tcpwrap
-      cat >> confdefs.h <<\EOF
+      cat >>confdefs.h <<\EOF
 #define HAVE_TCPD_H 1
 EOF
 
-      echo "$ac_t""Using tcp-wrappers at directory: $withval" 1>&6;
+      echo "$as_me:10593: result: Using tcp-wrappers at directory: $withval" >&5
+echo "${ECHO_T}Using tcp-wrappers at directory: $withval" >&6;
     fi
 fi
 
 if test -n "$LIBWRAP"; then
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\EOF
 #define USE_TCPWRAPPER 1
 EOF
 
@@ -7085,38 +10605,33 @@
 CPPFLAGS="$t_oldCpp"
 LIBS="$t_oldLibs"
 
-
-
 PRIVATEMBOX=""
+
 # Check whether --with-privatembox or --without-privatembox was given.
 if test "${with_privatembox+set}" = set; then
   withval="$with_privatembox"
   PRIVATEMBOX="private/"
-fi
-
+fi;
 
 # Check whether --with-mboxquotacheck or --without-mboxquotacheck was given.
 if test "${with_mboxquotacheck+set}" = set; then
   withval="$with_mboxquotacheck"
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\EOF
 #define CHECK_MB_SIZE 1
 EOF
-
-fi
 
+fi;
 
-
 PRIVATEAUTH=""
+
 # Check whether --with-privateauth or --without-privateauth was given.
 if test "${with_privateauth+set}" = set; then
   withval="$with_privateauth"
   PRIVATEAUTH="private/"
-fi
-
+fi;
 
-
-
 use_whoson=0
+
 # Check whether --with-whoson or --without-whoson was given.
 if test "${with_whoson+set}" = set; then
   withval="$with_whoson"
@@ -7125,9 +10640,8 @@
 	 else
 		use_whoson=1
 	 fi
-fi
+fi;
 
-
 t_oldLibs="$LIBS"
 t_oldCpp="$CPPFLAGS"
 
@@ -7149,45 +10663,54 @@
 #	else
 #	    AC_MSG_RESULT([No whoson libs available system at default location ?])
 #	fi
-#	: # "nop"	
+#	: # "nop"
 #-------------
-	for ac_hdr in whoson.h
+
+for ac_header in whoson.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7159: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:10672: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10678 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:10682: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:10688: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7164 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7169: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:10707: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
@@ -7198,46 +10721,72 @@
 
 	    LIBS="$LIBS $LIBSOCKET $LIBWHOSON"
 	    CPPFLAGS="$CPPFLAGS $INCLWHOSON"
-	    cat > conftest.$ac_ext <<EOF
-#line 7203 "configure"
+	    cat >conftest.$ac_ext <<_ACEOF
+#line 10725 "configure"
 #include "confdefs.h"
 #include <whoson.h>
 			int deny_severity, allow_severity;
-int main() {
+int
+main ()
+{
 wso_version();
-; return 0; }
-EOF
-if { (eval echo configure:7211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10738: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10741: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10744: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10747: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_whoson=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_whoson=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_whoson=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 	    if test "$ac_cv_lib_whoson" = no; then
 		LIBS="$t_oldLibs"
 		LIBS="$LIBS $LIBSOCKET -L/usr/local/lib $LIBWHOSON"
-		cat > conftest.$ac_ext <<EOF
-#line 7225 "configure"
+		cat >conftest.$ac_ext <<_ACEOF
+#line 10760 "configure"
 #include "confdefs.h"
 #include <whoson.h>
-int main() {
+int
+main ()
+{
 wso_version();
-; return 0; }
-EOF
-if { (eval echo configure:7232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10772: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10775: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10778: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10781: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_whoson=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_whoson=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_whoson=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 		if test  "$ac_cv_lib_whoson" = yes; then
 		    whosonloc="-L/usr/local/lib"
 		    LIBWHOSON="-L/usr/local/lib $LIBWHOSON"
@@ -7246,24 +10795,37 @@
 	    if test "$ac_cv_lib_whoson" = no; then
 		LIBS="$t_oldLibs"
 		LIBS="$LIBS $LIBSOCKET -L/local/lib $LIBWHOSON"
-		cat > conftest.$ac_ext <<EOF
-#line 7251 "configure"
+		cat >conftest.$ac_ext <<_ACEOF
+#line 10799 "configure"
 #include "confdefs.h"
 #include <whoson.h>
-int main() {
+int
+main ()
+{
 wso_version();
-; return 0; }
-EOF
-if { (eval echo configure:7258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10811: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10814: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10817: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10820: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_whoson=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_whoson=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_whoson=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 		if test  "$ac_cv_lib_whoson" = yes; then
 		    whosonloc="-L/local/lib"
 		    LIBWHOSON="-L/local/lib $LIBWHOSON"
@@ -7272,24 +10834,37 @@
 	    if test "$ac_cv_lib_whoson" = no; then
 		LIBS="$t_oldLibs"
 		LIBS="$LIBS $LIBSOCKET -L/opt/lib $LIBWHOSON"
-		cat > conftest.$ac_ext <<EOF
-#line 7277 "configure"
+		cat >conftest.$ac_ext <<_ACEOF
+#line 10838 "configure"
 #include "confdefs.h"
 #include <whoson.h>
-int main() {
+int
+main ()
+{
 wso_version();
-; return 0; }
-EOF
-if { (eval echo configure:7284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10850: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10853: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10856: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10859: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_whoson=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_whoson=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_whoson=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 		if test  "$ac_cv_lib_whoson" = yes; then
 		    whosonloc="-L/opt/lib"
 		    LIBWHOSON="-L/opt/lib $LIBWHOSON"
@@ -7298,24 +10873,37 @@
 	    if test "$ac_cv_lib_whoson" = no; then
 		LIBS="$t_oldLibs"
 		LIBS="$LIBS $LIBSOCKET -L/opt/local/lib $LIBWHOSON"
-		cat > conftest.$ac_ext <<EOF
-#line 7303 "configure"
+		cat >conftest.$ac_ext <<_ACEOF
+#line 10877 "configure"
 #include "confdefs.h"
 #include <whoson.h>
-int main() {
+int
+main ()
+{
 wso_version();
-; return 0; }
-EOF
-if { (eval echo configure:7310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10889: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10892: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10895: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10898: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_whoson=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_whoson=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_whoson=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 		if test  "$ac_cv_lib_whoson" = yes; then
 		    whosonloc="-L/opt/local/lib"
 		    LIBWHOSON="-L/opt/local/lib $LIBWHOSON"
@@ -7329,44 +10917,53 @@
 	    LIBS="$t_oldLibs"
 
 	else
-	    for ac_hdr in /local/include/whoson.h /usr/local/include/whoson.h \
+
+for ac_header in /local/include/whoson.h /usr/local/include/whoson.h \
 			     /opt/include/whoson.h /opt/local/include/whoson.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7338: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:10925: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10931 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:10935: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:10941: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7343 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:10960: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
@@ -7394,38 +10991,53 @@
 	fi
 	LIBS="$LIBS $LIBSOCKET $LIBWHOSON"
 	CPPFLAGS="$CPPFLAGS $INCLWHOSON"
-	if eval "test \"`echo '$''{'ac_cv_lib_whoson'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+	if test "${ac_cv_lib_whoson+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7402 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10998 "configure"
 #include "confdefs.h"
 #include <whoson.h>
-int main() {
+int
+main ()
+{
 wso_version();
-; return 0; }
-EOF
-if { (eval echo configure:7409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11010: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11013: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11016: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11019: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_whoson=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_whoson=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_whoson=no
 fi
-rm -f conftest*
-	  
+rm -f conftest$ac_exeext conftest.$ac_ext
+
 fi
 
 	if test "$ac_cv_lib_whoson" = yes; then
-	    echo "$ac_t""Whoson libs  available at $whosonloc: -lwhoson !" 1>&6;
-	    cat >> confdefs.h <<\EOF
+	    echo "$as_me:11032: result: Whoson libs  available at $whosonloc: -lwhoson !" >&5
+echo "${ECHO_T}Whoson libs  available at $whosonloc: -lwhoson !" >&6;
+	    cat >>confdefs.h <<\EOF
 #define HAVE_WHOSON_H 1
 EOF
 
 	else
-	    echo "$ac_t""No whoson libs available at system default locations ?" 1>&6
+	    echo "$as_me:11039: result: No whoson libs available at system default locations ?" >&5
+echo "${ECHO_T}No whoson libs available at system default locations ?" >&6
 	    LIBWHOSON=""
 	    INCLWHOSON=""
 	fi
@@ -7433,20 +11045,24 @@
   else
     if test -f "$withval"/lib/libwhoson.a ; then
 	LIBWHOSON="-L$withval/lib -lwhoson"
-	echo "$ac_t""Using whoson libs at directory: $withval/lib" 1>&6;
+	echo "$as_me:11048: result: Using whoson libs at directory: $withval/lib" >&5
+echo "${ECHO_T}Using whoson libs at directory: $withval/lib" >&6;
     else
 	LIBWHOSON="-L$withval -lwhoson"
-	echo "$ac_t""Using whoson libs at directory: $withval" 1>&6;
+	echo "$as_me:11052: result: Using whoson libs at directory: $withval" >&5
+echo "${ECHO_T}Using whoson libs at directory: $withval" >&6;
     fi
     if test -f "$withval"/include/whoson.h ; then
 	INCLWHOSON="-I$withval/include"
-	echo "$ac_t""Using whoson includes at directory: $withval" 1>&6;
+	echo "$as_me:11057: result: Using whoson includes at directory: $withval" >&5
+echo "${ECHO_T}Using whoson includes at directory: $withval" >&6;
     else
 	INCLWHOSON="-I$withval"
-	echo "$ac_t""Using whoson includes at directory: $withval" 1>&6;
+	echo "$as_me:11061: result: Using whoson includes at directory: $withval" >&5
+echo "${ECHO_T}Using whoson includes at directory: $withval" >&6;
     fi
     unset ac_cv_lib_whoson
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_WHOSON_H 1
 EOF
 
@@ -7456,103 +11072,133 @@
 CPPFLAGS="$t_oldCpp"
 LIBS="$t_oldLibs"
 
-
-
-echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:7463: checking for strftime" >&5
-if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+for ac_func in strftime
+do
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:11078: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7468 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11084 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char strftime(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char strftime();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_strftime) || defined (__stub___strftime)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-strftime();
+f = $ac_func;
 #endif
-
-; return 0; }
-EOF
-if { (eval echo configure:7491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_strftime=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_strftime=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_STRFTIME 1
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11115: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11118: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11121: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11124: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:11134: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
 
 else
-  echo "$ac_t""no" 1>&6
-# strftime is in -lintl on SCO UNIX.
-echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
-echo "configure:7513: checking for strftime in -lintl" >&5
-ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  # strftime is in -lintl on SCO UNIX.
+echo "$as_me:11143: checking for strftime in -lintl" >&5
+echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6
+if test "${ac_cv_lib_intl_strftime+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lintl  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 7521 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 11151 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char strftime();
-
-int main() {
-strftime()
-; return 0; }
-EOF
-if { (eval echo configure:7532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
+   builtin and then its argument prototype would still apply.  */
+char strftime ();
+int
+main ()
+{
+strftime ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11170: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11173: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11176: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11179: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_intl_strftime=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_intl_strftime=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:11190: result: $ac_cv_lib_intl_strftime" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6
+if test $ac_cv_lib_intl_strftime = yes; then
+  cat >>confdefs.h <<\EOF
 #define HAVE_STRFTIME 1
 EOF
 
 LIBS="-lintl $LIBS"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
+done
 
 #
 #  How the  sprintf()  really behaves ?
@@ -7561,16 +11207,16 @@
 # Substitutes @DSPRINTF_TYPE@ definitions into Makefiles (-DSPRINTF_CHAR)
 # Defines  SPRINTF_CHAR  for  config.h  in case the test yields "char *"..
 #
-echo $ac_n "checking for the return type of sprintf() being char*""... $ac_c" 1>&6
-echo "configure:7566: checking for the return type of sprintf() being char*" >&5
-if eval "test \"`echo '$''{'ac_cv_func_char_sprintf'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:11210: checking for the return type of sprintf() being char*" >&5
+echo $ECHO_N "checking for the return type of sprintf() being char*... $ECHO_C" >&6
+if test "${ac_cv_func_char_sprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
   ac_cv_func_char_sprintf=no
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7574 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11219 "configure"
 #include "confdefs.h"
 
     extern char *sprintf();
@@ -7580,25 +11226,34 @@
 	char *ss = sprintf(buf,"xx");
 	return (ss == buf); /* returns the char pointer */
     }
-EOF
-if { (eval echo configure:7585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:11231: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11234: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:11236: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11239: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_func_char_sprintf=no
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_func_char_sprintf=yes
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_char_sprintf=yes
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
 fi
 
-echo "$ac_t""$ac_cv_func_char_sprintf" 1>&6
+echo "$as_me:11252: result: $ac_cv_func_char_sprintf" >&5
+echo "${ECHO_T}$ac_cv_func_char_sprintf" >&6
 
 if test $ac_cv_func_char_sprintf = yes; then
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\EOF
 #define SPRINTF_CHAR 1
 EOF
 
@@ -7607,210 +11262,267 @@
   DSPRINTF_TYPE=""
 fi
 
-echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:7612: checking for vprintf" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+for ac_func in vprintf
+do
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:11268: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7617 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11274 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char vprintf(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char vprintf();
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
-int main() {
-
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_vprintf) || defined (__stub___vprintf)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-vprintf();
+f = $ac_func;
 #endif
-
-; return 0; }
-EOF
-if { (eval echo configure:7640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_vprintf=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_vprintf=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_VPRINTF 1
-EOF
 
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-if test "$ac_cv_func_vprintf" != yes; then
-echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:7664: checking for _doprnt" >&5
-if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11305: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11308: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11311: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11314: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:11324: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
+EOF
+
+echo "$as_me:11331: checking for _doprnt" >&5
+echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6
+if test "${ac_cv_func__doprnt+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7669 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11337 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char _doprnt(); below.  */
+    which can conflict with char _doprnt (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char _doprnt();
+   builtin and then its argument prototype would still apply.  */
+char _doprnt ();
+char (*f) ();
 
-int main() {
-
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub__doprnt) || defined (__stub____doprnt)
 choke me
 #else
-_doprnt();
+f = _doprnt;
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:7692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func__doprnt=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func__doprnt=no"
-fi
-rm -f conftest*
-fi
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11368: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11371: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11374: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11377: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func__doprnt=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func__doprnt=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:11387: result: $ac_cv_func__doprnt" >&5
+echo "${ECHO_T}$ac_cv_func__doprnt" >&6
+if test $ac_cv_func__doprnt = yes; then
 
-if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\EOF
 #define HAVE_DOPRNT 1
 EOF
 
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
+done
 
 for ac_func in vsprintf vsnprintf snprintf
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7719: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:11403: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7724 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11409 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11440: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11443: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11446: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11449: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:11459: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:7747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
-echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:7774: checking for working alloca.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:11471: checking for working alloca.h" >&5
+echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
+if test "${ac_cv_working_alloca_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7779 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11477 "configure"
 #include "confdefs.h"
 #include <alloca.h>
-int main() {
-char *p = alloca(2 * sizeof(int));
-; return 0; }
-EOF
-if { (eval echo configure:7786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_cv_header_alloca_h=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_alloca_h=no
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11489: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11492: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11495: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11498: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_working_alloca_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_working_alloca_h=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:11508: result: $ac_cv_working_alloca_h" >&5
+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
+if test $ac_cv_working_alloca_h = yes; then
 
-echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
-if test $ac_cv_header_alloca_h = yes; then
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\EOF
 #define HAVE_ALLOCA_H 1
 EOF
 
 fi
 
-echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:7807: checking for alloca" >&5
-if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:11518: checking for alloca" >&5
+echo $ECHO_N "checking for alloca... $ECHO_C" >&6
+if test "${ac_cv_func_alloca_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7812 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11524 "configure"
 #include "confdefs.h"
-
 #ifdef __GNUC__
 # define alloca __builtin_alloca
 #else
@@ -7832,48 +11544,62 @@
 # endif
 #endif
 
-int main() {
-char *p = (char *) alloca(1);
-; return 0; }
-EOF
-if { (eval echo configure:7840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+int
+main ()
+{
+char *p = (char *) alloca (1);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11556: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11559: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11562: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11565: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_func_alloca_works=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_func_alloca_works=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_alloca_works=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
+echo "$as_me:11575: result: $ac_cv_func_alloca_works" >&5
+echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
 
-echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
 if test $ac_cv_func_alloca_works = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define HAVE_ALLOCA 1
 EOF
-
-fi
 
-if test $ac_cv_func_alloca_works = no; then
+else
   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
-  # that cause trouble.  Some versions do not even contain alloca or
-  # contain a buggy version.  If you still want to use their alloca,
-  # use ar to extract alloca.o from them instead of compiling alloca.c.
-  ALLOCA=alloca.${ac_objext}
-  cat >> confdefs.h <<\EOF
+# that cause trouble.  Some versions do not even contain alloca or
+# contain a buggy version.  If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=alloca.$ac_objext
+
+cat >>confdefs.h <<\EOF
 #define C_ALLOCA 1
 EOF
 
-
-echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:7872: checking whether alloca needs Cray hooks" >&5
-if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:11596: checking whether \`alloca.c' needs Cray hooks" >&5
+echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
+if test "${ac_cv_os_cray+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7877 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11602 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -7881,88 +11607,103 @@
 wenotbecray
 #endif
 
-EOF
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "webecray" >/dev/null 2>&1; then
-  rm -rf conftest*
   ac_cv_os_cray=yes
 else
-  rm -rf conftest*
   ac_cv_os_cray=no
 fi
 rm -f conftest*
 
 fi
-
-echo "$ac_t""$ac_cv_os_cray" 1>&6
+echo "$as_me:11620: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&6
 if test $ac_cv_os_cray = yes; then
-for ac_func in _getb67 GETB67 getb67; do
-  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7902: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  for ac_func in _getb67 GETB67 getb67; do
+    ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:11625: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7907 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11631 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:7930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11662: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11665: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11668: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11671: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:11681: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<EOF
+cat >>confdefs.h <<EOF
 #define CRAY_STACKSEG_END $ac_func
 EOF
 
-  break
-else
-  echo "$ac_t""no" 1>&6
+    break
 fi
 
-done
+  done
 fi
 
-echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:7957: checking stack direction for C alloca" >&5
-if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:11695: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
+if test "${ac_cv_c_stack_direction+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
   ac_cv_c_stack_direction=0
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7965 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11704 "configure"
 #include "confdefs.h"
+int
 find_stack_direction ()
 {
   static char *addr = 0;
@@ -7975,42 +11716,55 @@
   else
     return (&dummy > addr) ? 1 : -1;
 }
+
+int
 main ()
 {
-  exit (find_stack_direction() < 0);
+  exit (find_stack_direction () < 0);
 }
-EOF
-if { (eval echo configure:7984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:11727: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11730: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:11732: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11735: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_c_stack_direction=1
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_c_stack_direction=-1
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_c_stack_direction=-1
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
 fi
+echo "$as_me:11747: result: $ac_cv_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
 
-echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<EOF
 #define STACK_DIRECTION $ac_cv_c_stack_direction
 EOF
 
 fi
 
-echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:8006: checking whether getpgrp takes no argument" >&5
-if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:11756: checking whether getpgrp takes no argument" >&5
+echo $ECHO_N "checking whether getpgrp takes no argument... $ECHO_C" >&6
+if test "${ac_cv_func_getpgrp_void+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
-  { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
+  { { echo "$as_me:11762: error: cannot check getpgrp if cross compiling" >&5
+echo "$as_me: error: cannot check getpgrp if cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
 else
-  cat > conftest.$ac_ext <<EOF
-#line 8014 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11767 "configure"
 #include "confdefs.h"
 
 /*
@@ -8026,175 +11780,203 @@
 int     pg1, pg2, pg3, pg4;
 int     ng, np, s, child;
 
-main()
+int
+main ()
 {
-        pid = getpid();
-        pg1 = getpgrp(0);
-        pg2 = getpgrp();
-        pg3 = getpgrp(pid);
-        pg4 = getpgrp(1);
-
-        /*
-         * If all of these values are the same, it's pretty sure that
-         * we're on a system that ignores getpgrp's first argument.
-         */
-        if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
-                exit(0);
-
-        child = fork();
-        if (child < 0)
-                exit(1);
-        else if (child == 0) {
-                np = getpid();
-                /*
-                 * If this is Sys V, this will not work; pgrp will be
-                 * set to np because setpgrp just changes a pgrp to be
-                 * the same as the pid.
-                 */
-                setpgrp(np, pg1);
-                ng = getpgrp(0);        /* Same result for Sys V and BSD */
-                if (ng == pg1) {
-                        exit(1);
-                } else {
-                        exit(0);
-                }
-        } else {
-                wait(&s);
-                exit(s>>8);
-        }
-}
-
-EOF
-if { (eval echo configure:8069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+  pid = getpid ();
+  pg1 = getpgrp (0);
+  pg2 = getpgrp ();
+  pg3 = getpgrp (pid);
+  pg4 = getpgrp (1);
+
+  /* If all of these values are the same, it's pretty sure that we're
+     on a system that ignores getpgrp's first argument.  */
+  if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
+    exit (0);
+
+  child = fork ();
+  if (child < 0)
+    exit(1);
+  else if (child == 0)
+    {
+      np = getpid ();
+      /*  If this is Sys V, this will not work; pgrp will be set to np
+	 because setpgrp just changes a pgrp to be the same as the
+	 pid.  */
+      setpgrp (np, pg1);
+      ng = getpgrp (0);        /* Same result for Sys V and BSD */
+      if (ng == pg1)
+  	exit (1);
+      else
+  	exit (0);
+    }
+  else
+    {
+      wait (&s);
+      exit (s>>8);
+    }
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:11821: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11824: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:11826: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11829: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_func_getpgrp_void=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_func_getpgrp_void=no
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_getpgrp_void=no
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
 
-
 fi
-
-echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
+echo "$as_me:11842: result: $ac_cv_func_getpgrp_void" >&5
+echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6
 if test $ac_cv_func_getpgrp_void = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define GETPGRP_VOID 1
 EOF
 
 fi
 
-for ac_hdr in unistd.h
+for ac_header in stdlib.h unistd.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8096: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:11855: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11861 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:11865: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:11871: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 8101 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:11890: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
 for ac_func in getpagesize
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8135: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:11903: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 8140 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11909 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11940: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11943: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11946: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11949: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:11959: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:8163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
-echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:8188: checking for working mmap" >&5
-if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:11969: checking for working mmap" >&5
+echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
   ac_cv_func_mmap_fixed_mapped=no
 else
-  cat > conftest.$ac_ext <<EOF
-#line 8196 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11978 "configure"
 #include "confdefs.h"
-
 /* Thanks to Mike Haertel and Jim Avera for this test.
    Here is a matrix of mmap possibilities:
 	mmap private not fixed
@@ -8207,7 +11989,7 @@
    back from the file, nor mmap's back from the file at a different
    address.  (There have been systems where private was not correctly
    implemented like the infamous i386 svr4.0, and systems where the
-   VM page cache was not coherent with the filesystem buffer cache
+   VM page cache was not coherent with the file system buffer cache
    like early versions of FreeBSD and possibly contemporary NetBSD.)
    For shared mappings, we should conversely verify that changes get
    propogated back to all the places they're supposed to be.
@@ -8220,21 +12002,27 @@
 #include <fcntl.h>
 #include <sys/mman.h>
 
-/* This mess was copied from the GNU getpagesize.h.  */
-#ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-# endif
+#if STDC_HEADERS || HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *malloc ();
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <sys/stat.h>
 
+/* This mess was copied from the GNU getpagesize.h.  */
+#if !HAVE_GETPAGESIZE
 /* Assume that all systems that can run configure have sys/param.h.  */
-# ifndef HAVE_SYS_PARAM_H
+# if !HAVE_SYS_PARAM_H
 #  define HAVE_SYS_PARAM_H 1
 # endif
 
 # ifdef _SC_PAGESIZE
 #  define getpagesize() sysconf(_SC_PAGESIZE)
 # else /* no _SC_PAGESIZE */
-#  ifdef HAVE_SYS_PARAM_H
+#  if HAVE_SYS_PARAM_H
 #   include <sys/param.h>
 #   ifdef EXEC_PAGESIZE
 #    define getpagesize() EXEC_PAGESIZE
@@ -8261,143 +12049,131 @@
 
 #endif /* no HAVE_GETPAGESIZE */
 
-#ifdef __cplusplus
-extern "C" { void *malloc(unsigned); }
-#else
-char *malloc();
-#endif
-
 int
-main()
+main ()
 {
-	char *data, *data2, *data3;
-	int i, pagesize;
-	int fd;
-
-	pagesize = getpagesize();
-
-	/*
-	 * First, make a file with some known garbage in it.
-	 */
-	data = malloc(pagesize);
-	if (!data)
-		exit(1);
-	for (i = 0; i < pagesize; ++i)
-		*(data + i) = rand();
-	umask(0);
-	fd = creat("conftestmmap", 0600);
-	if (fd < 0)
-		exit(1);
-	if (write(fd, data, pagesize) != pagesize)
-		exit(1);
-	close(fd);
-
-	/*
-	 * Next, try to mmap the file at a fixed address which
-	 * already has something else allocated at it.  If we can,
-	 * also make sure that we see the same garbage.
-	 */
-	fd = open("conftestmmap", O_RDWR);
-	if (fd < 0)
-		exit(1);
-	data2 = malloc(2 * pagesize);
-	if (!data2)
-		exit(1);
-	data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
-	if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
-	    MAP_PRIVATE | MAP_FIXED, fd, 0L))
-		exit(1);
-	for (i = 0; i < pagesize; ++i)
-		if (*(data + i) != *(data2 + i))
-			exit(1);
-
-	/*
-	 * Finally, make sure that changes to the mapped area
-	 * do not percolate back to the file as seen by read().
-	 * (This is a bug on some variants of i386 svr4.0.)
-	 */
-	for (i = 0; i < pagesize; ++i)
-		*(data2 + i) = *(data2 + i) + 1;
-	data3 = malloc(pagesize);
-	if (!data3)
-		exit(1);
-	if (read(fd, data3, pagesize) != pagesize)
-		exit(1);
-	for (i = 0; i < pagesize; ++i)
-		if (*(data + i) != *(data3 + i))
-			exit(1);
-	close(fd);
-	unlink("conftestmmap");
-	exit(0);
+  char *data, *data2, *data3;
+  int i, pagesize;
+  int fd;
+
+  pagesize = getpagesize ();
+
+  /* First, make a file with some known garbage in it. */
+  data = (char *) malloc (pagesize);
+  if (!data)
+    exit (1);
+  for (i = 0; i < pagesize; ++i)
+    *(data + i) = rand ();
+  umask (0);
+  fd = creat ("conftest.mmap", 0600);
+  if (fd < 0)
+    exit (1);
+  if (write (fd, data, pagesize) != pagesize)
+    exit (1);
+  close (fd);
+
+  /* Next, try to mmap the file at a fixed address which already has
+     something else allocated at it.  If we can, also make sure that
+     we see the same garbage.  */
+  fd = open ("conftest.mmap", O_RDWR);
+  if (fd < 0)
+    exit (1);
+  data2 = (char *) malloc (2 * pagesize);
+  if (!data2)
+    exit (1);
+  data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
+  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+                     MAP_PRIVATE | MAP_FIXED, fd, 0L))
+    exit (1);
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data2 + i))
+      exit (1);
+
+  /* Finally, make sure that changes to the mapped area do not
+     percolate back to the file as seen by read().  (This is a bug on
+     some variants of i386 svr4.0.)  */
+  for (i = 0; i < pagesize; ++i)
+    *(data2 + i) = *(data2 + i) + 1;
+  data3 = (char *) malloc (pagesize);
+  if (!data3)
+    exit (1);
+  if (read (fd, data3, pagesize) != pagesize)
+    exit (1);
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data3 + i))
+      exit (1);
+  close (fd);
+  exit (0);
 }
-
-EOF
-if { (eval echo configure:8336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:12110: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12113: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:12115: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12118: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_func_mmap_fixed_mapped=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_func_mmap_fixed_mapped=no
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_mmap_fixed_mapped=no
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
 fi
-
-echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
+echo "$as_me:12130: result: $ac_cv_func_mmap_fixed_mapped" >&5
+echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
 if test $ac_cv_func_mmap_fixed_mapped = yes; then
-  cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\EOF
 #define HAVE_MMAP 1
 EOF
 
 fi
+rm -f conftest.mmap
 
-
 # Check whether --with-ta-mmap or --without-ta-mmap was given.
 if test "${with_ta_mmap+set}" = set; then
   withval="$with_ta_mmap"
   use_ta_mmap=1
 else
   use_ta_mmap=0
-fi
-
+fi;
 if test "$use_ta_mmap" = "1"; then
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\EOF
 #define TA_USE_MMAP 1
 EOF
 
 fi
 
-
 # Check whether --with-getpwnam-library or --without-getpwnam-library was given.
 if test "${with_getpwnam_library+set}" = set; then
   withval="$with_getpwnam_library"
   use_getpwnam_lib=1
 else
   use_getpwnam_lib=0
-fi
-
+fi;
 if test "$use_getpwnam_lib" = 1; then
   GETPWLIB="$withval"
 fi
 
-
-
-
-
 # Check whether --with-openssl-prefix or --without-openssl-prefix was given.
 if test "${with_openssl_prefix+set}" = set; then
   withval="$with_openssl_prefix"
   OPENSSLPREFIX="$withval"
-fi
+fi;
 
 # Check whether --with-openssl-include or --without-openssl-include was given.
 if test "${with_openssl_include+set}" = set; then
   withval="$with_openssl_include"
   OPENSSLINCL="-I$withval"
-fi
+fi;
 
 # Check whether --with-openssl-lib or --without-openssl-lib was given.
 if test "${with_openssl_lib+set}" = set; then
@@ -8411,15 +12187,16 @@
 #	  # Operating system dependent runtime path definition :-/
 #	  OPENSSLLIB="-R$withval $OPENSSLLIB"
 #	fi
-
-fi
 
+fi;
 if test -n "$OPENSSLPREFIX" -a -z "$OPENSSLINCL" ; then
   if test -f "$OPENSSLPREFIX/include/openssl/ssl.h" ; then
     OPENSSLINCL="-I$OPENSSLPREFIX/include/"
   else
-    echo "$ac_t""!!! You defined  --with-openssl-prefix=$OPENSSLPREFIX,  BUT" 1>&6
-    echo "$ac_t""!!! there does not exist file  $OPENSSLPREFIX/include/openssl/ssl.h !" 1>&6
+    echo "$as_me:12196: result: !!! You defined  --with-openssl-prefix=$OPENSSLPREFIX,  BUT" >&5
+echo "${ECHO_T}!!! You defined  --with-openssl-prefix=$OPENSSLPREFIX,  BUT" >&6
+    echo "$as_me:12198: result: !!! there does not exist file  $OPENSSLPREFIX/include/openssl/ssl.h !" >&5
+echo "${ECHO_T}!!! there does not exist file  $OPENSSLPREFIX/include/openssl/ssl.h !" >&6
   fi
 fi
 if test -n "$OPENSSLPREFIX" -a -z "$OPENSSLLIB" ; then
@@ -8432,12 +12209,14 @@
   elif test -n "$OPENSSLPREFIX" -a -f "$OPENSSLPREFIX/lib/libssl.a" ; then
     OPENSSLLIB="$OPENSSLPREFIX/lib/libssl.a $OPENSSLPREFIX/lib/libcrypto.a"
   else
-    echo "$ac_t""!!! You defined  --with-openssl-prefix=$OPENSSLPREFIX,  BUT" 1>&6
-    echo "$ac_t""!!! there does not exist file  $OPENSSLPREFIX/lib/libssl.a !" 1>&6
+    echo "$as_me:12212: result: !!! You defined  --with-openssl-prefix=$OPENSSLPREFIX,  BUT" >&5
+echo "${ECHO_T}!!! You defined  --with-openssl-prefix=$OPENSSLPREFIX,  BUT" >&6
+    echo "$as_me:12214: result: !!! there does not exist file  $OPENSSLPREFIX/lib/libssl.a !" >&5
+echo "${ECHO_T}!!! there does not exist file  $OPENSSLPREFIX/lib/libssl.a !" >&6
   fi
 fi
 if test -n "$OPENSSLINCL" -a -n "$OPENSSLLIB" ; then
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\EOF
 #define HAVE_OPENSSL 1
 EOF
 
@@ -8450,7 +12229,7 @@
   # No Explicite setup, lets do some auto-tests
   if test -f /usr/local/ssl/include/openssl/ssl.h ; then
     # Gee, OpenSSL 0.9.3a at default prefix!
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_OPENSSL 1
 EOF
 
@@ -8461,11 +12240,12 @@
     else
       OPENSSLLIB="$OPENSSLPREFIX/lib/libssl.a $OPENSSLPREFIX/lib/libcrypto.a"
     fi
-    echo "$ac_t""You have OpenSSL version 0.9.3a (or newer) at default location" 1>&6
+    echo "$as_me:12243: result: You have OpenSSL version 0.9.3a (or newer) at default location" >&5
+echo "${ECHO_T}You have OpenSSL version 0.9.3a (or newer) at default location" >&6
   fi
   if test -f /usr/include/openssl/ssl.h ; then
     # Gee, OpenSSL 0.9.3a at  "--prefix=/usr" !!!
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define HAVE_OPENSSL 1
 EOF
 
@@ -8476,123 +12256,146 @@
     else
       OPENSSLLIB="$OPENSSLPREFIX/lib/libssl.a $OPENSSLPREFIX/lib/libcrypto.a"
     fi
-    echo "$ac_t""You have OpenSSL version 0.9.3a (or newer) at system root!" 1>&6
+    echo "$as_me:12259: result: You have OpenSSL version 0.9.3a (or newer) at system root!" >&5
+echo "${ECHO_T}You have OpenSSL version 0.9.3a (or newer) at system root!" >&6
   fi
 fi
-fi
-
+fi;
 
 # Check whether --enable-translation or --disable-translation was given.
 if test "${enable_translation+set}" = set; then
   enableval="$enable_translation"
-  
-       cat >> confdefs.h <<EOF
+
+       cat >>confdefs.h <<EOF
 #define USE_TRANSLATION "$enableval"
 EOF
- 
-
-fi
 
+fi;
 
 for ac_func in crypt
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8501: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:12278: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 8506 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12284 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12315: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12318: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12321: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12324: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:12334: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:8529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
-
 if test "$ac_cv_func_crypt" != yes ; then
     # Now why ???  Must have "-lcrypt" like Linuxes ???
     t_oldLibs="$LIBS"
     LIBS="$LIBS -lcrypt"
-    cat > conftest.$ac_ext <<EOF
-#line 8559 "configure"
+    cat >conftest.$ac_ext <<_ACEOF
+#line 12349 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 char *s1, *s2, *s3; s3 = crypt(s1,s2);
-; return 0; }
-EOF
-if { (eval echo configure:8566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12361: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12364: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12367: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12370: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_lib_crypt_lib=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_lib_crypt_lib=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_crypt_lib=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
     if test "$ac_cv_lib_crypt_lib" = yes; then
 	# Success with this flag..
 	GETPWLIB="$GETPWLIB -lcrypt"
-	echo "$ac_t""crypt() was found by using -lcrypt  library!" 1>&6
+	echo "$as_me:12382: result: crypt() was found by using -lcrypt  library!" >&5
+echo "${ECHO_T}crypt() was found by using -lcrypt  library!" >&6
     fi
     LIBS="$t_oldLibs"
 fi
 
-
-
 #
 #  Is there  "d_ino"  within the  dirent structure ?
 #  Defines  D_INO_IN_DIRENT  if it is.
 #
-echo $ac_n "checking for d_ino member in directory struct""... $ac_c" 1>&6
-echo "configure:8591: checking for d_ino member in directory struct" >&5
-if eval "test \"`echo '$''{'fu_cv_sys_d_ino_in_dirent'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:12392: checking for d_ino member in directory struct" >&5
+echo $ECHO_N "checking for d_ino member in directory struct... $ECHO_C" >&6
+if test "${fu_cv_sys_d_ino_in_dirent+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 8596 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12398 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -8611,25 +12414,39 @@
 # endif /* HAVE_NDIR_H */
 #endif /* HAVE_DIRENT_H */
 
-int main() {
+int
+main ()
+{
 struct dirent dp; dp.d_ino = 0;
-; return 0; }
-EOF
-if { (eval echo configure:8619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12426: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12429: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12432: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12435: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   fu_cv_sys_d_ino_in_dirent=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  fu_cv_sys_d_ino_in_dirent=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fu_cv_sys_d_ino_in_dirent=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
 
-echo "$ac_t""$fu_cv_sys_d_ino_in_dirent" 1>&6
+echo "$as_me:12446: result: $fu_cv_sys_d_ino_in_dirent" >&5
+echo "${ECHO_T}$fu_cv_sys_d_ino_in_dirent" >&6
 if test $fu_cv_sys_d_ino_in_dirent = yes; then
-  cat >> confdefs.h <<\EOF
+  cat >>confdefs.h <<\EOF
 #define D_INO_IN_DIRENT 1
 EOF
 
@@ -8638,175 +12455,231 @@
 # Determine how to get the list of mounted filesystems.
 
 # getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX, -lgen on Unixware.
-echo $ac_n "checking for getmntent in -lsun""... $ac_c" 1>&6
-echo "configure:8643: checking for getmntent in -lsun" >&5
-ac_lib_var=`echo sun'_'getmntent | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:12458: checking for getmntent in -lsun" >&5
+echo $ECHO_N "checking for getmntent in -lsun... $ECHO_C" >&6
+if test "${ac_cv_lib_sun_getmntent+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsun  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8651 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 12466 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char getmntent();
-
-int main() {
-getmntent()
-; return 0; }
-EOF
-if { (eval echo configure:8662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+   builtin and then its argument prototype would still apply.  */
+char getmntent ();
+int
+main ()
+{
+getmntent ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12485: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12488: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12491: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12494: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_sun_getmntent=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_sun_getmntent=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:12505: result: $ac_cv_lib_sun_getmntent" >&5
+echo "${ECHO_T}$ac_cv_lib_sun_getmntent" >&6
+if test $ac_cv_lib_sun_getmntent = yes; then
   LIBS="-lsun $LIBS"
 else
-  echo "$ac_t""no" 1>&6
-echo $ac_n "checking for getmntent in -lseq""... $ac_c" 1>&6
-echo "configure:8681: checking for getmntent in -lseq" >&5
-ac_lib_var=`echo seq'_'getmntent | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:12510: checking for getmntent in -lseq" >&5
+echo $ECHO_N "checking for getmntent in -lseq... $ECHO_C" >&6
+if test "${ac_cv_lib_seq_getmntent+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lseq  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8689 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 12518 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char getmntent();
-
-int main() {
-getmntent()
-; return 0; }
-EOF
-if { (eval echo configure:8700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+   builtin and then its argument prototype would still apply.  */
+char getmntent ();
+int
+main ()
+{
+getmntent ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12537: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12540: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12543: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12546: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_seq_getmntent=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_seq_getmntent=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:12557: result: $ac_cv_lib_seq_getmntent" >&5
+echo "${ECHO_T}$ac_cv_lib_seq_getmntent" >&6
+if test $ac_cv_lib_seq_getmntent = yes; then
   LIBS="-lseq $LIBS"
 else
-  echo "$ac_t""no" 1>&6
-echo $ac_n "checking for getmntent in -lgen""... $ac_c" 1>&6
-echo "configure:8719: checking for getmntent in -lgen" >&5
-ac_lib_var=`echo gen'_'getmntent | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:12562: checking for getmntent in -lgen" >&5
+echo $ECHO_N "checking for getmntent in -lgen... $ECHO_C" >&6
+if test "${ac_cv_lib_gen_getmntent+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgen  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 8727 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 12570 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char getmntent();
-
-int main() {
-getmntent()
-; return 0; }
-EOF
-if { (eval echo configure:8738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+   builtin and then its argument prototype would still apply.  */
+char getmntent ();
+int
+main ()
+{
+getmntent ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12589: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12592: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12595: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12598: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gen_getmntent=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gen_getmntent=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:12609: result: $ac_cv_lib_gen_getmntent" >&5
+echo "${ECHO_T}$ac_cv_lib_gen_getmntent" >&6
+if test $ac_cv_lib_gen_getmntent = yes; then
   LIBS="-lgen $LIBS"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
 
 fi
 
-echo $ac_n "checking for getmntent""... $ac_c" 1>&6
-echo "configure:8763: checking for getmntent" >&5
-if eval "test \"`echo '$''{'ac_cv_func_getmntent'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:12619: checking for getmntent" >&5
+echo $ECHO_N "checking for getmntent... $ECHO_C" >&6
+if test "${ac_cv_func_getmntent+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 8768 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12625 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char getmntent(); below.  */
+    which can conflict with char getmntent (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char getmntent();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char getmntent ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_getmntent) || defined (__stub___getmntent)
 choke me
 #else
-getmntent();
+f = getmntent;
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:8791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_getmntent=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_getmntent=no"
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12656: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12659: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12662: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12665: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_getmntent=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_getmntent=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
+echo "$as_me:12675: result: $ac_cv_func_getmntent" >&5
+echo "${ECHO_T}$ac_cv_func_getmntent" >&6
+if test $ac_cv_func_getmntent = yes; then
 
-if eval "test \"`echo '$ac_cv_func_'getmntent`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\EOF
 #define HAVE_GETMNTENT 1
 EOF
 
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 #
@@ -8828,20 +12701,21 @@
 
   if test -z "$list_mounted_fs"; then
     # 4.3BSD, SunOS, HP-UX, Dynix, Irix
-    echo $ac_n "checking for one-argument getmntent function""... $ac_c" 1>&6
-echo "configure:8833: checking for one-argument getmntent function" >&5
-    if eval "test \"`echo '$''{'fu_cv_sys_mounted_getmntent1'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    echo "$as_me:12704: checking for one-argument getmntent function" >&5
+echo $ECHO_N "checking for one-argument getmntent function... $ECHO_C" >&6
+    if test "${fu_cv_sys_mounted_getmntent1+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   test $ac_cv_header_mntent_h = yes \
 		   && fu_cv_sys_mounted_getmntent1=yes \
 		   || fu_cv_sys_mounted_getmntent1=no
 fi
 
-    echo "$ac_t""$fu_cv_sys_mounted_getmntent1" 1>&6
+    echo "$as_me:12714: result: $fu_cv_sys_mounted_getmntent1" >&5
+echo "${ECHO_T}$fu_cv_sys_mounted_getmntent1" >&6
     if test $fu_cv_sys_mounted_getmntent1 = yes; then
       list_mounted_fs=found
-      cat >> confdefs.h <<\EOF
+      cat >>confdefs.h <<\EOF
 #define MOUNTED_GETMNTENT1 1
 EOF
 
@@ -8850,32 +12724,32 @@
 
   if test -z "$list_mounted_fs"; then
     # SVR4
-    echo $ac_n "checking for two-argument getmntent function""... $ac_c" 1>&6
-echo "configure:8855: checking for two-argument getmntent function" >&5
-    if eval "test \"`echo '$''{'fu_cv_sys_mounted_getmntent2'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    echo "$as_me:12727: checking for two-argument getmntent function" >&5
+echo $ECHO_N "checking for two-argument getmntent function... $ECHO_C" >&6
+    if test "${fu_cv_sys_mounted_getmntent2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 8860 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12733 "configure"
 #include "confdefs.h"
 #include <sys/mnttab.h>
-EOF
+
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "getmntent" >/dev/null 2>&1; then
-  rm -rf conftest*
   fu_cv_sys_mounted_getmntent2=yes
 else
-  rm -rf conftest*
   fu_cv_sys_mounted_getmntent2=no
 fi
 rm -f conftest*
 
 fi
 
-    echo "$ac_t""$fu_cv_sys_mounted_getmntent2" 1>&6
+    echo "$as_me:12748: result: $fu_cv_sys_mounted_getmntent2" >&5
+echo "${ECHO_T}$fu_cv_sys_mounted_getmntent2" >&6
     if test $fu_cv_sys_mounted_getmntent2 = yes; then
       list_mounted_fs=found
-      cat >> confdefs.h <<\EOF
+      cat >>confdefs.h <<\EOF
 #define MOUNTED_GETMNTENT2 1
 EOF
 
@@ -8883,46 +12757,62 @@
   fi
 
   if test -z "$list_mounted_fs"; then
-    { echo "configure: error: could not determine how to read list of mounted filesystems" 1>&2; exit 1; }
+    { { echo "$as_me:12760: error: could not determine how to read list of mounted filesystems" >&5
+echo "$as_me: error: could not determine how to read list of mounted filesystems" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
 fi
 
 if test -z "$list_mounted_fs"; then
   # DEC Alpha running OSF/1.
-  echo $ac_n "checking for getfsstat function""... $ac_c" 1>&6
-echo "configure:8895: checking for getfsstat function" >&5
-  if eval "test \"`echo '$''{'fu_cv_sys_mounted_getsstat'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:12769: checking for getfsstat function" >&5
+echo $ECHO_N "checking for getfsstat function... $ECHO_C" >&6
+  if test "${fu_cv_sys_mounted_getsstat+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 8900 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12775 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 #include <sys/mount.h>
 #include <sys/fs_types.h>
-int main() {
+int
+main ()
+{
 struct statfs *stats;
-  numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); 
-; return 0; }
-EOF
-if { (eval echo configure:8911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12791: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12794: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12797: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12800: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   fu_cv_sys_mounted_getsstat=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  fu_cv_sys_mounted_getsstat=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fu_cv_sys_mounted_getsstat=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
 
-  echo "$ac_t""$fu_cv_sys_mounted_getsstat" 1>&6
+  echo "$as_me:12811: result: $fu_cv_sys_mounted_getsstat" >&5
+echo "${ECHO_T}$fu_cv_sys_mounted_getsstat" >&6
   if test $fu_cv_sys_mounted_getsstat = yes; then
     list_mounted_fs=found
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define MOUNTED_GETFSSTAT 1
 EOF
 
@@ -8931,36 +12821,47 @@
 
 if test -z "$list_mounted_fs"; then
   # AIX.
-  echo $ac_n "checking for mntctl function and struct vmount""... $ac_c" 1>&6
-echo "configure:8936: checking for mntctl function and struct vmount" >&5
-  if eval "test \"`echo '$''{'fu_cv_sys_mounted_vmount'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:12824: checking for mntctl function and struct vmount" >&5
+echo $ECHO_N "checking for mntctl function and struct vmount... $ECHO_C" >&6
+  if test "${fu_cv_sys_mounted_vmount+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 8941 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12830 "configure"
 #include "confdefs.h"
 #include <fshelp.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
+_ACEOF
+if { (eval echo "$as_me:12834: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:12840: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
   fu_cv_sys_mounted_vmount=yes
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
   fu_cv_sys_mounted_vmount=no
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
 
-  echo "$ac_t""$fu_cv_sys_mounted_vmount" 1>&6
+  echo "$as_me:12860: result: $fu_cv_sys_mounted_vmount" >&5
+echo "${ECHO_T}$fu_cv_sys_mounted_vmount" >&6
   if test $fu_cv_sys_mounted_vmount = yes; then
     list_mounted_fs=found
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define MOUNTED_VMOUNT 1
 EOF
 
@@ -8969,39 +12870,50 @@
 
 if test -z "$list_mounted_fs"; then
   # SVR3
-  echo $ac_n "checking for FIXME existence of three headers""... $ac_c" 1>&6
-echo "configure:8974: checking for FIXME existence of three headers" >&5
-  if eval "test \"`echo '$''{'fu_cv_sys_mounted_fread_fstyp'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:12873: checking for FIXME existence of three headers" >&5
+echo $ECHO_N "checking for FIXME existence of three headers... $ECHO_C" >&6
+  if test "${fu_cv_sys_mounted_fread_fstyp+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 8979 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12879 "configure"
 #include "confdefs.h"
 
 #include <sys/statfs.h>
 #include <sys/fstyp.h>
 #include <mnttab.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
+_ACEOF
+if { (eval echo "$as_me:12886: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:12892: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
   fu_cv_sys_mounted_fread_fstyp=yes
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
   fu_cv_sys_mounted_fread_fstyp=no
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
 
-  echo "$ac_t""$fu_cv_sys_mounted_fread_fstyp" 1>&6
+  echo "$as_me:12912: result: $fu_cv_sys_mounted_fread_fstyp" >&5
+echo "${ECHO_T}$fu_cv_sys_mounted_fread_fstyp" >&6
   if test $fu_cv_sys_mounted_fread_fstyp = yes; then
     list_mounted_fs=found
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define MOUNTED_FREAD_FSTYP 1
 EOF
 
@@ -9010,22 +12922,22 @@
 
 if test -z "$list_mounted_fs"; then
   # 4.4BSD and DEC OSF/1.
-  echo $ac_n "checking for getmntinfo function""... $ac_c" 1>&6
-echo "configure:9015: checking for getmntinfo function" >&5
-  if eval "test \"`echo '$''{'fu_cv_sys_mounted_getmntinfo'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:12925: checking for getmntinfo function" >&5
+echo $ECHO_N "checking for getmntinfo function... $ECHO_C" >&6
+  if test "${fu_cv_sys_mounted_getmntinfo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
+
       ok=
       if test $ac_cv_func_getmntinfo = yes; then
-	cat > conftest.$ac_ext <<EOF
-#line 9023 "configure"
+	cat >conftest.$ac_ext <<_ACEOF
+#line 12934 "configure"
 #include "confdefs.h"
 #include <sys/mount.h>
-EOF
+
+_ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "f_type;" >/dev/null 2>&1; then
-  rm -rf conftest*
   ok=yes
 fi
 rm -f conftest*
@@ -9034,13 +12946,14 @@
       test -n "$ok" \
 	  && fu_cv_sys_mounted_getmntinfo=yes \
 	  || fu_cv_sys_mounted_getmntinfo=no
-    
+
 fi
 
-  echo "$ac_t""$fu_cv_sys_mounted_getmntinfo" 1>&6
+  echo "$as_me:12952: result: $fu_cv_sys_mounted_getmntinfo" >&5
+echo "${ECHO_T}$fu_cv_sys_mounted_getmntinfo" >&6
   if test $fu_cv_sys_mounted_getmntinfo = yes; then
     list_mounted_fs=found
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define MOUNTED_GETMNTINFO 1
 EOF
 
@@ -9051,38 +12964,49 @@
 
 if test -z "$list_mounted_fs"; then
   # Ultrix
-  echo $ac_n "checking for getmnt function""... $ac_c" 1>&6
-echo "configure:9056: checking for getmnt function" >&5
-  if eval "test \"`echo '$''{'fu_cv_sys_mounted_getmnt'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:12967: checking for getmnt function" >&5
+echo $ECHO_N "checking for getmnt function... $ECHO_C" >&6
+  if test "${fu_cv_sys_mounted_getmnt+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 9061 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12973 "configure"
 #include "confdefs.h"
 
 #include <sys/fs_types.h>
 #include <sys/mount.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9068: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
+_ACEOF
+if { (eval echo "$as_me:12979: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:12985: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
   fu_cv_sys_mounted_getmnt=yes
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
   fu_cv_sys_mounted_getmnt=no
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
 
-  echo "$ac_t""$fu_cv_sys_mounted_getmnt" 1>&6
+  echo "$as_me:13005: result: $fu_cv_sys_mounted_getmnt" >&5
+echo "${ECHO_T}$fu_cv_sys_mounted_getmnt" >&6
   if test $fu_cv_sys_mounted_getmnt = yes; then
     list_mounted_fs=found
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define MOUNTED_GETMNT 1
 EOF
 
@@ -9091,36 +13015,47 @@
 
 if test -z "$list_mounted_fs"; then
   # SVR2
-  echo $ac_n "checking whether it is possible to resort to fread on /etc/mnttab""... $ac_c" 1>&6
-echo "configure:9096: checking whether it is possible to resort to fread on /etc/mnttab" >&5
-  if eval "test \"`echo '$''{'fu_cv_sys_mounted_fread'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:13018: checking whether it is possible to resort to fread on /etc/mnttab" >&5
+echo $ECHO_N "checking whether it is possible to resort to fread on /etc/mnttab... $ECHO_C" >&6
+  if test "${fu_cv_sys_mounted_fread+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 9101 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13024 "configure"
 #include "confdefs.h"
 #include <mnttab.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
+_ACEOF
+if { (eval echo "$as_me:13028: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:13034: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
   fu_cv_sys_mounted_fread=yes
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
   fu_cv_sys_mounted_fread=no
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
 
-  echo "$ac_t""$fu_cv_sys_mounted_fread" 1>&6
+  echo "$as_me:13054: result: $fu_cv_sys_mounted_fread" >&5
+echo "${ECHO_T}$fu_cv_sys_mounted_fread" >&6
   if test $fu_cv_sys_mounted_fread = yes; then
     list_mounted_fs=found
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define MOUNTED_FREAD 1
 EOF
 
@@ -9128,12 +13063,13 @@
 fi
 
 if test -z "$list_mounted_fs"; then
-  { echo "configure: error: could not determine how to read list of mounted filesystems" 1>&2; exit 1; }
+  { { echo "$as_me:13066: error: could not determine how to read list of mounted filesystems" >&5
+echo "$as_me: error: could not determine how to read list of mounted filesystems" >&2;}
+   { (exit 1); exit 1; }; }
   # FIXME -- no need to abort building the whole package
   # Can't build mountlist.c or anything that needs its functions
 fi
 
-
 # Test how to find out the filesystem space usage:
 #
 # AC_FUNC_STATVFS -- test how to find out the filesystem space usage
@@ -9143,72 +13079,87 @@
 #			STAT_READ_FILSYS
 #
 
-echo "checking how to get filesystem space usage:" 1>&6
-echo "configure:9148: checking how to get filesystem space usage:" >&5
+{ echo "$as_me:13082: checking how to get filesystem space usage:..." >&5
+echo "$as_me: checking how to get filesystem space usage:..." >&6;}
 space=no
 
 # Here we'll compromise a little (and perform only the link test)
 # since it seems there are no variants of the statvfs function.
 if test $space = no; then
   # SVR4
-  for ac_func in statvfs
+
+for ac_func in statvfs
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9158: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:13094: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 9163 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13100 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13131: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13134: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13137: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13140: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:13150: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:9186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
   if test $ac_cv_func_statvfs = yes; then
     space=yes
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define STAT_STATVFS 1
 EOF
 
@@ -9217,16 +13168,16 @@
 
 if test $space = no; then
   # DEC Alpha running OSF/1
-  echo $ac_n "checking for 3-argument statfs function (DEC OSF/1)""... $ac_c" 1>&6
-echo "configure:9222: checking for 3-argument statfs function (DEC OSF/1)" >&5
-  if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs3_osf1'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:13171: checking for 3-argument statfs function (DEC OSF/1)" >&5
+echo $ECHO_N "checking for 3-argument statfs function (DEC OSF/1)... $ECHO_C" >&6
+  if test "${fu_cv_sys_stat_statfs3_osf1+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
   fu_cv_sys_stat_statfs3_osf1=no
 else
-  cat > conftest.$ac_ext <<EOF
-#line 9230 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13180 "configure"
 #include "confdefs.h"
 
 #include <sys/param.h>
@@ -9238,25 +13189,34 @@
     fsd.f_fsize = 0;
     exit (statfs (".", &fsd, sizeof (struct statfs)));
   }
-EOF
-if { (eval echo configure:9243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:13194: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13197: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:13199: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13202: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   fu_cv_sys_stat_statfs3_osf1=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  fu_cv_sys_stat_statfs3_osf1=no
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fu_cv_sys_stat_statfs3_osf1=no
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
 fi
 
-  echo "$ac_t""$fu_cv_sys_stat_statfs3_osf1" 1>&6
+  echo "$as_me:13215: result: $fu_cv_sys_stat_statfs3_osf1" >&5
+echo "${ECHO_T}$fu_cv_sys_stat_statfs3_osf1" >&6
   if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
     space=yes
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define STAT_STATFS3_OSF1 1
 EOF
 
@@ -9265,16 +13225,16 @@
 
 if test $space = no; then
 # AIX
-  echo $ac_n "checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)""... $ac_c" 1>&6
-echo "configure:9270: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5
-  if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs2_bsize'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:13228: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5
+echo $ECHO_N "checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)... $ECHO_C" >&6
+  if test "${fu_cv_sys_stat_statfs2_bsize+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
   fu_cv_sys_stat_statfs2_bsize=no
 else
-  cat > conftest.$ac_ext <<EOF
-#line 9278 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13237 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_PARAM_H
@@ -9292,25 +13252,34 @@
   fsd.f_bsize = 0;
   exit (statfs (".", &fsd));
   }
-EOF
-if { (eval echo configure:9297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:13257: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13260: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:13262: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13265: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   fu_cv_sys_stat_statfs2_bsize=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  fu_cv_sys_stat_statfs2_bsize=no
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fu_cv_sys_stat_statfs2_bsize=no
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
 fi
 
-  echo "$ac_t""$fu_cv_sys_stat_statfs2_bsize" 1>&6
+  echo "$as_me:13278: result: $fu_cv_sys_stat_statfs2_bsize" >&5
+echo "${ECHO_T}$fu_cv_sys_stat_statfs2_bsize" >&6
   if test $fu_cv_sys_stat_statfs2_bsize = yes; then
     space=yes
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define STAT_STATFS2_BSIZE 1
 EOF
 
@@ -9319,16 +13288,16 @@
 
 if test $space = no; then
 # SVR3
-  echo $ac_n "checking for four-argument statfs (AIX-3.2.5, SVR3)""... $ac_c" 1>&6
-echo "configure:9324: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5
-  if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs4'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:13291: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5
+echo $ECHO_N "checking for four-argument statfs (AIX-3.2.5, SVR3)... $ECHO_C" >&6
+  if test "${fu_cv_sys_stat_statfs4+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
   fu_cv_sys_stat_statfs4=no
 else
-  cat > conftest.$ac_ext <<EOF
-#line 9332 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13300 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/statfs.h>
@@ -9337,25 +13306,34 @@
   struct statfs fsd;
   exit (statfs (".", &fsd, sizeof fsd, 0));
   }
-EOF
-if { (eval echo configure:9342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:13311: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13314: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:13316: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13319: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   fu_cv_sys_stat_statfs4=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  fu_cv_sys_stat_statfs4=no
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fu_cv_sys_stat_statfs4=no
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
 fi
 
-  echo "$ac_t""$fu_cv_sys_stat_statfs4" 1>&6
+  echo "$as_me:13332: result: $fu_cv_sys_stat_statfs4" >&5
+echo "${ECHO_T}$fu_cv_sys_stat_statfs4" >&6
   if test $fu_cv_sys_stat_statfs4 = yes; then
     space=yes
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define STAT_STATFS4 1
 EOF
 
@@ -9364,16 +13342,16 @@
 
 if test $space = no; then
 # 4.4BSD and NetBSD
-  echo $ac_n "checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)""... $ac_c" 1>&6
-echo "configure:9369: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5
-  if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs2_fsize'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:13345: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5
+echo $ECHO_N "checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)... $ECHO_C" >&6
+  if test "${fu_cv_sys_stat_statfs2_fsize+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
   fu_cv_sys_stat_statfs2_fsize=no
 else
-  cat > conftest.$ac_ext <<EOF
-#line 9377 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13354 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_SYS_PARAM_H
@@ -9388,25 +13366,34 @@
   fsd.f_fsize = 0;
   exit (statfs (".", &fsd));
   }
-EOF
-if { (eval echo configure:9393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:13371: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13374: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:13376: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13379: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   fu_cv_sys_stat_statfs2_fsize=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  fu_cv_sys_stat_statfs2_fsize=no
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fu_cv_sys_stat_statfs2_fsize=no
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
 fi
 
-  echo "$ac_t""$fu_cv_sys_stat_statfs2_fsize" 1>&6
+  echo "$as_me:13392: result: $fu_cv_sys_stat_statfs2_fsize" >&5
+echo "${ECHO_T}$fu_cv_sys_stat_statfs2_fsize" >&6
   if test $fu_cv_sys_stat_statfs2_fsize = yes; then
     space=yes
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define STAT_STATFS2_FSIZE 1
 EOF
 
@@ -9415,16 +13402,16 @@
 
 if test $space = no; then
   # Ultrix
-  echo $ac_n "checking for two-argument statfs with struct fs_data (Ultrix)""... $ac_c" 1>&6
-echo "configure:9420: checking for two-argument statfs with struct fs_data (Ultrix)" >&5
-  if eval "test \"`echo '$''{'fu_cv_sys_stat_fs_data'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:13405: checking for two-argument statfs with struct fs_data (Ultrix)" >&5
+echo $ECHO_N "checking for two-argument statfs with struct fs_data (Ultrix)... $ECHO_C" >&6
+  if test "${fu_cv_sys_stat_fs_data+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
   fu_cv_sys_stat_fs_data=no
 else
-  cat > conftest.$ac_ext <<EOF
-#line 9428 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13414 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_SYS_PARAM_H
@@ -9443,25 +13430,34 @@
      0 for not mounted, -1 for failure.  */
   exit (statfs (".", &fsd) != 1);
   }
-EOF
-if { (eval echo configure:9448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:13435: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13438: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:13440: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13443: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   fu_cv_sys_stat_fs_data=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  fu_cv_sys_stat_fs_data=no
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fu_cv_sys_stat_fs_data=no
 fi
-rm -fr conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
-
 fi
 
-  echo "$ac_t""$fu_cv_sys_stat_fs_data" 1>&6
+  echo "$as_me:13456: result: $fu_cv_sys_stat_fs_data" >&5
+echo "${ECHO_T}$fu_cv_sys_stat_fs_data" >&6
   if test $fu_cv_sys_stat_fs_data = yes; then
     space=yes
-    cat >> confdefs.h <<\EOF
+    cat >>confdefs.h <<\EOF
 #define STAT_STATFS2_FS_DATA 1
 EOF
 
@@ -9470,123 +13466,162 @@
 
 if test $space = no; then
 # SVR2
-cat > conftest.$ac_ext <<EOF
-#line 9475 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 13470 "configure"
 #include "confdefs.h"
 #include <sys/filsys.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  cat >> confdefs.h <<\EOF
+_ACEOF
+if { (eval echo "$as_me:13474: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:13480: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  cat >>confdefs.h <<\EOF
 #define STAT_READ_FILSYS 1
 EOF
  space=yes
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
+
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
 
-
 #if test -n "$list_mounted_fs" && test $space != no; then
 #  PROGS="$PROGS df" LIBOBJS="$LIBOBJS"
 #fi
 
 for ac_func in ftruncate
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9504: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:13510: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 9509 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13516 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
-int main() {
-
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:9532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13547: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13550: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13553: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13556: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:13566: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
- 
+
 else
-  echo "$ac_t""no" 1>&6
-ftruncate_missing=yes
+  ftruncate_missing=yes
 fi
 done
 
-
 if test "$ftruncate_missing" = yes; then
-  echo $ac_n "checking fcntl emulation of ftruncate""... $ac_c" 1>&6
-echo "configure:9560: checking fcntl emulation of ftruncate" >&5
-  if eval "test \"`echo '$''{'fu_cv_sys_ftruncate_emulation'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  echo "$as_me:13579: checking fcntl emulation of ftruncate" >&5
+echo $ECHO_N "checking fcntl emulation of ftruncate... $ECHO_C" >&6
+  if test "${fu_cv_sys_ftruncate_emulation+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 9565 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13585 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
 #include <fcntl.h>
-int main() {
+int
+main ()
+{
 
 #if !defined(F_CHSIZE) && !defined(F_FREESP)
 chsize();
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:9578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13603: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13606: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13609: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13612: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   fu_cv_sys_ftruncate_emulation=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  fu_cv_sys_ftruncate_emulation=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fu_cv_sys_ftruncate_emulation=no
 fi
-rm -f conftest*
+rm -f conftest$ac_exeext conftest.$ac_ext
 fi
 
-  echo "$ac_t""$fu_cv_sys_ftruncate_emulation" 1>&6
+  echo "$as_me:13623: result: $fu_cv_sys_ftruncate_emulation" >&5
+echo "${ECHO_T}$fu_cv_sys_ftruncate_emulation" >&6
   if test $fu_cv_sys_ftruncate_emulation = yes; then
     LIBOBJS="$LIBOBJS ftruncate.o"
   fi
@@ -9594,296 +13629,357 @@
 
 # If we don't yet have getgroups, see if it's in -lbsd.
 # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1.
-echo $ac_n "checking for getgroups""... $ac_c" 1>&6
-echo "configure:9599: checking for getgroups" >&5
-if eval "test \"`echo '$''{'ac_cv_func_getgroups'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:13632: checking for getgroups" >&5
+echo $ECHO_N "checking for getgroups... $ECHO_C" >&6
+if test "${ac_cv_func_getgroups+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 9604 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13638 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char getgroups(); below.  */
+    which can conflict with char getgroups (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char getgroups();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char getgroups ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_getgroups) || defined (__stub___getgroups)
 choke me
 #else
-getgroups();
+f = getgroups;
 #endif
-
-; return 0; }
-EOF
-if { (eval echo configure:9627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_getgroups=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_getgroups=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'getgroups`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13669: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13672: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13675: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13678: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_getgroups=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_getgroups=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:13688: result: $ac_cv_func_getgroups" >&5
+echo "${ECHO_T}$ac_cv_func_getgroups" >&6
+if test $ac_cv_func_getgroups = yes; then
   :
 else
-  echo "$ac_t""no" 1>&6
-echo $ac_n "checking for getgroups in -lbsd""... $ac_c" 1>&6
-echo "configure:9645: checking for getgroups in -lbsd" >&5
-ac_lib_var=`echo bsd'_'getgroups | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+
+echo "$as_me:13694: checking for getgroups in -lbsd" >&5
+echo $ECHO_N "checking for getgroups in -lbsd... $ECHO_C" >&6
+if test "${ac_cv_lib_bsd_getgroups+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lbsd  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9653 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 13702 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char getgroups();
-
-int main() {
-getgroups()
-; return 0; }
-EOF
-if { (eval echo configure:9664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo bsd | sed -e 's/^a-zA-Z0-9_/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+   builtin and then its argument prototype would still apply.  */
+char getgroups ();
+int
+main ()
+{
+getgroups ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13721: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13724: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13727: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13730: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_bsd_getgroups=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_bsd_getgroups=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:13741: result: $ac_cv_lib_bsd_getgroups" >&5
+echo "${ECHO_T}$ac_cv_lib_bsd_getgroups" >&6
+if test $ac_cv_lib_bsd_getgroups = yes; then
+  cat >>confdefs.h <<EOF
+#define HAVE_LIBBSD 1
 EOF
 
   LIBS="-lbsd $LIBS"
 
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
-
 
-for ac_hdr in sys/ipc.h sys/msg.h
+for ac_header in sys/ipc.h sys/msg.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9698: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo "$as_me:13757: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13763 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:13767: \"$ac_cpp conftest.$ac_ext >/dev/null\"") >&5
+  (eval $ac_cpp conftest.$ac_ext >/dev/null) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:13773: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  cat > conftest.$ac_ext <<EOF
-#line 9703 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$ac_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$ac_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:13792: result: `eval echo '${'$ac_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
 for ac_func in msgsnd msgrcv msgctl
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9737: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo "$as_me:13805: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 9742 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13811 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13842: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13845: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13848: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13851: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$ac_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$ac_ac_var=no"
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:13861: result: `eval echo '${'$ac_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
 EOF
-if { (eval echo configure:9765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
 fi
 done
 
-
 # Check for libypsec.a on Dolphin M88K machines.
-echo $ac_n "checking for main in -lypsec""... $ac_c" 1>&6
-echo "configure:9792: checking for main in -lypsec" >&5
-ac_lib_var=`echo ypsec'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+
+echo "$as_me:13873: checking for main in -lypsec" >&5
+echo $ECHO_N "checking for main in -lypsec... $ECHO_C" >&6
+if test "${ac_cv_lib_ypsec_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lypsec  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9800 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 13881 "configure"
 #include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:9807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo ypsec | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13893: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13896: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13899: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13902: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ypsec_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_ypsec_main=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:13913: result: $ac_cv_lib_ypsec_main" >&5
+echo "${ECHO_T}$ac_cv_lib_ypsec_main" >&6
+if test $ac_cv_lib_ypsec_main = yes; then
+  cat >>confdefs.h <<EOF
+#define HAVE_LIBYPSEC 1
 EOF
 
   LIBS="-lypsec $LIBS"
 
-else
-  echo "$ac_t""no" 1>&6
 fi
 
-
 # m88k running dgux 5.4 needs this
-echo $ac_n "checking for main in -lldgc""... $ac_c" 1>&6
-echo "configure:9837: checking for main in -lldgc" >&5
-ac_lib_var=`echo ldgc'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+
+echo "$as_me:13926: checking for main in -lldgc" >&5
+echo $ECHO_N "checking for main in -lldgc... $ECHO_C" >&6
+if test "${ac_cv_lib_ldgc_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lldgc  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9845 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 13934 "configure"
 #include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:9852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo ldgc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13946: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13949: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13952: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13955: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ldgc_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_ldgc_main=no
+fi
+rm -f conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:13966: result: $ac_cv_lib_ldgc_main" >&5
+echo "${ECHO_T}$ac_cv_lib_ldgc_main" >&6
+if test $ac_cv_lib_ldgc_main = yes; then
+  cat >>confdefs.h <<EOF
+#define HAVE_LIBLDGC 1
 EOF
 
   LIBS="-lldgc $LIBS"
 
-else
-  echo "$ac_t""no" 1>&6
 fi
-
 
-echo "checking for AFS" 1>&6
-echo "configure:9881: checking for AFS" >&5
-test -d /afs && cat >> confdefs.h <<\EOF
+{ echo "$as_me:13977: checking for AFS..." >&5
+echo "$as_me: checking for AFS..." >&6;}
+test -d /afs && cat >>confdefs.h <<\EOF
 #define AFS 1
 EOF
 
-
-
 eval MANDIR=${mandir}
 
 if test "$ac_cv_c_const" = no ; then
@@ -9892,73 +13988,75 @@
 
 # Extract the first word of "procmail", so it can be a program name with args.
 set dummy procmail; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:9897: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_PROCMAIL'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:13991: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PROCMAIL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$PROCMAIL" in
-  /*)
+  case $PROCMAIL in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_PROCMAIL="$PROCMAIL" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_PROCMAIL="$PROCMAIL" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_PROCMAIL="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_PROCMAIL="$ac_dir/$ac_word"
+   break
+fi
+done
+
   test -z "$ac_cv_path_PROCMAIL" && ac_cv_path_PROCMAIL="procmail"
   ;;
 esac
 fi
-PROCMAIL="$ac_cv_path_PROCMAIL"
+PROCMAIL=$ac_cv_path_PROCMAIL
+
 if test -n "$PROCMAIL"; then
-  echo "$ac_t""$PROCMAIL" 1>&6
+  echo "$as_me:14019: result: $PROCMAIL" >&5
+echo "${ECHO_T}$PROCMAIL" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:14022: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 # Extract the first word of "md5sum", so it can be a program name with args.
 set dummy md5sum; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:9932: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_MD5SUM'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:14027: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MD5SUM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$MD5SUM" in
-  /*)
+  case $MD5SUM in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_MD5SUM="$MD5SUM" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_MD5SUM="$MD5SUM" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_MD5SUM="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_MD5SUM="$ac_dir/$ac_word"
+   break
+fi
+done
+
   test -z "$ac_cv_path_MD5SUM" && ac_cv_path_MD5SUM="$MAILBIN/md5sum"
   ;;
 esac
 fi
-MD5SUM="$ac_cv_path_MD5SUM"
+MD5SUM=$ac_cv_path_MD5SUM
+
 if test -n "$MD5SUM"; then
-  echo "$ac_t""$MD5SUM" 1>&6
+  echo "$as_me:14055: result: $MD5SUM" >&5
+echo "${ECHO_T}$MD5SUM" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:14058: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
 for x in sfio sfio/src sfio/src/lib sfio/src/lib/sfio sfio/include sfio/lib
@@ -9966,513 +14064,951 @@
   if test ! -d $x ; then mkdir $x; fi
 done
 
-trap '' 1 2 15
-cat > confcache <<\EOF
+ac_config_files="$ac_config_files Makefile router/Makefile router/libdb/Makefile scheduler/Makefile smtpserver/Makefile transports/Makefile transports/smtp/Makefile transports/mailbox/Makefile transports/hold/Makefile transports/libta/Makefile transports/sm/Makefile transports/errormail/Makefile transports/fuzzyalias/Makefile transports/expirer/Makefile transports/expirer/manual-expirer compat/Makefile compat/rmail/Makefile compat/sendmail/Makefile sfio/Makefile sfio/src/lib/sfio/makefile sfio/src/lib/sfio/Stdio_b/Makefile sfio/src/lib/sfio/Stdio_s/Makefile sfio/src/lib/sfio/Sfio_f/Makefile sfio/src/lib/sfio/Sfio_dc/Makefile lib/Makefile libc/Makefile libident/Makefile libs/Makefile libsh/Makefile libmalloc/Makefile libmalloc/splay/Makefile libresolv/Makefile ssl/Makefile doc/Makefile doc/design/Makefile include/mail.h man/Makefile utils/policy-builder.sh utils/Makefile utils/zmailer.init.sh utils/autoanswer.pl utils/vacation/Makefile man/vacation.1 utils/vacation/vacation.sh utils/makedb/Makefile utils/rotate-logs.sh utils/smtpserver-log-parser.pl proto/Makefile proto/zmailer.sh proto/newaliases proto/newfqdnaliases proto/newdb proto/newdbprocessor proto/scheduler.conf proto/scheduler.auth proto/mailrm.sh proto/db/Makefile proto/cf/TELE-FI.cf proto/smtpserver.conf proto/cf/SMTP+UUCP.cf proto/cf/UTdefault.cf proto/cf/SMTP.cf proto/smtp-tls.conf proto/db/aliases proto/sm.conf bin/mkdep bin/mklibdep proto/post-install.sh utils/mxverify/Makefile packaging/Makefile packaging/solaris/Makefile SiteConfig"
+ac_config_commands="$ac_config_commands default"
+cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
-# scripts and configure runs.  It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
 #
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already.  You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
 #
-EOF
+# `ac_cv_env_foo' variables (set or unset) will be overriden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
 # The following way of writing the cache mishandles newlines in values,
 # but we know of no workaround that is simple, portable, and efficient.
 # So, don't put newlines in cache variables' values.
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
-  case `(ac_space=' '; set | grep ac_space) 2>&1` in
-  *ac_space=\ *)
-    # `set' does not quote correctly, so add quotes (double-quote substitution
-    # turns \\\\ into \\, and sed turns \\ into \).
-    sed -n \
-      -e "s/'/'\\\\''/g" \
-      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
-    ;;
-  *)
-    # `set' quotes correctly as required by POSIX, so do not add quotes.
-    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
-    ;;
-  esac >> confcache
-if cmp -s $cache_file confcache; then
-  :
-else
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+        "s/'/'\\\\''/g;
+    	  s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+        "s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if cmp -s $cache_file confcache; then :; else
   if test -w $cache_file; then
-    echo "updating cache $cache_file"
-    cat confcache > $cache_file
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
   else
     echo "not updating unwritable cache $cache_file"
   fi
 fi
 rm -f confcache
 
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
 test "x$prefix" = xNONE && prefix=$ac_default_prefix
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
+  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ 	]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ 	]*$//;
+}'
 fi
 
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
 DEFS=-DHAVE_CONFIG_H
 
-# Without the "./", some shells look in PATH for config.status.
 : ${CONFIG_STATUS=./config.status}
-
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:14148: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<\_ACEOF
 #! /bin/sh
 # Generated automatically by configure.
 # Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
 # Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
+# configure, is in config.log if it exists.
 
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+debug=false
+as_me=`echo "$0" | sed 's,.*/,,'`
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+as_executable_p="test -f"
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+# NLS nuisances.
+$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
+$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
+$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
+$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
+$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
+$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
+$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
+$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 5 compiler messages saved in config.log
+# 6 checking for... messages and results
+exec 5>>config.log
+exec 6>&1
+
+cat >&5 << EOF
+
+## ----------------------- ##
+## Running config.status.  ##
+## ----------------------- ##
+
+This file was extended by $as_me 2.49d, executed with
+ > $0 $@
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+
+EOF
+
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\EOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+EOF
+
+cat >>$CONFIG_STATUS <<EOF
+ac_cs_version="\\
+$CONFIG_STATUS generated by $as_me (Autoconf 2.49d).
+Configured on host $ac_hostname by
+  `echo "$0 $ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`"
+srcdir=$srcdir
+INSTALL="$INSTALL"
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
 do
-  case "\$ac_option" in
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    shift
+    set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
+    shift
+    ;;
+  -*);;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_need_defaults=false;;
+  esac
+
+  case $1 in
+  # Handling of the options.
+EOF
+cat >>$CONFIG_STATUS <<EOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
-    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.13"
-    exit 0 ;;
-  -help | --help | --hel | --he | --h)
-    echo "\$ac_cs_usage"; exit 0 ;;
-  *) echo "\$ac_cs_usage"; exit 1 ;;
+    echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
+    exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:14332: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    shift
+    CONFIG_FILES="$CONFIG_FILES $1"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $1"
+    ac_need_defaults=false;;
+
+  # Handling of arguments.
+  'Makefile' ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  'router/Makefile' ) CONFIG_FILES="$CONFIG_FILES router/Makefile" ;;
+  'router/libdb/Makefile' ) CONFIG_FILES="$CONFIG_FILES router/libdb/Makefile" ;;
+  'scheduler/Makefile' ) CONFIG_FILES="$CONFIG_FILES scheduler/Makefile" ;;
+  'smtpserver/Makefile' ) CONFIG_FILES="$CONFIG_FILES smtpserver/Makefile" ;;
+  'transports/Makefile' ) CONFIG_FILES="$CONFIG_FILES transports/Makefile" ;;
+  'transports/smtp/Makefile' ) CONFIG_FILES="$CONFIG_FILES transports/smtp/Makefile" ;;
+  'transports/mailbox/Makefile' ) CONFIG_FILES="$CONFIG_FILES transports/mailbox/Makefile" ;;
+  'transports/hold/Makefile' ) CONFIG_FILES="$CONFIG_FILES transports/hold/Makefile" ;;
+  'transports/libta/Makefile' ) CONFIG_FILES="$CONFIG_FILES transports/libta/Makefile" ;;
+  'transports/sm/Makefile' ) CONFIG_FILES="$CONFIG_FILES transports/sm/Makefile" ;;
+  'transports/errormail/Makefile' ) CONFIG_FILES="$CONFIG_FILES transports/errormail/Makefile" ;;
+  'transports/fuzzyalias/Makefile' ) CONFIG_FILES="$CONFIG_FILES transports/fuzzyalias/Makefile" ;;
+  'transports/expirer/Makefile' ) CONFIG_FILES="$CONFIG_FILES transports/expirer/Makefile" ;;
+  'transports/expirer/manual-expirer' ) CONFIG_FILES="$CONFIG_FILES transports/expirer/manual-expirer" ;;
+  'compat/Makefile' ) CONFIG_FILES="$CONFIG_FILES compat/Makefile" ;;
+  'compat/rmail/Makefile' ) CONFIG_FILES="$CONFIG_FILES compat/rmail/Makefile" ;;
+  'compat/sendmail/Makefile' ) CONFIG_FILES="$CONFIG_FILES compat/sendmail/Makefile" ;;
+  'sfio/Makefile' ) CONFIG_FILES="$CONFIG_FILES sfio/Makefile" ;;
+  'sfio/src/lib/sfio/makefile' ) CONFIG_FILES="$CONFIG_FILES sfio/src/lib/sfio/makefile" ;;
+  'sfio/src/lib/sfio/Stdio_b/Makefile' ) CONFIG_FILES="$CONFIG_FILES sfio/src/lib/sfio/Stdio_b/Makefile" ;;
+  'sfio/src/lib/sfio/Stdio_s/Makefile' ) CONFIG_FILES="$CONFIG_FILES sfio/src/lib/sfio/Stdio_s/Makefile" ;;
+  'sfio/src/lib/sfio/Sfio_f/Makefile' ) CONFIG_FILES="$CONFIG_FILES sfio/src/lib/sfio/Sfio_f/Makefile" ;;
+  'sfio/src/lib/sfio/Sfio_dc/Makefile' ) CONFIG_FILES="$CONFIG_FILES sfio/src/lib/sfio/Sfio_dc/Makefile" ;;
+  'lib/Makefile' ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
+  'libc/Makefile' ) CONFIG_FILES="$CONFIG_FILES libc/Makefile" ;;
+  'libident/Makefile' ) CONFIG_FILES="$CONFIG_FILES libident/Makefile" ;;
+  'libs/Makefile' ) CONFIG_FILES="$CONFIG_FILES libs/Makefile" ;;
+  'libsh/Makefile' ) CONFIG_FILES="$CONFIG_FILES libsh/Makefile" ;;
+  'libmalloc/Makefile' ) CONFIG_FILES="$CONFIG_FILES libmalloc/Makefile" ;;
+  'libmalloc/splay/Makefile' ) CONFIG_FILES="$CONFIG_FILES libmalloc/splay/Makefile" ;;
+  'libresolv/Makefile' ) CONFIG_FILES="$CONFIG_FILES libresolv/Makefile" ;;
+  'ssl/Makefile' ) CONFIG_FILES="$CONFIG_FILES ssl/Makefile" ;;
+  'doc/Makefile' ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+  'doc/design/Makefile' ) CONFIG_FILES="$CONFIG_FILES doc/design/Makefile" ;;
+  'include/mail.h' ) CONFIG_FILES="$CONFIG_FILES include/mail.h" ;;
+  'man/Makefile' ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
+  'utils/policy-builder.sh' ) CONFIG_FILES="$CONFIG_FILES utils/policy-builder.sh" ;;
+  'utils/Makefile' ) CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;;
+  'utils/zmailer.init.sh' ) CONFIG_FILES="$CONFIG_FILES utils/zmailer.init.sh" ;;
+  'utils/autoanswer.pl' ) CONFIG_FILES="$CONFIG_FILES utils/autoanswer.pl" ;;
+  'utils/vacation/Makefile' ) CONFIG_FILES="$CONFIG_FILES utils/vacation/Makefile" ;;
+  'man/vacation.1' ) CONFIG_FILES="$CONFIG_FILES man/vacation.1" ;;
+  'utils/vacation/vacation.sh' ) CONFIG_FILES="$CONFIG_FILES utils/vacation/vacation.sh" ;;
+  'utils/makedb/Makefile' ) CONFIG_FILES="$CONFIG_FILES utils/makedb/Makefile" ;;
+  'utils/rotate-logs.sh' ) CONFIG_FILES="$CONFIG_FILES utils/rotate-logs.sh" ;;
+  'utils/smtpserver-log-parser.pl' ) CONFIG_FILES="$CONFIG_FILES utils/smtpserver-log-parser.pl" ;;
+  'proto/Makefile' ) CONFIG_FILES="$CONFIG_FILES proto/Makefile" ;;
+  'proto/zmailer.sh' ) CONFIG_FILES="$CONFIG_FILES proto/zmailer.sh" ;;
+  'proto/newaliases' ) CONFIG_FILES="$CONFIG_FILES proto/newaliases" ;;
+  'proto/newfqdnaliases' ) CONFIG_FILES="$CONFIG_FILES proto/newfqdnaliases" ;;
+  'proto/newdb' ) CONFIG_FILES="$CONFIG_FILES proto/newdb" ;;
+  'proto/newdbprocessor' ) CONFIG_FILES="$CONFIG_FILES proto/newdbprocessor" ;;
+  'proto/scheduler.conf' ) CONFIG_FILES="$CONFIG_FILES proto/scheduler.conf" ;;
+  'proto/scheduler.auth' ) CONFIG_FILES="$CONFIG_FILES proto/scheduler.auth" ;;
+  'proto/mailrm.sh' ) CONFIG_FILES="$CONFIG_FILES proto/mailrm.sh" ;;
+  'proto/db/Makefile' ) CONFIG_FILES="$CONFIG_FILES proto/db/Makefile" ;;
+  'proto/cf/TELE-FI.cf' ) CONFIG_FILES="$CONFIG_FILES proto/cf/TELE-FI.cf" ;;
+  'proto/smtpserver.conf' ) CONFIG_FILES="$CONFIG_FILES proto/smtpserver.conf" ;;
+  'proto/cf/SMTP+UUCP.cf' ) CONFIG_FILES="$CONFIG_FILES proto/cf/SMTP+UUCP.cf" ;;
+  'proto/cf/UTdefault.cf' ) CONFIG_FILES="$CONFIG_FILES proto/cf/UTdefault.cf" ;;
+  'proto/cf/SMTP.cf' ) CONFIG_FILES="$CONFIG_FILES proto/cf/SMTP.cf" ;;
+  'proto/smtp-tls.conf' ) CONFIG_FILES="$CONFIG_FILES proto/smtp-tls.conf" ;;
+  'proto/db/aliases' ) CONFIG_FILES="$CONFIG_FILES proto/db/aliases" ;;
+  'proto/sm.conf' ) CONFIG_FILES="$CONFIG_FILES proto/sm.conf" ;;
+  'bin/mkdep' ) CONFIG_FILES="$CONFIG_FILES bin/mkdep" ;;
+  'bin/mklibdep' ) CONFIG_FILES="$CONFIG_FILES bin/mklibdep" ;;
+  'proto/post-install.sh' ) CONFIG_FILES="$CONFIG_FILES proto/post-install.sh" ;;
+  'utils/mxverify/Makefile' ) CONFIG_FILES="$CONFIG_FILES utils/mxverify/Makefile" ;;
+  'packaging/Makefile' ) CONFIG_FILES="$CONFIG_FILES packaging/Makefile" ;;
+  'packaging/solaris/Makefile' ) CONFIG_FILES="$CONFIG_FILES packaging/solaris/Makefile" ;;
+  'SiteConfig' ) CONFIG_FILES="$CONFIG_FILES SiteConfig" ;;
+  'default' ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+  'config.h' ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:14427: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+  *) { { echo "$as_me:14432: error: invalid argument: $1" >&5
+echo "$as_me: error: invalid argument: $1" >&2;}
+   { (exit 1); exit 1; }; };;
   esac
+  shift
 done
+
+EOF
 
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
+cat >>$CONFIG_STATUS <<\EOF
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
 
-trap 'rm -fr `echo "Makefile
-	router/Makefile			router/libdb/Makefile		\
-	scheduler/Makefile		smtpserver/Makefile		\
-	transports/Makefile		transports/smtp/Makefile	\
-	transports/mailbox/Makefile	transports/hold/Makefile	\
-	transports/libta/Makefile	transports/sm/Makefile		\
-	transports/errormail/Makefile	transports/fuzzyalias/Makefile	\
-	transports/expirer/Makefile	transports/expirer/manual-expirer \
-	compat/Makefile			compat/rmail/Makefile		\
-	compat/sendmail/Makefile					\
-	sfio/Makefile			sfio/src/lib/sfio/makefile	\
-	sfio/src/lib/sfio/Stdio_b/Makefile				\
-	sfio/src/lib/sfio/Stdio_s/Makefile				\
-	sfio/src/lib/sfio/Sfio_f/Makefile				\
-	sfio/src/lib/sfio/Sfio_dc/Makefile				\
-	lib/Makefile			libc/Makefile			\
-	libident/Makefile		libs/Makefile			\
-	libsh/Makefile			libmalloc/Makefile		\
-	libmalloc/splay/Makefile	libresolv/Makefile		\
-	ssl/Makefile							\
-	doc/Makefile			doc/design/Makefile		\
-	include/mail.h			man/Makefile			\
-	utils/policy-builder.sh		utils/Makefile			\
-	utils/zmailer.init.sh		utils/autoanswer.pl		\
-	utils/vacation/Makefile		man/vacation.1			\
-	utils/vacation/vacation.sh	utils/makedb/Makefile		\
-	utils/rotate-logs.sh		utils/smtpserver-log-parser.pl	\
-	proto/Makefile			proto/zmailer.sh		\
-	proto/newaliases		proto/newfqdnaliases		\
-	proto/newdb			proto/newdbprocessor		\
-	proto/scheduler.conf		proto/scheduler.auth		\
-	proto/mailrm.sh			proto/db/Makefile		\
-	proto/cf/TELE-FI.cf		proto/smtpserver.conf		\
-	proto/cf/SMTP+UUCP.cf		proto/cf/UTdefault.cf		\
-	proto/cf/SMTP.cf		proto/smtp-tls.conf		\
-	proto/db/aliases		proto/sm.conf			\
-	bin/mkdep			bin/mklibdep			\
-	proto/post-install.sh		utils/mxverify/Makefile		\
-	packaging/Makefile		packaging/solaris/Makefile	\
-	SiteConfig	 config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@CC@%$CC%g
-s%@CPP@%$CPP%g
-s%@MKDIR@%$MKDIR%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@PROGS@%$PROGS%g
-s%@LN@%$LN%g
-s%@MV@%$MV%g
-s%@RM@%$RM%g
-s%@TRUE@%$TRUE%g
-s%@PERL@%$PERL%g
-s%@GZIP@%$GZIP%g
-s%@LIBPROGS@%$LIBPROGS%g
-s%@CPPDEP@%$CPPDEP%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@RANLIB@%$RANLIB%g
-s%@AR@%$AR%g
-s%@LD@%$LD%g
-s%@YACC@%$YACC%g
-s%@LN_S@%$LN_S%g
-s%@GENINCL@%$GENINCL%g
-s%@GENLIB@%$GENLIB%g
-s%@ZMAILERCFGFILE@%$ZMAILERCFGFILE%g
-s%@MAILBOX@%$MAILBOX%g
-s%@POSTOFFICE@%$POSTOFFICE%g
-s%@MAILSHARE@%$MAILSHARE%g
-s%@MAILVAR@%$MAILVAR%g
-s%@MAILBIN@%$MAILBIN%g
-s%@LOGDIR@%$LOGDIR%g
-s%@ROUTEUSER_IN_ABNORMAL_UNIX@%$ROUTEUSER_IN_ABNORMAL_UNIX%g
-s%@NNTPSERVER@%$NNTPSERVER%g
-s%@INEWS@%$INEWS%g
-s%@SCHEDULEROPTIONS@%$SCHEDULEROPTIONS%g
-s%@ROUTEROPTIONS@%$ROUTEROPTIONS%g
-s%@SMTPOPTIONS@%$SMTPOPTIONS%g
-s%@SENDMAILPATH@%$SENDMAILPATH%g
-s%@RMAILPATH@%$RMAILPATH%g
-s%@VACATIONPATH@%$VACATIONPATH%g
-s%@SELFADDRESSES@%$SELFADDRESSES%g
-s%@LIBMALLOC@%$LIBMALLOC%g
-s%@MALLOC@%$MALLOC%g
-s%@MALLOCEXT@%$MALLOCEXT%g
-s%@HAVE_YP@%$HAVE_YP%g
-s%@LIBNIS@%$LIBNIS%g
-s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g
-s%@SHLIB_LD@%$SHLIB_LD%g
-s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g
-s%@DL_LIBS@%$DL_LIBS%g
-s%@LD_FLAGS@%$LD_FLAGS%g
-s%@LIBOBJS@%$LIBOBJS%g
-s%@DBTYPE@%$DBTYPE%g
-s%@DBEXT@%$DBEXT%g
-s%@DBEXTtest@%$DBEXTtest%g
-s%@INCLLDAP@%$INCLLDAP%g
-s%@LIBDBMS@%$LIBDBMS%g
-s%@LIBLOCALDBMS@%$LIBLOCALDBMS%g
-s%@AUTHLIB@%$AUTHLIB%g
-s%@LIBMAIL@%$LIBMAIL%g
-s%@LIBRESOLV@%$LIBRESOLV%g
-s%@INCLRESOLV@%$INCLRESOLV%g
-s%@LIBRESOLVA@%$LIBRESOLVA%g
-s%@LIBSOCKET@%$LIBSOCKET%g
-s%@RFC822TABS@%$RFC822TABS%g
-s%@LIBWRAP@%$LIBWRAP%g
-s%@INCLWRAP@%$INCLWRAP%g
-s%@PRIVATEMBOX@%$PRIVATEMBOX%g
-s%@PRIVATEAUTH@%$PRIVATEAUTH%g
-s%@LIBWHOSON@%$LIBWHOSON%g
-s%@INCLWHOSON@%$INCLWHOSON%g
-s%@DSPRINTF_TYPE@%$DSPRINTF_TYPE%g
-s%@ALLOCA@%$ALLOCA%g
-s%@GETPWLIB@%$GETPWLIB%g
-s%@OPENSSLPREFIX@%$OPENSSLPREFIX%g
-s%@OPENSSLINCL@%$OPENSSLINCL%g
-s%@OPENSSLLIB@%$OPENSSLLIB%g
-s%@MANDIR@%$MANDIR%g
-s%@PROCMAIL@%$PROCMAIL%g
-s%@MD5SUM@%$MD5SUM%g
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit $?); exit $?; }' 1 2 13 15
+}
 
-CEOF
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=/tmp}
+{
+  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=$TMPDIR/cs$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+   { (exit 1); exit 1; }
+}
+
 EOF
 
-cat >> $CONFIG_STATUS <<\EOF
+cat >>$CONFIG_STATUS <<EOF
 
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
-  if test $ac_beg -gt 1; then
-    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
-  else
-    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
-  fi
-  if test ! -s conftest.s$ac_file; then
-    ac_more_lines=false
-    rm -f conftest.s$ac_file
-  else
-    if test -z "$ac_sed_cmds"; then
-      ac_sed_cmds="sed -f conftest.s$ac_file"
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@DEFS@,$DEFS,;t t
+s,@LIBS@,$LIBS,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@CPP@,$CPP,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@MKDIR@,$MKDIR,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@PROGS@,$PROGS,;t t
+s,@LN@,$LN,;t t
+s,@MV@,$MV,;t t
+s,@RM@,$RM,;t t
+s,@TRUE@,$TRUE,;t t
+s,@PERL@,$PERL,;t t
+s,@GZIP@,$GZIP,;t t
+s,@LIBPROGS@,$LIBPROGS,;t t
+s,@CPPDEP@,$CPPDEP,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@AR@,$AR,;t t
+s,@LD@,$LD,;t t
+s,@YACC@,$YACC,;t t
+s,@LN_S@,$LN_S,;t t
+s,@GENINCL@,$GENINCL,;t t
+s,@GENLIB@,$GENLIB,;t t
+s,@ZMAILERCFGFILE@,$ZMAILERCFGFILE,;t t
+s,@MAILBOX@,$MAILBOX,;t t
+s,@POSTOFFICE@,$POSTOFFICE,;t t
+s,@MAILSHARE@,$MAILSHARE,;t t
+s,@MAILVAR@,$MAILVAR,;t t
+s,@MAILBIN@,$MAILBIN,;t t
+s,@LOGDIR@,$LOGDIR,;t t
+s,@ROUTEUSER_IN_ABNORMAL_UNIX@,$ROUTEUSER_IN_ABNORMAL_UNIX,;t t
+s,@NNTPSERVER@,$NNTPSERVER,;t t
+s,@INEWS@,$INEWS,;t t
+s,@SCHEDULEROPTIONS@,$SCHEDULEROPTIONS,;t t
+s,@ROUTEROPTIONS@,$ROUTEROPTIONS,;t t
+s,@SMTPOPTIONS@,$SMTPOPTIONS,;t t
+s,@SENDMAILPATH@,$SENDMAILPATH,;t t
+s,@RMAILPATH@,$RMAILPATH,;t t
+s,@VACATIONPATH@,$VACATIONPATH,;t t
+s,@SELFADDRESSES@,$SELFADDRESSES,;t t
+s,@LIBMALLOC@,$LIBMALLOC,;t t
+s,@MALLOC@,$MALLOC,;t t
+s,@MALLOCEXT@,$MALLOCEXT,;t t
+s,@HAVE_YP@,$HAVE_YP,;t t
+s,@LIBNIS@,$LIBNIS,;t t
+s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t
+s,@SHLIB_LD@,$SHLIB_LD,;t t
+s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t
+s,@DL_LIBS@,$DL_LIBS,;t t
+s,@LD_FLAGS@,$LD_FLAGS,;t t
+s,@DBTYPE@,$DBTYPE,;t t
+s,@DBEXT@,$DBEXT,;t t
+s,@DBEXTtest@,$DBEXTtest,;t t
+s,@INCLLDAP@,$INCLLDAP,;t t
+s,@LIBDBMS@,$LIBDBMS,;t t
+s,@LIBLOCALDBMS@,$LIBLOCALDBMS,;t t
+s,@AUTHLIB@,$AUTHLIB,;t t
+s,@LIBMAIL@,$LIBMAIL,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LIBRESOLV@,$LIBRESOLV,;t t
+s,@INCLRESOLV@,$INCLRESOLV,;t t
+s,@LIBRESOLVA@,$LIBRESOLVA,;t t
+s,@LIBSOCKET@,$LIBSOCKET,;t t
+s,@RFC822TABS@,$RFC822TABS,;t t
+s,@LIBWRAP@,$LIBWRAP,;t t
+s,@INCLWRAP@,$INCLWRAP,;t t
+s,@PRIVATEMBOX@,$PRIVATEMBOX,;t t
+s,@PRIVATEAUTH@,$PRIVATEAUTH,;t t
+s,@LIBWHOSON@,$LIBWHOSON,;t t
+s,@INCLWHOSON@,$INCLWHOSON,;t t
+s,@DSPRINTF_TYPE@,$DSPRINTF_TYPE,;t t
+s,@ALLOCA@,$ALLOCA,;t t
+s,@GETPWLIB@,$GETPWLIB,;t t
+s,@OPENSSLPREFIX@,$OPENSSLPREFIX,;t t
+s,@OPENSSLINCL@,$OPENSSLINCL,;t t
+s,@OPENSSLLIB@,$OPENSSLLIB,;t t
+s,@MANDIR@,$MANDIR,;t t
+s,@PROCMAIL@,$PROCMAIL,;t t
+s,@MD5SUM@,$MD5SUM,;t t
+CEOF
+
+EOF
+
+  cat >>$CONFIG_STATUS <<\EOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
     else
-      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
     fi
-    ac_file=`expr $ac_file + 1`
-    ac_beg=$ac_end
-    ac_end=`expr $ac_end + $ac_max_sed_cmds`
-  fi
-done
-if test -z "$ac_sed_cmds"; then
-  ac_sed_cmds=cat
-fi
-EOF
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+  	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+  	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
 
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile
-	router/Makefile			router/libdb/Makefile		\
-	scheduler/Makefile		smtpserver/Makefile		\
-	transports/Makefile		transports/smtp/Makefile	\
-	transports/mailbox/Makefile	transports/hold/Makefile	\
-	transports/libta/Makefile	transports/sm/Makefile		\
-	transports/errormail/Makefile	transports/fuzzyalias/Makefile	\
-	transports/expirer/Makefile	transports/expirer/manual-expirer \
-	compat/Makefile			compat/rmail/Makefile		\
-	compat/sendmail/Makefile					\
-	sfio/Makefile			sfio/src/lib/sfio/makefile	\
-	sfio/src/lib/sfio/Stdio_b/Makefile				\
-	sfio/src/lib/sfio/Stdio_s/Makefile				\
-	sfio/src/lib/sfio/Sfio_f/Makefile				\
-	sfio/src/lib/sfio/Sfio_dc/Makefile				\
-	lib/Makefile			libc/Makefile			\
-	libident/Makefile		libs/Makefile			\
-	libsh/Makefile			libmalloc/Makefile		\
-	libmalloc/splay/Makefile	libresolv/Makefile		\
-	ssl/Makefile							\
-	doc/Makefile			doc/design/Makefile		\
-	include/mail.h			man/Makefile			\
-	utils/policy-builder.sh		utils/Makefile			\
-	utils/zmailer.init.sh		utils/autoanswer.pl		\
-	utils/vacation/Makefile		man/vacation.1			\
-	utils/vacation/vacation.sh	utils/makedb/Makefile		\
-	utils/rotate-logs.sh		utils/smtpserver-log-parser.pl	\
-	proto/Makefile			proto/zmailer.sh		\
-	proto/newaliases		proto/newfqdnaliases		\
-	proto/newdb			proto/newdbprocessor		\
-	proto/scheduler.conf		proto/scheduler.auth		\
-	proto/mailrm.sh			proto/db/Makefile		\
-	proto/cf/TELE-FI.cf		proto/smtpserver.conf		\
-	proto/cf/SMTP+UUCP.cf		proto/cf/UTdefault.cf		\
-	proto/cf/SMTP.cf		proto/smtp-tls.conf		\
-	proto/db/aliases		proto/sm.conf			\
-	bin/mkdep			bin/mklibdep			\
-	proto/post-install.sh		utils/mxverify/Makefile		\
-	packaging/Makefile		packaging/solaris/Makefile	\
-	SiteConfig	"}
 EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+cat >>$CONFIG_STATUS <<\EOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
-       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-  *) ac_file_in="${ac_file}.in" ;;
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+        cat >$tmp/stdin
+        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
   esac
-
-  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
 
-  # Remove last slash and all that follows it.  Not all systems have dirname.
-  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$ac_file" : 'X\(//\)[^/]' \| \
+         X"$ac_file" : 'X\(//\)$' \| \
+         X"$ac_file" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-    # The file is in a subdirectory.
-    test ! -d "$ac_dir" && mkdir "$ac_dir"
-    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    { case "$ac_dir" in
+  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
+  *)                      as_incr_dir=.;;
+esac
+as_dummy="$ac_dir"
+for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
+  case $as_mkdir_dir in
+    # Skip DOS drivespec
+    ?:) as_incr_dir=$as_mkdir_dir ;;
+    *)
+      as_incr_dir=$as_incr_dir/$as_mkdir_dir
+      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
+    ;;
+  esac
+done; }
+
+    ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
     # A "../" for each directory in $ac_dir_suffix.
-    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+    ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
   else
     ac_dir_suffix= ac_dots=
   fi
 
-  case "$ac_given_srcdir" in
-  .)  srcdir=.
-      if test -z "$ac_dots"; then top_srcdir=.
-      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
-  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  case $srcdir in
+  .)  ac_srcdir=.
+      if test -z "$ac_dots"; then
+         ac_top_srcdir=.
+      else
+         ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
+      fi ;;
+  [\\/]* | ?:[\\/]* )
+      ac_srcdir=$srcdir$ac_dir_suffix;
+      ac_top_srcdir=$srcdir ;;
   *) # Relative path.
-    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
-    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+    ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_dots$srcdir ;;
   esac
 
-  case "$ac_given_INSTALL" in
-  [/$]*) INSTALL="$ac_given_INSTALL" ;;
-  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_dots$INSTALL ;;
   esac
 
-  echo creating "$ac_file"
-  rm -f "$ac_file"
-  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
-  case "$ac_file" in
-  *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
-  *) ac_comsub= ;;
-  esac
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:14715: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated automatically by config.status.  */
+  configure_input="Generated automatically from `echo $ac_file_in |
+                                                 sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]* | ?:[\\/]*)
+         # Absolute
+         test -f "$f" || { { echo "$as_me:14733: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         echo $f;;
+      *) # Relative
+         if test -f "$f"; then
+           # Build tree
+           echo $f
+         elif test -f "$srcdir/$f"; then
+           # Source tree
+           echo $srcdir/$f
+         else
+           # /dev/null tree
+           { { echo "$as_me:14746: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+EOF
+cat >>$CONFIG_STATUS <<EOF
+  sed "$ac_vpsub
+$extrasub
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
 
-  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
-  sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
+done
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+
+#
+# CONFIG_HEADER section.
+#
 
 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
 # NAME is the cpp macro being defined and VALUE is the value it is being given.
 #
 # ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
-ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
-ac_uB='\([ 	]\)%\1#\2define\3'
+ac_dA='s,^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
+ac_dB='[ 	].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
+ac_uB='$,\1#\2define\3'
 ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
+ac_uD=',;t'
 
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-cat >> $CONFIG_STATUS <<EOF
-  CONFIG_HEADERS="config.h"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
-       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-  *) ac_file_in="${ac_file}.in" ;;
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+        cat >$tmp/stdin
+        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
   esac
 
-  echo creating $ac_file
+  test x"$ac_file" != x- && { echo "$as_me:14807: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
 
-  rm -f conftest.frag conftest.in conftest.out
-  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
-  cat $ac_file_inputs > conftest.in
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]* | ?:[\\/]*)
+         # Absolute
+         test -f "$f" || { { echo "$as_me:14818: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         echo $f;;
+      *) # Relative
+         if test -f "$f"; then
+           # Build tree
+           echo $f
+         elif test -f "$srcdir/$f"; then
+           # Source tree
+           echo $srcdir/$f
+         else
+           # /dev/null tree
+           { { echo "$as_me:14831: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+  # Remove the trailing spaces.
+  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
 
 EOF
 
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h.  And first:
-# Protect against being on the right side of a sed subst in config.status.
-# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h.  The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status.  Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\EOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ 	]*#[ 	]*define[ 	][ 	]*\(\([^ 	(][^ 	(]*\)([^)]*)\)[ 	]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp
+t end
+s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+EOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless.  Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
 
 # This sed command replaces #undef with comments.  This is necessary, for
 # example, in the case of _POSIX_SOURCE, which is predefined and required
 # on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
-s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+cat >>conftest.undefs <<\EOF
+s,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
 EOF
 
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
-
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo '  if egrep "^[ 	]*#[ 	]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo '  :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+  # Write a limited-size here document to $tmp/defines.sed.
+  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#define' lines.
+  echo '/^[ 	]*#[ 	]*define/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/defines.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo '  fi # egrep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
 rm -f conftest.tail
-while :
+while grep . conftest.undefs >/dev/null
 do
-  ac_lines=`grep -c . conftest.vals`
-  # grep -c gives empty output for an empty file on some AIX systems.
-  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
-  # Write a limited-size here document to conftest.frag.
-  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+  # Write a limited-size here document to $tmp/undefs.sed.
+  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#undef'
+  echo '/^[ 	]*#[ 	]*undef/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
   echo 'CEOF
-  sed -f conftest.frag conftest.in > conftest.out
-  rm -f conftest.in
-  mv conftest.out conftest.in
-' >> $CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
-  rm -f conftest.vals
-  mv conftest.tail conftest.vals
-done
-rm -f conftest.vals
-
-cat >> $CONFIG_STATUS <<\EOF
-  rm -f conftest.frag conftest.h
-  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
-  cat conftest.in >> conftest.h
-  rm -f conftest.in
-  if cmp -s $ac_file conftest.h 2>/dev/null; then
-    echo "$ac_file is unchanged"
-    rm -f conftest.h
+  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+  rm -f conftest.undefs
+  mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\EOF
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated automatically by config.status.  */
+  if test x"$ac_file" = x-; then
+    echo "/* Generated automatically by configure.  */" >$tmp/config.h
   else
-    # Remove last slash and all that follows it.  Not all systems have dirname.
-      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+    echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
+  fi
+  cat $tmp/in >>$tmp/config.h
+  rm -f $tmp/in
+  if test x"$ac_file" != x-; then
+    if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
+      { echo "$as_me:14948: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$ac_file" : 'X\(//\)[^/]' \| \
+         X"$ac_file" : 'X\(//\)$' \| \
+         X"$ac_file" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-      # The file is in a subdirectory.
-      test ! -d "$ac_dir" && mkdir "$ac_dir"
+        { case "$ac_dir" in
+  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
+  *)                      as_incr_dir=.;;
+esac
+as_dummy="$ac_dir"
+for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
+  case $as_mkdir_dir in
+    # Skip DOS drivespec
+    ?:) as_incr_dir=$as_mkdir_dir ;;
+    *)
+      as_incr_dir=$as_incr_dir/$as_mkdir_dir
+      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
+    ;;
+  esac
+done; }
+
+      fi
+      rm -f $ac_file
+      mv $tmp/config.h $ac_file
     fi
-    rm -f $ac_file
-    mv conftest.h $ac_file
+  else
+    cat $tmp/config.h
+    rm -f $tmp/config.h
   fi
-fi; done
-
+done
 EOF
-cat >> $CONFIG_STATUS <<EOF
+cat >>$CONFIG_STATUS <<\EOF
 
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+
+  case $ac_dest in
+    default ) chmod 755 bin/*
+ echo > stamp-h ;;
+  esac
+done
 EOF
-cat >> $CONFIG_STATUS <<\EOF
-chmod 755 bin/*
- echo > stamp-h
-exit 0
+
+cat >>$CONFIG_STATUS <<\EOF
+
+{ (exit 0); exit 0; }
 EOF
 chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-echo "$ac_t""Remember to check  SiteConfig  for possible option changes" 1>&6
+ac_clean_files=$ac_clean_files_save
+
+test "$no_create" = yes || $SHELL $CONFIG_STATUS || { (exit 1); exit 1; }
+echo "$as_me:15013: result: Remember to check  SiteConfig  for possible option changes" >&5
+echo "${ECHO_T}Remember to check  SiteConfig  for possible option changes" >&6
Index: zmailer/configure.in
diff -u zmailer/configure.in:1.101 zmailer/configure.in:1.104
--- zmailer/configure.in:1.101	Fri Feb 16 03:16:40 2001
+++ zmailer/configure.in	Fri May  4 14:07:40 2001
@@ -174,6 +174,11 @@
                           to disable usage of existing zmailer.conf -file to
                           load existing defaults. ],
 	use_zcfg=1)
+load_zcfg=1
+AC_ARG_WITH(zconfig-noload,
+[  --with-zconfig-noload   Don't pre-load old values from possibly existing
+                          ZCONFIG file.],
+	load_zcfg=0)
 if test "$use_zcfg" = "0" ; then
 	ZMAILERCFGFILE="${ZMAILERCFGFILE-$ac_default_zmconfig}"
 	use_zcfg=1
@@ -188,7 +193,7 @@
 fi
 AC_MSG_RESULT([Using ZMailer parametrization file path: $ZMAILERCFGFILE])
 
-if test -r $ZMAILERCFGFILE -a "$use_zcfg" != "0" ; then
+if test -r $ZMAILERCFGFILE -a "$load_zcfg" != "0" ; then
   # Source the previous configuration values for various environment parameters
   . $ZMAILERCFGFILE
   AC_MSG_RESULT([   The file exists, we use its values as defaults])
@@ -523,8 +528,8 @@
 AC_STRUCT_TM
 AC_STRUCT_TM_GMTOFF
 
-AC_STRUCT_ST_BLOCKS
-AC_STRUCT_ST_BLKSIZE
+# AC_STRUCT_ST_BLOCKS
+# AC_STRUCT_ST_BLKSIZE
 
 AC_MSG_RESULT([Scanning possible database libraries in preferrence order:])
 AC_MSG_RESULT([   NDBM, SDBM, GDBM, BSD DB 1.x, SleepyCat DB 2.x])
@@ -1216,9 +1221,11 @@
 
 AC_CACHE_CHECK([existence of char **sys_siglist], ac_cv_arr_sys_siglist, [
 AC_TRY_LINK([extern char *sys_siglist[]; static char *s;], [s = sys_siglist[2]; ],
-		[AC_DEFINE(HAVE_SYS_SIGLIST)
-		 ac_cv_arr_sys_siglist=yes])
+		[ac_cv_arr_sys_siglist=yes])
 ])
+if test "$ac_cv_arr_sys_siglist" = yes ; then
+    AC_DEFINE(HAVE_SYS_SIGLIST)
+fi
 
 
 # Additional tests for the emulations..
@@ -1391,6 +1398,11 @@
 if test "$ac_with_ipv6_replacement_libc" = 1 ; then
   LIBOBJS="$LIBOBJS inet_ntop.o inet_pton.o getaddrinfo.o getnameinfo.o gai_strerror.o"
   AC_SUBST(LIBOBJS)
+  AC_DEFINE(HAVE_GETNAMEINFO)
+  AC_DEFINE(HAVE_GETADDRINFO)
+  AC_DEFINE(HAVE__GETADDRINFO_)
+  AC_DEFINE(HAVE_INET_NTOP)
+  AC_DEFINE(HAVE_INET_PTON)
 else
 
   t_oldLibs="$LIBS"
Index: zmailer/doc/manual/Makefile
diff -u zmailer/doc/manual/Makefile:1.28 zmailer/doc/manual/Makefile:1.31
--- zmailer/doc/manual/Makefile:1.28	Wed Feb 14 19:05:27 2001
+++ zmailer/doc/manual/Makefile	Tue Apr  3 14:30:03 2001
@@ -2,14 +2,13 @@
 # GNU-Makefile for ZMailer manual
 #
 
-#
-#  Utilizing DocBook 3.1, Structured Stylesheets, DSSSL, jade-1.2.2(+)
+VERSION = "v1.99.23"
+
 #
-#  All relevant bits are available at for example in redhat 6.2 beta
-#  as RPM packages (February 2000)
+#  Utilizing DocBook 3.1, Structured Stylesheets, DSSSL, openjade-1.3
 #
-#  (Well, not all, I have CUSTOMIZED JADE - I break certain ligatures
-#   at TeX source in a rather ugly manner, should have a better way..)
+#  All relevant bits are available at for example in redhat 7.1 beta
+#  as RPM packages (February 2001)
 #
 #  When your "make pdf" run complains about running out of some resource
 #  in TeX, go and edit file:  /usr/share/texmf/web2c/texmf.cnf
@@ -17,6 +16,11 @@
 #  At least:
 #     save_size = 30000       % for saving values outside current group
 #  and:
+#     % Max number of characters in all strings, including all error messages,
+#     % help texts, font names, control sequences.  These values apply to TeX and MP.
+#     pool_size.context = 750000
+#     pool_size.jadetex = 750000
+#     pool_size = 750000
 #     % Minimum pool space after TeX/MP's own strings; must be at least
 #     % 25000 less than pool_size, but doesn't need to be nearly that large.
 #     string_vacancies.context = 55000
@@ -27,6 +31,9 @@
 #     max_strings = 35000
 #
 
+# We run LOCAL version of Jade Wrapper (jw), which needs PATH with leading dot
+PATH := .:${PATH}
+
 PARTS=	zmanual.sgml		zmanual-cover.sgml		\
 	zadministration.sgml    zref-router.sgml		\
 	zapp-filefmts.sgml      zref-scheduler.sgml		\
@@ -38,14 +45,17 @@
 	zreference.sgml		zref-rmail.sgml			\
 	ztutorial.sgml		zappendices.sgml		\
 	zadm-dnsissues.sgml	zadm-router.sgml		\
-	zadm-sm.sgml		zadm-logging.sgml		\
+	zadm-transport-agents.sgml zadm-logging.sgml		\
 	zadm-scheduler.sgml	zadm-smtpserver.sgml		\
 	zadm-queues.sgml	zadm-security.sgml		\
 	zapp-rfc821.sgml	zapp-rfc821.sgml		\
 	zmanual.dsl
 
 FIGS   :=	msgmodl.fig msgrout.fig zmailer-logo.fig \
-		zmdirs.fig zmprocs.fig
+		zmdirs.fig zmprocs.fig zmprocs-smtps.fig \
+		zmprocs-router.fig zmprocs-scheduler.fig \
+		zmprocs-tragents.fig zadm-sch-threads.fig \
+		zmsched1.fig
 
 .SUFFIXES: .eps .pdf .ps .gif .fig .gif-green .png
 
@@ -58,7 +68,6 @@
 TEXINPUTS=$(LATEX2HTMLLIB):$(LINUXDOCLIB):$$TEXINPUTS:
 TEXENV=  TEXINPUTS=$(TEXINPUTS);export TEXINPUTS;
 
-
 GIFS = $(L2HGIFS) zmailer-logo2.gif
 
 all:
@@ -79,24 +88,30 @@
 
 $(L2HGIFS):
 
+z-version.txt: ${PARTS} ${FIGS}
+	echo "${VERSION}.`TZ=UTC date +%Y%m%d%H%M`" > z-version.txt
+
+
+OJCAT = /usr/share/sgml/openjade-1.3/catalog
+
 zmanual.html: gifs $(PARTS)
 	rm -rf zmanual
 	TZ=UTC date > z-datetime.txt
 	echo "HTML" > z-what.txt
 	echo '<!ENTITY GEXT "gif">' > z-gext.txt
+	make z-version.txt
 	make index-html
-	DB_STYLESHEET=`/bin/pwd`/zmanual.dsl sh ./db2html zmanual.sgml
-	#sh  ./db2html zmanual.sgml
+	./db2html -c ${OJCAT} -d `/bin/pwd`/'zmanual.dsl#html' zmanual.sgml
 	cp -p *.gif zmanual/
 	cd zmanual; ../html-post-fixup.sh *.html
 
 HTML.index:
 	touch genindex.sgm
-	DB_STYLESHEET=`/bin/pwd`/zmanual.dsl sh ./db2html -html-index zmanual.sgml
+	./db2html -c ${OJCAT} -d `/bin/pwd`/'zmanual.dsl#html' -V html-index zmanual.sgml
 	mv zmanual/HTML.index .
 
-index-html index-dvi index-pdf: HTML.index
-	perl ./collateindex.pl -f -g -i document-index -t Index -o genindex.sgm HTML.index
+genindex.sgm index-html index-dvi index-pdf: HTML.index
+	./collateindex.pl -d zman-index.html -f -g -i document-index -t Index -o genindex.sgm HTML.index
 
 zmanual.ps: zmanual.dvi $(FIGEPS)
 	dvips -ta4 -ozmanual.ps zmanual.dvi
@@ -105,15 +120,17 @@
 	TZ=UTC date > z-datetime.txt
 	echo "PostScript" > z-what.txt
 	echo '<!ENTITY GEXT "eps">' > z-gext.txt
+	make z-version.txt
 	make index-dvi
-	STYLESHEET=`/bin/pwd`/zmanual.dsl sh ./db2dvi zmanual.sgml
+	db2dvi -c ${OJCAT} -d `/bin/pwd`/'zmanual.dsl#print' zmanual.sgml
 
 zmanual.pdf: $(PARTS) $(FIGPDF) zmanual.sgml
 	TZ=UTC date > z-datetime.txt
 	echo "PDF" > z-what.txt
 	echo '<!ENTITY GEXT "pdf">' > z-gext.txt
+	make z-version.txt
 	make index-pdf
-	STYLESHEET=`/bin/pwd`/zmanual.dsl sh ./db2pdf zmanual.sgml
+	db2pdf -c ${OJCAT} -d `/bin/pwd`/'zmanual.dsl#pdf'  zmanual.sgml
 
 distclean clean:
 	# Leave "zmanual.ps" in place, if it exists
Index: zmailer/doc/manual/collateindex.pl
diff -u zmailer/doc/manual/collateindex.pl:1.1 zmailer/doc/manual/collateindex.pl:1.2
--- zmailer/doc/manual/collateindex.pl:1.1	Wed Feb 21 18:20:26 2001
+++ zmailer/doc/manual/collateindex.pl	Thu Mar  8 00:31:29 2001
@@ -1,6 +1,7 @@
 #! /usr/bin/perl
+# -*- Perl -*-
 #
-# $Id: collateindex.pl,v 1.1 2001/02/21 16:20:26 mea Exp $
+# $Id: collateindex.pl,v 1.2 2001/03/07 22:31:29 mea Exp $
 
 use Getopt::Std;
 
@@ -27,10 +28,11 @@
        -f        Force the output file to be written, even if it appears
                  to have been edited by hand.
        -N        New index (generates an empty index file).
+       -d file   <?dbhtml filename=\"file\"> tag filename.
        file      The file containing index data generated by Jade
                  with the DocBook HTML Stylesheet.\n";
 
-die $usage if ! getopts('Dfgi:NpP:s:o:S:I:t:x');
+die $usage if ! getopts('Dd:fgi:NpP:s:o:S:I:t:x');
 
 $linkpoints   = $opt_p;
 $lettergroups = $opt_g;
@@ -45,13 +47,16 @@
 $forceoutput  = $opt_f;
 $newindex     = $opt_N;
 $debug        = $opt_D;
+$DBHTML       = '';
+$DBHTML       = '<?dbhtml filename="'.$opt_d.'">' if ($opt_d);
 
+
 $indextag     = $setindex ? 'setindex' : 'index';
 
 if ($newindex) {
     safe_open(*OUT, $outfile);
     if ($indexid) {
-	print OUT "<$indextag ID='$indexid'>\n\n";
+	print OUT "<$indextag id='$indexid'>\n\n";
     } else {
 	print OUT "<$indextag>\n\n";
     }
@@ -114,35 +119,74 @@
 	next;
     }
 
+
     if (/^primary[\[ ](.*)$/i) {
 	if (/^primary\[(.*?)\] (.*)$/i) {
-	    $idx->{'psortas'} = $1;
-	    $idx->{'primary'} = $2;
+	    local($a1) = $1;
+	    local($a2) = $2;
+	    if ($a1 =~ m/\$[a-zA-Z]/) {
+		$idx->{'psortas'} = substr($a1, 1);
+	    } else {
+		$idx->{'psortas'} = $a1;
+	    }
+#printf "PSORTAS[]='%s'\n",$idx->{'psortas'};
+	    $idx->{'primary'} = $a2;
 	} else {
-	    $idx->{'psortas'} = $1;
-	    $idx->{'primary'} = $1;
+	    local($a1) = $1;
+	    local($a2) = $2;
+	    if ($a1 =~ m/\$[a-zA-Z]/) {
+		$idx->{'psortas'} = substr($a1, 1);
+	    } else {
+		$idx->{'psortas'} = $a1;
+	    }
+#printf "PSORTAS='%s'\n",$idx->{'psortas'};
+	    $idx->{'primary'} = $a1;
 	}
 	next;
     }
 
     if (/^secondary[\[ ](.*)$/i) {
 	if (/^secondary\[(.*?)\] (.*)$/i) {
-	    $idx->{'ssortas'} = $1;
-	    $idx->{'secondary'} = $2;
+	    local($a1) = $1;
+	    local($a2) = $2;
+	    if ($a1 =~ m/\$[a-zA-Z]/) {
+		$idx->{'ssortas'} = substr($a1, 1);
+	    } else {
+		$idx->{'ssortas'} = $a1;
+	    }
+	    $idx->{'secondary'} = $a2;
 	} else {
-	    $idx->{'ssortas'} = $1;
-	    $idx->{'secondary'} = $1;
+	    local($a1) = $1;
+	    local($a2) = $2;
+	    if ($a1 =~ m/\$[a-zA-Z]/) {
+		$idx->{'ssortas'} = substr($a1, 1);
+	    } else {
+		$idx->{'ssortas'} = $a1;
+	    }
+	    $idx->{'secondary'} = $a1;
 	}
 	next;
     }
 
     if (/^tertiary[\[ ](.*)$/i) {
 	if (/^tertiary\[(.*?)\] (.*)$/i) {
-	    $idx->{'tsortas'} = $1;
-	    $idx->{'tertiary'} = $2;
+	    local($a1) = $1;
+	    local($a2) = $2;
+	    if ($a1 =~ m/\$[a-zA-Z]/) {
+		$idx->{'tsortas'} = substr($a1, 1);
+	    } else {
+		$idx->{'tsortas'} = $a1;
+	    }
+	    $idx->{'tertiary'} = $a2;
 	} else {
-	    $idx->{'tsortas'} = $1;
-	    $idx->{'tertiary'} = $1;
+	    local($a1) = $1;
+	    local($a2) = $2;
+	    if ($a1 =~ m/\$[a-zA-Z]/) {
+		$idx->{'tsortas'} = substr($a1, 1);
+	    } else {
+		$idx->{'tsortas'} = $a1;
+	    }
+	    $idx->{'tertiary'} = $a1;
 	}
 	next;
     }
@@ -224,7 +268,7 @@
 
 # Write the index...
 if ($indexid) {
-    print OUT "<$indextag ID='$indexid'>\n\n";
+    print OUT "<$indextag id='$indexid'>$DBHTML\n\n";
 } else {
     print OUT "<$indextag>\n\n";
 }
@@ -442,7 +486,7 @@
 	    print OUT "\n  </$lastout>\n";
 	    $lastout = "";
 	}
-	print OUT $indent, "<seeie>", $idx->{'see'}, "</seeie>\n";
+	print OUT $indent, "<seeie>", &escape($idx->{'see'}), "</seeie>\n";
 	return;
     }
 
@@ -452,7 +496,7 @@
 	    print OUT "\n  </$lastout>\n";
 	    $lastout = "";
 	}
-	print OUT $indent, "<seealsoie>", $idx->{'seealso'}, "</seealsoie>\n";
+	print OUT $indent, "<seealsoie>", &escape($idx->{'seealso'}), "</seealsoie>\n";
 	return;
     }
 
@@ -480,17 +524,13 @@
 	    $linkend = $key;
 	}
 
-	$role = $linkend;
+	$role = $phref{$key};
 	$role = $1 if $role =~ /\#(.*)$/;
 
-	if ($role =~ m!(.+)\.html!) {
-	    $role = uc($1);
-	}
-
 	print OUT $indent;
 	print OUT "<ulink url=\"$linkend\" role=\"$role\">";
 	print OUT "<emphasis>" if ($idx->{'significance'} eq 'PREFERRED');
-	print OUT $href{$key};
+	print OUT &escape($href{$key});
 	print OUT "</emphasis>" if ($idx->{'significance'} eq 'PREFERRED');
 	print OUT "</ulink>";
     }
@@ -598,3 +638,14 @@
 	}
     }
 }
+
+sub escape {
+    # make sure & and < don't show up in the index
+    local $_ = shift;
+    s/&/&amp;/sg;
+    s/</&lt;/sg;
+    s/>/&gt;/sg; # what the heck
+
+    return $_;
+}
+
Index: zmailer/doc/manual/db2dvi
diff -u zmailer/doc/manual/db2dvi:1.1 zmailer/doc/manual/db2dvi:removed
--- zmailer/doc/manual/db2dvi:1.1	Fri Feb 16 17:58:48 2001
+++ zmailer/doc/manual/db2dvi	Tue May  8 16:00:09 2001
@@ -1,40 +0,0 @@
-#! /bin/sh
-
-: ${STYLESHEET:=/usr/lib/sgml/stylesheets/cygnus-both.dsl}
-: ${ADMON_GRAPHICS:=/usr/lib/sgml/stylesheets/nwalsh-modular/images/*.gif}
-
-if [ $# -gt 2 ]
-then
-  echo "Usage: `basename $0` [filename.sgml]" >&2
-  exit 1
-fi
-
-if [ $# -eq 1 ]
-then
-  if [ ! -r $1 ]
-  then
-    echo Cannot read \"$1\".  Exiting. >&2
-    exit 1
-  fi
-  if echo $1 | egrep -i '\.sgml$|\.sgm$' >/dev/null 2>&1
-  then
-    output="`echo $1 | sed 's,\.sgml$,.dvi,;s,\.sgm$,.dvi,'`"
-  fi
-fi
-
-echo OUTPUT FILE NAME IS $output
-
-TMPFN=`echo $1 | sed 's/\.sgml//'`
-
-jade -t tex -d ${STYLESHEET}\#print -o ${TMPFN}.tex $1
-
-jadetex ${TMPFN}.tex
-
-# if there are unresolved references, re-run jadetex, twice 
-if egrep '^LaTeX Warning: There were undefined references.$' ${TMPFN}.log >/dev/null 2>&1
-then
-    jadetex ${TMPFN}.tex
-    jadetex ${TMPFN}.tex
-fi
-
-exit 0
Index: zmailer/doc/manual/db2html
diff -u zmailer/doc/manual/db2html:1.1 zmailer/doc/manual/db2html:1.3
--- zmailer/doc/manual/db2html:1.1	Fri Feb 16 17:58:48 2001
+++ zmailer/doc/manual/db2html	Tue Apr  3 14:30:03 2001
@@ -1,80 +1,29 @@
 #! /bin/sh
-
-: ${DB_STYLESHEET:=/usr/lib/sgml/stylesheets/cygnus-both.dsl}
-: ${HTML_STYLESHEET:=/usr/lib/sgml/stylesheets/nwalsh-modular/test/docbook.css}
-: ${ADMON_GRAPHICS:=/usr/lib/sgml/stylesheets/nwalsh-modular/images/*.gif}
-
-output=db2html-dir
-TMPDIR=DBTOHTML_OUTPUT_DIR$$
-
-echo TMPDIR is $TMPDIR
-
-if [ "$1" = '-html-index' ]; then
-  HTMLINDEX="-V html-index"
-  shift
-fi
-
-if [ $# -gt 2 ]
-then
-  echo "Usage: `basename $0` [filename.sgml]" >&2
-  exit 1
-fi
-
-if [ $# -eq 1 ]
-then
-  if [ ! -r $1 ]
-  then
-    echo Cannot read \"$1\".  Exiting. >&2
-    exit 1
-  fi
-  if echo $1 | egrep -i '\.sgml$|\.sgm$' >/dev/null 2>&1
+output=docbook2html-dir
+skip=0
+for arg in $*
+do
+  if [ $skip -gt 0 ]
   then
-    # now make sure that the output directory is always a subdirectory
-    # of hte current directory
-    echo
-    input_file=`basename $1`
-    output="`echo $input_file | sed 's,\.sgml$,,;s,\.sgm$,,'`"
-    echo "input file was called $input_file -- output will be in $output"
-    echo
+    skip=$(($skip - 1))
+    continue
   fi
-fi
-
-# we used to generate a single file, but with the modular DB_STYLESHEETs
-# it's best to make a new directory with several html files in it
-#cat $* | jade -d $DB_STYLESHEET -t sgml -V nochunks > $TMPFN
-
-mkdir $TMPDIR
-SAVE_PWD=`pwd`
-if [ $1 = `basename $1` ]; then
-  echo "working on ../$1"
-  (cd $TMPDIR;
-     jade -t sgml -ihtml -d ${DB_STYLESHEET}\#html $HTMLINDEX ../$1)
-else
-  echo "working on $1"
-  (cd $TMPDIR;
-     jade -t sgml -ihtml -d ${DB_STYLESHEET}\#html $HTMLINDEX $1)
-fi
-
-if [ $# -eq 1 ]
+  case $arg in
+  -h|--help|-v|--version)	break
+				;;
+  -n|--nostd|-u|--nochunks)	;;
+  -*)				skip=1
+				;;
+  *)	output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,')"
+	echo "output is $output"
+	break
+	;;
+  esac
+done
+if [ -d ${output} ]
 then
-  if [ -d ${output}.junk ]
-  then
-    /bin/rm -rf ${output}.junk
-  fi
-  if [ -d ${output} ]
-  then
-    mv $output ${output}.junk
-  fi
-  echo "about to copy cascading stylesheet and admon graphics to temp dir"
-  cp ${HTML_STYLESHEET} ${TMPDIR}/
-  mkdir ${TMPDIR}/stylesheet-images
-  cp ${ADMON_GRAPHICS} ${TMPDIR}/stylesheet-images
-  echo "about to rename temporary directory to $output"
-  mv ${TMPDIR} $output
-else
-  cat $TMPDIR/*
+  rm -rf ${output}.junk
+  mv ${output} ${output}.junk
 fi
-
-rm -rf $TMPDIR
-
-exit 0
+mkdir ${output}
+jw -f docbook -b html -o ${output} "$@"
Index: zmailer/doc/manual/db2pdf
diff -u zmailer/doc/manual/db2pdf:1.1 zmailer/doc/manual/db2pdf:removed
--- zmailer/doc/manual/db2pdf:1.1	Fri Feb 16 17:58:48 2001
+++ zmailer/doc/manual/db2pdf	Tue May  8 16:00:09 2001
@@ -1,53 +0,0 @@
-#! /bin/sh
-
-: ${STYLESHEET:=/usr/lib/sgml/stylesheets/cygnus-both.dsl}
-
-TMPFN=`echo $1 | sed 's/\.sgml//'`
-
-if [ "$1" = '-html-index' ]; then
-  HTMLINDEX="-V html-index"
-  shift
-fi
-
-if [ $# -gt 2 ]
-then
-  echo "Usage: `basename $0` [filename.sgml]" >&2
-  exit 1
-fi
-
-if [ $# -eq 1 ]
-then
-  if [ ! -r $1 ]
-  then
-    echo Cannot read \"$1\".  Exiting. >&2
-    exit 1
-  fi
-  if echo $1 | egrep -i '\.sgml$|\.sgm$' >/dev/null 2>&1
-  then
-    output="`echo $1 | sed 's,\.sgml$,.pdf,;s,\.sgm$,.pdf,'`"
-  fi
-fi
-
-OFILE="-o ${TMPFN}.tex"
-if [ -n "$HTMLINDEX" ] ; then
-    OFILE=""
-fi
-
-jade -t tex -d "${STYLESHEET}#pdf" $OFILE $HTMLFILE $1
-
-pdfjadetex $TMPFN
-
-if egrep '^LaTeX Warning: There were undefined references.$' ${TMPFN}.log >/dev/null 2>&1
-then
-  pdfjadetex $TMPFN
-  pdfjadetex $TMPFN
-fi
-
-
-#if [ -f ${TMPFN}.cfg ]
-#then
-#  mv ${TMPFN}.cfg jade.cfg
-#fi
-
-exit 0
-
Index: zmailer/doc/manual/db2ps
diff -u zmailer/doc/manual/db2ps:1.1 zmailer/doc/manual/db2ps:removed
--- zmailer/doc/manual/db2ps:1.1	Fri Feb 16 17:58:48 2001
+++ zmailer/doc/manual/db2ps	Tue May  8 16:00:09 2001
@@ -1,68 +0,0 @@
-#! /bin/sh
-
-TMPFN=db2pstmp$$
-
-if [ $# -gt 2 ]
-then
-  echo "Usage: `basename $0` [filename.sgml]" >&2
-  exit 1
-fi
-
-output="`echo $1 | sed 's,\.sgml$,.ps,;s,\.sgm$,.ps,'`"
-outdvi="`echo $1 | sed 's,\.sgml$,.dvi,;s,\.sgm$,.dvi,'`"
-db2dvi $1
-dvips $outdvi -o $output
-
-exit 0
-
-if [ $# -eq 1 ]
-then
-  if [ ! -r $1 ]
-  then
-    echo Cannot read \"$1\".  Exiting. >&2
-    exit 1
-  fi
-  if echo $1 | egrep -i '\.sgml$|\.sgm$' >/dev/null 2>&1
-  then
-    output="`echo $1 | sed 's,\.sgml$,.ps,;s,\.sgm$,.ps,'`"
-    outdvi="`echo $1 | sed 's,\.sgml$,.dvi,;s,\.sgm$,.dvi,'`"
-    # if we have a filename argument let us improve the
-    # temporary filename, sine gv and ghostview will display it.
-    # this TMPFN has $1 embedded in it
-    TMPFN=`echo $1 | sed 's/\.sgml//'`_db2pstmp$$
-  fi
-fi
-
-#rm -f ${TMPFN}.dvi
-#cat $* | db2dvi > ${TMPFN}.dvi
-
-db2dvi $1
-
-if [ ! -f ${TMPFN}.dvi ]
-then
-  exit 1
-fi
-
-
-# dvips ${TMPFN}.dvi
-
-dvips $outdvi -o $output
-
-if [ -f ${TMPFN}.ps ]
-then
-  if [ $# -eq 1 ]
-  then
-    if [ -n "$output" ]
-    then
-      mv ${TMPFN}.ps $output
-    else
-      mv ${TMPFN}.ps db2ps.ps
-    fi
-  else
-    cat ${TMPFN}.ps
-  fi
-fi
-
-rm -f ${TMPFN}*
-
-exit 0
Index: zmailer/doc/manual/db2rtf
diff -u zmailer/doc/manual/db2rtf:1.1 zmailer/doc/manual/db2rtf:removed
--- zmailer/doc/manual/db2rtf:1.1	Fri Feb 16 17:58:48 2001
+++ zmailer/doc/manual/db2rtf	Tue May  8 16:00:09 2001
@@ -1,44 +0,0 @@
-#! /bin/sh
-
-#STYLESHEET=/usr/lib/sgml/stylesheets/docbook/print/docbook.dsl
-${STYLESHEET:=/usr/lib/sgml/stylesheets/cygnus-both.dsl}
-${ADMON_GRAPHICS:=/usr/lib/sgml/stylesheets/nwalsh-modular/images/*.gif}
-
-output=db2rtf.rtf
-#TMPFN=db2rtf$$.rtf
-
-# setting SGML_CATALOG_FILES should be done in the Makefile at build time
-# of jade but I set it here anyway in case someone forgets.
-
-if [ $# -gt 2 ]
-then
-  echo "Usage: `basename $0` [filename.sgml]" >&2
-  exit 1
-fi
-
-if [ $# -eq 1 ]
-then
-  if [ ! -r $1 ]
-  then
-    echo Cannot read \"$1\".  Exiting. >&2
-    exit 1
-  fi
-  if echo $1 | egrep -i '\.sgml$|\.sgm$' >/dev/null 2>&1
-  then
-    output="`echo $1 | sed 's,\.sgml$,.rtf,;s,\.sgm$,.rtf,'`"
-  fi
-fi
-
-### echo "about to copy admon graphics to this dir"
-### cp ${ADMON_GRAPHICS} .
-
-cat $* | jade -t rtf -d ${STYLESHEET}\#print
-
-if [ $# -eq 1 ]
-then
-  mv jade-out.rtf $output
-else
-  cat jade-out.rtf
-fi
-
-exit 0
Index: zmailer/doc/manual/dbskel.tar.gz
Index: zmailer/doc/manual/isoents.tex
diff -u zmailer/doc/manual/isoents.tex:1.1 zmailer/doc/manual/isoents.tex:removed
--- zmailer/doc/manual/isoents.tex:1.1	Fri Feb 16 17:58:48 2001
+++ zmailer/doc/manual/isoents.tex	Tue May  8 16:00:09 2001
@@ -1,12 +0,0 @@
-%%
-%% This is file `isoents.tex',
-%% Manually created after the model of JadeTeX  isoents.tex to define
-%% a few of my own magic entities.
-%% 
-\expandafter\def\csname Entdd\endcsname{{\char45{}\char45}}%
-\expandafter\def\csname Entddash\endcsname{{\char45{}\char45}}%
-\expandafter\def\csname EntPGBREAK\endcsname{{\pagebreak}}%
-\input /usr/share/texmf/tex/jadetex/isoents.tex
-\endinput
-%%
-%% End of file `isoents.tex'.
Index: zmailer/doc/manual/jadetex.cfg
diff -u /dev/null zmailer/doc/manual/jadetex.cfg:1.1
--- /dev/null	Tue May  8 16:00:09 2001
+++ zmailer/doc/manual/jadetex.cfg	Thu Mar  8 00:31:29 2001
@@ -0,0 +1,10 @@
+%%
+%% This is file `uentities.sty',
+%% Manually created after the model of JadeTeX-3.3-1  uentities.sty to define
+%% a few of my own magic entities.
+%% 
+\expandafter\def\csname Entdd\endcsname{{\char45{}\char45}}%
+\expandafter\def\csname Entddash\endcsname{{\char45{}\char45}}%
+\expandafter\def\csname EntPGBREAK\endcsname{{\pagebreak}}%
+%%
+%% End of file `uentities.sty'.
Index: zmailer/doc/manual/jw
diff -u /dev/null zmailer/doc/manual/jw:1.2
--- /dev/null	Tue May  8 16:00:09 2001
+++ zmailer/doc/manual/jw	Tue Apr  3 14:30:03 2001
@@ -0,0 +1,322 @@
+#! /bin/sh
+# Jade Wrapper
+# Script to convert a SGML file into some other format
+# Send any comments to Eric Bischoff <eric@caldera.de>
+# This program is under GPL license. See LICENSE file for details.
+
+# Set help message
+SGML_HELP_MESSAGE="Usage: `basename $0` [<options>] <sgml_file>\n\
+where <options> are:\n\
+\040 -f|--frontend <frontend>: \t Specify the frontend (source format)\n\
+\040 \t\t\t\t (default is docbook)\n\
+\040 -b|--backend <backend>: \t Specify the backend (destination format)\n\
+\040 \t\t\t\t (default is html)\n\
+\040 -c|--cat <file>: \t\t Specify an extra SGML open catalog\n\
+\040 -n|--nostd: \t\t\t Do not use the standard SGML open catalogs\n\
+\040 -d|--dsl <file>|default|none:\t Specify an alternate style sheet\n\
+\040 \t\t\t\t (default is to use the default stylesheet)\n\
+\040 -s|--sgmlbase <path>: \t Change base directory for SGML distribution\n\
+\040 \t\t\t\t (usually /usr/share/sgml)\n\
+\040 -p|--parser <program>: \t Specify the parser if several are installed\n\
+\040 \t\t\t\t  (jade or openjade)\n\
+\040 -o|--output <directory>: \t Set output directory\n\
+\040 -u|--nochunks: \t\t Output only one big file\n\
+\040 \t\t\t\t (overrides the stylesheet settings)\n\
+\040 -i|--include <section>: \t Specify a SGML marked section to include\n\
+\040 \t\t\t\t (should be marked as \"ignore\" in the SGML text)\n\
+\040 -h|--help: \t\t\t Print this help message and exit\n\
+\040 -V <variable[=value]>: \t Set a variable\n\
+\040 -v|--version: \t\t Print the version and exit"
+
+# Get name of main SGML configuration file
+which sgmlwhich >/dev/null 2>/dev/null
+if [ $? -eq 0 ]
+then
+  SGML_CONF=`sgmlwhich`
+else
+  SGML_CONF="/etc/sgml/sgml.conf"
+fi
+
+# Set version message
+SGML_VERSION_MESSAGE="DocBook-utils version 0.6 (jw version 1.1)"
+
+# Set frontend to use
+SGML_FRONTEND="docbook"
+
+# Set backend to use
+SGML_BACKEND="html"
+
+# Set option: use standard catalogs
+SGML_STANDARD_CATALOGS="yes"
+
+# Set path to user SGML catalogs
+SGML_EXTRA_CATALOGS=""
+
+# Set SGML base directory and centralized catalogs directory
+SGML_BASE_DIR="/usr/share/sgml"
+SGML_CATALOGS_DIR="/etc/sgml"
+if [ -f "$SGML_CONF" ]
+then
+  RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*'
+  SGML_BASE_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"`
+  RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*'
+  SGML_CATALOGS_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"`
+fi
+
+# Set main stylesheet
+SGML_STYLESHEET="default"
+
+# Set flavour of jade parser to use
+SGML_JADE=""
+
+# Set SGML declaration and file to process
+SGML_DECL=""
+SGML_FILE=""
+
+# Set output and current directories
+SGML_OUTPUT_DIRECTORY="."
+SGML_CURRENT_DIRECTORY=`pwd`
+
+# Set option: do not output many chunks
+SGML_OPTIONS=""
+
+# Set list of "include" marked sections
+SGML_INCLUDE=""
+
+# Process options
+while [ $# -gt 0 ]
+do case $1 in
+  -f|--frontend) SGML_FRONTEND=$2
+		shift 2
+		;;
+  -b|--backend)	SGML_BACKEND=$2
+		shift 2
+		;;
+  -c|--cat)	SGML_EXTRA_CATALOGS=$SGML_EXTRA_CATALOGS:$2
+		shift 2
+		;;
+  -d|--dsl)	SGML_STYLESHEET=$2
+		shift 2
+		;;
+  -l|--dcl)	SGML_DECL=$2
+		shift 2
+		;;
+  -n|--nostd)	SGML_STANDARD_CATALOGS="no"
+		shift 1
+		;;
+  -s|--sgmlbase) SGML_BASE_DIR=$2
+		shift 2
+		;;
+  -p|--parser)	SGML_JADE=$2
+		shift 2
+		;;
+  -o|--output)	SGML_OUTPUT_DIRECTORY=$2
+		shift 2
+		;;
+  -u|--nochunks) SGML_OPTIONS="$SGML_OPTIONS -V nochunks"
+		shift 1
+		;;
+  -V)		SGML_OPTIONS="$SGML_OPTIONS -V $2"
+		shift 2
+		;;
+  -i|--include)	case $2 in
+		  print|html)	echo "The marked section named \"$2\" is reserved for internal use by `basename $0`."
+				exit 1
+				;;
+		esac
+		SGML_INCLUDE="$SGML_INCLUDE -i $2"
+		shift 2
+		;;
+  -h|--help)	echo -e "`basename $0` - Jade Wrapper\n"
+		echo -e $SGML_HELP_MESSAGE
+		exit 0
+		;;
+  -v|--version)	echo -e $SGML_VERSION_MESSAGE
+		exit 0
+		;;
+  -*)		echo -e $SGML_HELP_MESSAGE >&2
+		exit 1
+		;;
+  *)		if [ -z "$SGML_FILE" ]
+		then
+		  SGML_FILE=$1
+		  shift 1
+		else
+		  echo -e $SGML_HELP_MESSAGE >&2
+		  exit 1
+		fi
+		;;
+  esac
+done
+
+# Check that we have a frontend
+if [ -z "$SGML_FRONTEND" ]
+then
+  echo -e $SGML_HELP_MESSAGE >&2
+  exit 1
+fi
+if [ -n "${SGML_FRONTEND%%/*}" ]
+then
+  SGML_FRONTEND=$SGML_BASE_DIR/docbook/utils-0.6/frontends/$SGML_FRONTEND
+fi
+if [ ! -s $SGML_FRONTEND ]
+then
+  echo "`basename $0`: There is no frontend called \"$SGML_FRONTEND\"." >&2
+  exit 2
+fi
+
+# Check that we have a backend
+if [ -z "$SGML_BACKEND" ]
+then
+  echo -e $SGML_HELP_MESSAGE >&2
+  exit 1
+fi
+if [ -n "${SGML_BACKEND%%/*}" ]
+then
+  SGML_BACKEND=$SGML_BASE_DIR/docbook/utils-0.6/backends/$SGML_BACKEND
+fi
+if [ ! -s $SGML_BACKEND ]
+then
+  echo "`basename $0`: There is no backend called \"$SGML_BACKEND\"." >&2
+  exit 2
+fi
+
+# Check that we have a file to process
+if [ -z "$SGML_FILE" ]
+then
+  echo -e $SGML_HELP_MESSAGE >&2
+  exit 1
+fi
+case $SGML_FILE in
+   /*)	;;
+   *)	SGML_FILE=`pwd`/$SGML_FILE
+	;;
+esac
+if [ ! -s $SGML_FILE ]
+then
+  echo "`basename $0`: Cannot open \"$SGML_FILE\"." >&2
+  exit 3
+fi
+
+# Separate the file name and the extension (if any)
+SGML_FILE_NAME=`basename $SGML_FILE`
+SGML_FILE_NAME=${SGML_FILE_NAME%.*}
+
+# Determine if we are in an XML file
+SGML_XML=`(grep "<?xml.*?>" $SGML_FILE; echo "sgml") | head -n 1 | sed 's/^.*xml.*$/xml/'`
+
+# Use SGML declaration for XML if needed
+if [ "$SGML_DECL" = "" -a "$SGML_XML" = "xml" ]
+then SGML_DECL=${SGML_BASE_DIR}/xml.dcl
+fi
+
+# Set path to SGML catalogs (first try centralized catalog)
+case $SGML_STANDARD_CATALOGS in
+  yes)	export SGML_CATALOGS_DIR SGML_FILE SGML_XML
+	SGML_CENTRALIZED_CATALOG=`sh $SGML_FRONTEND centralized-catalog`
+	if [ -s $SGML_CENTRALIZED_CATALOG ]
+	then
+	  SGML_CATALOG_FILES=$SGML_CENTRALIZED_CATALOG
+	else
+	  SGML_CATALOG_FILES=`find $SGML_BASE_DIR -name catalog`
+	  SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | tr [:space:] :`
+	fi
+	;;
+  no)	SGML_CATALOG_FILES=""
+	;;
+esac
+SGML_CATALOG_FILES=${SGML_CATALOG_FILES}${SGML_EXTRA_CATALOGS}
+SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | sed 's/^://;s/:$//'`
+if [ -z "$SGML_CATALOG_FILES" ]
+then
+  echo "`basename $0`: Please specify at least one catalog" >&2
+  exit 4
+fi
+
+# Determine the backend type
+case $SGML_BACKEND in
+  *html) \
+	SGML_TYPE=html
+	;;
+  *)	SGML_TYPE=print
+	;;
+esac
+
+# Determine which stylesheet to use
+# (run the frontend to know it if the default stylesheet or no custom stylesheet is desired)
+if [ "$SGML_STYLESHEET" = "default" -o "$SGML_STYLESHEET" = "none" ]
+then
+  export SGML_BASE_DIR SGML_TYPE SGML_STYLESHEET
+  SGML_STYLESHEET=`sh $SGML_FRONTEND style-sheet`
+  SGML_RETURN=$?
+  if [ $SGML_RETURN -gt 0 ]
+  then exit `expr 7 + $SGML_RETURN`
+  fi
+fi
+if [ -z "$SGML_STYLESHEET" ]
+then
+  echo "`basename $0`: Please specify at least one stylesheet" >&2
+  exit 5
+fi
+
+# Choose a parser
+if [ -z "$SGML_JADE" ]
+then
+  which jade >/dev/null 2>/dev/null
+  if [ $? -eq 0 ]
+  then
+    SGML_JADE="jade"
+  else
+    which openjade >/dev/null 2>/dev/null
+    if [ $? -eq 0 ]
+    then 
+      SGML_JADE="openjade"
+    else
+      echo "`basename $0`: No parser available" >&2
+      exit 6
+    fi
+  fi
+else
+  which $SGML_JADE >/dev/null 2>/dev/null
+  if [ $? -ne 0 ]
+  then 
+    echo "`basename $0`: parser $SGML_JADE is not available" >&2
+    exit 6
+  fi
+fi
+
+# Create output directory if not available
+if [ -z "$SGML_OUTPUT_DIRECTORY" ]
+then
+  echo -e $SGML_HELP_MESSAGE >&2
+  exit 1
+fi
+if [ ! -d $SGML_OUTPUT_DIRECTORY ]
+then
+  mkdir $SGML_OUTPUT_DIRECTORY 2>/dev/null
+  if [ $? -ne 0 ]
+  then
+    echo "`basename $0`: Could not create \"$SGML_OUTPUT_DIRECTORY\" output directory" >&2
+    exit 7
+  fi
+fi
+
+# Prepare the parser's arguments
+SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_DECL $SGML_FILE"
+
+# Call the backend
+echo "Using catalogs: `echo $SGML_CATALOG_FILES | sed 's/:/, /g'`"
+echo "Using stylesheet: $SGML_STYLESHEET"
+echo "Working on: $SGML_FILE"
+cd $SGML_OUTPUT_DIRECTORY
+export SGML_JADE SGML_FILE_NAME SGML_ARGUMENTS
+export SGML_CATALOG_FILES SGML_BASE_DIR SGML_FILE SGML_STYLESHEET
+sh -x $SGML_BACKEND
+SGML_RETURN=$?
+cd $SGML_CURRENT_DIRECTORY
+
+if [ $SGML_RETURN -gt 0 ]
+then exit `expr 7 + $SGML_RETURN`
+fi
+echo "Done."
+exit 0
Index: zmailer/doc/manual/zadm-logging.sgml
diff -u zmailer/doc/manual/zadm-logging.sgml:1.7 zmailer/doc/manual/zadm-logging.sgml:1.10
--- zmailer/doc/manual/zadm-logging.sgml:1.7	Wed Feb 21 18:20:26 2001
+++ zmailer/doc/manual/zadm-logging.sgml	Tue Apr  3 14:30:03 2001
@@ -1,325 +1,16 @@
 <CHAPTER ID="ZADM-LOGGING"><?dbhtml filename="zadm-logging.html">
-<TITLE>Logging and Statistics</TITLE>
+<TITLE>Logging and Statistics for Administrator</TITLE>
 
 <PARA>
-<EMPHASIS>
-This text has been copied from other sections and will change...
-</EMPHASIS>
-</PARA>
-
-
-<!-- ..........................................................
-
-<SECT1 ID=zadm-logging-checking-log-files>
-<TITLE>Checking the Log Files</>
-
-<PARA>
-Start ZMailer:
 <SCREEN>
- $MAILBIN/zmailer
-</SCREEN>
-</PARA>
-
-<PARA>
-Keep an eye on the log files (<FILENAME>$<VARNAME>LOGDIR</>/router</>,
-<FILENAME>$<VARNAME>LOGDIR</>/scheduler</>), the
-<FILENAME CLASS="DIRECTORY">$<VARNAME>POSTOFFICE</>/postman/</>
-directory for malformed message files, and
-<FILENAME CLASS="DIRECTORY">$<VARNAME>POSTOFFICE</>/deferred/</>
-in case of resource problems.
-</PARA>
-
-</SECT1>
-
-<SECT1 ID=zadm-logging-trimdown>
-<TITLE>Trimdown of Logging</>
-
-<PARA>
-Once satisfied that things appear to work, you may want to trim down
-logging: there are 4 kinds of logging to deal with:
-<ITEMIZEDLIST>
-<LISTITEM><PARA>
-router logs, usually kept in <FILENAME>$<VARNAME>LOGDIR</>/router</>.
-This is the stdout and stderr output of the router daemon.
-If you wish to turn it off, invoke router with a ``<OPTION>-L /dev/null</>''
-option, i.e. change the <COMMAND>zmailer</> script.
-Alternatively, modify the <FUNCTION>log()</> function in the configuration
-file, or its invocations.
-</PARA></LISTITEM>
+  What material is applicable here ?
 
-<LISTITEM><PARA>
-scheduler logs, usually kept in <FILENAME>$<VARNAME>LOGDIR</>/scheduler</>.
-Same as router.
-</PARA></LISTITEM>
+  How to control logging ?
+   - Settings/variables/whatnot controlling it
 
-<LISTITEM><PARA>
-general mail logs, usually kept in syslog files, depending on how
-you have configured the syslog utility (<FILENAME>/etc/syslog.conf</>).
-All ZMailer programs log using the <CONSTANT>LOG_MAIL</> facility code
-for normal messages.
-You can deal with this specifically in your <COMMAND>syslogd</>(8)
-configuration file on systems with a 4.3bsd-based syslog.
-The following reflects the recommended configuration on SunOS 4.0:
-<SCREEN>
-  mail.crit   /var/log/syslog
-  mail.debug  /var/log/mail
+  How to rotate logfiles ?
+   - Example scripts for rotation ?
 </SCREEN>
 </PARA>
-<PARA>
-For pre-4.3bsd-based syslogs, you may want the syslog log file to be just
-for important messages (e.g. <CONSTANT>LOG_NOTICE</> and higher priority), and have
-a separate file for informational messages (<CONSTANT>LOG_DEBUG</> and up).
-</PARA></LISTITEM>
-
-<LISTITEM><PARA>
-By default, the postmaster will <EMPHASIS>not</> receive a copy of
-all bounced mail; this can be turned on selectively by simply editing
-the various canned forms used to create the error messages.
-These forms are located in the <VARNAME>FORMSDIR</>
-(<FILENAME CLASS="DIRECTORY">proto/forms/</> in the distribution,
-or <FILENAME CLASS="DIRECTORY">$<VARNAME>MAILSHARE</>/forms/</>
-when installed).
-You should review these in any case to make sure the text is appropriate
-for your site.
-</PARA></LISTITEM>
-</ITEMIZEDLIST>
-</PARA>
-
-</SECT1>
-........................................................ -->
-
-<SECT1 ID=zadm-logging-scheduler-perflog>
-<TITLE><COMMAND>Scheduler</> Statistics Log</>
-
-<PARA>
-The  statistics log reports condenced performance oriented
-information in following format:
-<INFORMALTABLE ROWSEP=0 COLSEP=0>
-<TGROUP COLS=6>
-<COLSPEC ALIGN=LEFT>
-<COLSPEC ALIGN=LEFT>
-<COLSPEC ALIGN=CENTER>
-<COLSPEC ALIGN=CENTER>
-<COLSPEC ALIGN=LEFT>
-<COLSPEC ALIGN=LEFT>
-<THEAD>
-<ROW ROWSEP=1>
- <ENTRY ALIGN=LEFT>timestamp</>
- <ENTRY ALIGN=LEFT>fileid</>
- <ENTRY ALIGN=CENTER>dt1</>
- <ENTRY ALIGN=CENTER>dt2</>
- <ENTRY ALIGN=LEFT>state</>
- <ENTRY ALIGN=LEFT>$channel/$host</>
-</ROW>
-</THEAD>
-<TBODY>
-<ROW>
- <ENTRY>812876190</>
- <ENTRY>90401-2</>
- <ENTRY>0</>
- <ENTRY>5</>
- <ENTRY>ok</>
- <ENTRY>usenet/-</>
-</ROW>
-<ROW>
- <ENTRY>812876228</>
- <ENTRY>90401-1</>
- <ENTRY>0</>
- <ENTRY>7</>
- <ENTRY>ok</>
- <ENTRY>usenet/-</>
-</ROW>
-<ROW>
- <ENTRY>812876244</>
- <ENTRY>90401-1</>
- <ENTRY>0</>
- <ENTRY>1</>
- <ENTRY>ok</>
- <ENTRY>local/gopher-admin</>
-</ROW>
-<ROW>
- <ENTRY>812876244</>
- <ENTRY>90401-1</>
- <ENTRY>0</>
- <ENTRY>5</>
- <ENTRY>ok</>
- <ENTRY>smtp/funet.fi</>
-</ROW>
-<ROW>
- <ENTRY>812876559</>
- <ENTRY>90401-1</>
- <ENTRY>0</>
- <ENTRY>21</>
- <ENTRY>ok</>
- <ENTRY>smtp/utu.fi</>
-</ROW>
-</TBODY>
-</TGROUP>
-</INFORMALTABLE>
-where the fields are:
-
-<VARIABLELIST>
-<VARLISTENTRY><TERM><OPTION>timestamp</></><LISTITEM><PARA>
-The original spoolfile <EMPHASIS>ctime</> (creation time) stamp in decimal.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>fileid</></><LISTITEM><PARA>
-Spoolfile name after the router has processed it.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>dt1</></><LISTITEM><PARA>
-The time difference from spoolfile ctime to 
-scheduler control file creation by the router.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>dt2</></><LISTITEM><PARA>
-The time difference from scheduler file <EMPHASIS>ctime</> to
-the delivery that is logged on.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>state</></><LISTITEM><PARA>
-What happened?  Values: ok, ok2, ok3, error, error2, expiry
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>$channel/$host</></><LISTITEM><PARA>
-Where/how it was processed.
-</PARA></LISTITEM></VARLISTENTRY>
-</VARIABLELIST>
-</PARA>
-
-</SECT1>
-
-<SECT1 ID=zadm-logging-syslogged-log-formats>
-<TITLE>Syslogged Log Formats</>
-
-<PARA>
-At <EMPHASIS>syslog</> facility the system logs also material,
-if it has so been configured.
-</PARA>
-
-<PARA>
-Different subsystems do different logs, they are described below.
-</PARA>
-
-<SECT2 ID=zadm-logging-syslog-from-smtpserver>
-<TITLE><COMMAND>Smtpserver</>'s Syslog Format</TITLE>
-
-<PARA>
-The <EMPHASIS>smtpserver</> may log in multiple formats:
-<VARIABLELIST>
-<VARLISTENTRY>
-<TERM>INFO: connection from ...</TERM>
-<TERM>WARN: refusing connection from ...</TERM>
-<TERM>INFO: accepted id ... into freeze..</TERM>
-<TERM>INFO: TASPID accepted from...</TERM>
-<LISTITEM><PARA>
-where TASPID: A spool-id that is valid throughout message lifetime
-in the system, and should be long-term unique, even.  (Per system.)
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY>
-<TERM>EMERG: smtpserver policy database problem...</TERM>
-<TERM>ERR:  MAILBIN unspecified in zmailer.conf</TERM>
-<LISTITEM><PARA></PARA></LISTITEM>
-</VARLISTENTRY>
-</VARIABLELIST>
-</PARA>
-
-</SECT2>
-
-<SECT2 ID=zadm-logging-syslog-from-router>
-<TITLE><COMMAND>Router</>'s Syslog Format</TITLE>
-
-<PARA>
-The <EMPHASIS>router</> does <FUNCTION>syslog</>() in following format:
-</PARA>
-
-<PARA>
-<SYNOPSIS>taspid: from=&lt;addr&gt;, rrelay=smtprelay, size=nnn, nrcpts=nnn, msgid=str</SYNOPSIS>
-</PARA>
-
-<PARA>
-Where:
-<VARIABLELIST>
-<VARLISTENTRY><TERM><OPTION>taspid</></><LISTITEM><PARA>
-The TA-SPOOL-ID &mdash; A spool-id that is valid throughout message lifetime
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>from=</></><LISTITEM><PARA>
-the envelope source address
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>rrelay=</></><LISTITEM><PARA>
-the message ``rcvdfrom'' envelope header reports.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>size=</></><LISTITEM><PARA>
-Total message size in bytes (envelope+headers+body)
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>nrcpts=</></><LISTITEM><PARA>
-Number of recipients for this message
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>msgid=</></><LISTITEM><PARA>
-The ``Message-ID:'' header content
-</PARA></LISTITEM></VARLISTENTRY>
-</VARIABLELIST>
-</PARA>
-
-</SECT2>
-
-<SECT2 ID=zadm-logging-syslog-from-transport-agents>
-<TITLE>Transport Agent's Syslog Format</TITLE>
-
-<PARA>
-The transport agents log in following format:
-</PARA>
-
-<PARA>
-<SYNOPSIS>taspid: to=&lt;addr&gt;, delay=dd, xdelay=xx, mailer=mm, relay=rr (wtt), stat=%s msg</SYNOPSIS>
-</PARA>
-
-<PARA>
-Here the fields are:
-<VARIABLELIST>
-<VARLISTENTRY><TERM><OPTION>taspid</></><LISTITEM><PARA>
-The ta-spool-id &mdash; A spool-id that is valid throughout message lifetime
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>to=</></><LISTITEM><PARA>
-Destination address in whatever form the transport agent uses.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>delay=</></><LISTITEM><PARA>
-Delay from message arrival to the system to this logging moment
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>xdelay=</></><LISTITEM><PARA>
-Delay during this processing attempt &mdash; tells how much time <EMPHASIS>this</>
-time was spent to process the message.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>mailer=</></><LISTITEM><PARA>
-Tells what ``channel'' was used.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>relay=</></><LISTITEM><PARA>
-Reports on which host the message is relayed thru (``wtthost''), and for
-SMTP, also (in parenthesis) what was the relay's IP address.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>stat=</></><LISTITEM><PARA>
-What status was achieved: ok*, delayed, failed, ...
-<EMPHASIS ROLE=BOLD>CHECK!</>
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM>msg</><LISTITEM><PARA>
-Arbitrary text line from whatever system is out there.
-</PARA></LISTITEM></VARLISTENTRY>
-</VARIABLELIST>
-</PARA>
 
-</SECT2>
-</SECT1>
 </CHAPTER>
Index: zmailer/doc/manual/zadm-queues.sgml
diff -u zmailer/doc/manual/zadm-queues.sgml:1.7 zmailer/doc/manual/zadm-queues.sgml:1.8
--- zmailer/doc/manual/zadm-queues.sgml:1.7	Wed Feb 21 18:20:26 2001
+++ zmailer/doc/manual/zadm-queues.sgml	Sat Feb 24 00:11:56 2001
@@ -51,6 +51,8 @@
   </MEDIAOBJECT>
 </FIGURE>
 
+<PARA>&PGBREAK;</PARA>
+
 <PARA>
 There are multiple queues in ZMailer. Messages exist in
 in one of five locations:
@@ -78,8 +80,10 @@
     <FILENAME CLASS="DIRECTORY">$<VARNAME>POSTOFFICE</>/queue/</>)
 </PARA></LISTITEM>
 </ITEMIZEDLIST>
+</PARA>
 
-and sometimes is also copied into the 
+<PARA>
+And sometimes is also copied into the:
 <ITEMIZEDLIST>
 <LISTITEM><PARA>
 Postmaster analysis area
@@ -136,8 +140,8 @@
 FIXME:
    This description is from era before the router got
    ``daemonized'' in a sense of having separate instance
-   of queue processor (and it also handles logging/log rotation)
-   and a worker-farm of routing work processes.
+   of queue processor (and it also handles logging/log
+   rotation) and a worker-farm of routing work processes.
 </SCREEN>
 </PARA>
 
@@ -302,8 +306,15 @@
 directory!</EMPHASIS>
 </PARA>
 
+<PARA>
+Usually forementioned underscoreless filenames are double-errors,
+that is, error messages to error messages.  There is nowhere else
+to send them.
+</PARA>
+
 <PARA>
-Usually forementioned underscoreless filenames 
+The indication of <EMPHASIS>error</> message is, of course,
+<LITERAL>MAIL FROM:&lt;&gt;</> per RFC 821.
 </PARA>
 
 <PARA>
Index: zmailer/doc/manual/zadm-router.sgml
diff -u zmailer/doc/manual/zadm-router.sgml:1.9 zmailer/doc/manual/zadm-router.sgml:1.11
--- zmailer/doc/manual/zadm-router.sgml:1.9	Wed Feb 21 18:20:26 2001
+++ zmailer/doc/manual/zadm-router.sgml	Mon Feb 26 19:42:00 2001
@@ -1,7 +1,54 @@
 <CHAPTER ID="ZADM-ROUTER"><?dbhtml filename="zadm-router.html">
-<TITLE><COMMAND>Router</> Configuration</TITLE>
+<TITLE><COMMAND>Router</> Administration</TITLE>
 
 <PARA>
+The <COMMAND>router</> is the part of the ZMailer that uses algorithms,
+and control databases to determine what latter stages, like
+<COMMAND>scheduler</> should do to the message.
+</PARA>
+
+<PARA>
+The <XREF LINKEND=fig.zadmrtr.zmprocs> repeats earlier picture
+showing central components of the system, and where the <COMMAND>router</>
+is in relation to to all.
+</PARA>
+
+
+<FIGURE PGWIDE="1" FLOAT="1" ID=fig.zadmrtr.zmprocs>
+  <TITLE ID=figtit.zadmrtr.zmprocs>ZMailer's processes; Router</TITLE>
+  <MEDIAOBJECT>
+    <IMAGEOBJECT>
+      <IMAGEDATA FILEREF="zmprocs-router.&GEXT;" FORMAT="&GEXT;">
+    </IMAGEOBJECT>
+  </MEDIAOBJECT>
+</FIGURE>
+
+<PARA>
+In following our intention is to cover topics of:
+<ITEMIZEDLIST>
+<LISTITEM><PARA>What input data router uses</PARA></LISTITEM>
+<LISTITEM><PARA>What output it produces</PARA></LISTITEM>
+<LISTITEM><PARA>How the router is configured, including of
+what is 'dbases.conf'  file.</PARA></LISTITEM>
+<LISTITEM><PARA>How it can be tuned</PARA></LISTITEM>
+</ITEMIZEDLIST>
+</PARA>
+
+<PARA>
+<SCREEN>
+FIXME:
+  - Intro to what the router does to the message
+  - How the configuration scripts are loaded
+  - How the standard scripts are tunable by means of databases,
+    specifically 'dbases.conf'
+  - The ROUGHT logic of the standard scripts
+  - What to do if one wants to tune ?
+</SCREEN>
+</PARA>
+
+
+
+<PARA>
 The names (determined at compile-time) and interface specifications for the
 routing and crossbar functions, are the only crucial ``magical'' things one
 needs to contend with in a proper <COMMAND>router</> configuration.
@@ -22,6 +69,11 @@
 script at first glance.  There are minor syntax changes from standard
 <COMMAND>sh</>(1), but the aim is to be as close to the
 <EMPHASIS>Bourne Shell language</EMPHASIS> as is practical.
+In fact some aspects of variable handling are more of PERL style,
+and others are even LISPish.
+</PARA>
+
+<PARA>
 The contents of the file are compiled into bytecode, which can then
 be interpreted by the <COMMAND>router</>.
 The configuration file is usually self-contained, although an easy
@@ -70,7 +122,7 @@
 <LISTITEM><PARA>
 Functions are allowed, parameter lists are allowed. If not enough
 arguments are present in a function call to exhaust the parameter
-list, the so-far unbound parameter variables are bound to <LITERAL>''</>
+list, the so-far unbound parameter variables are bound to <LITERAL>``''</>
 (the empty string) as local variables. For example, this is the identity
 address rewriting function:
 <PROGRAMLISTING>
@@ -100,8 +152,8 @@
 Variables are dynamically scoped, local variables are the ones in a function's
 parameter list and those declared with the ``<FUNCTION>local</>'' statement.
 Only the first value of a multiple-value return may be assigned to a variable.
-All values are strings, so no type information, checking, or declaration, is
-necessary.
+All values are either strings, or lists, so no type information, checking,
+or declaration, is necessary.
 </PARA></LISTITEM>
 
 <LISTITEM><PARA>
@@ -132,12 +184,73 @@
 </PARA></LISTITEM>
 
 <LISTITEM><PARA>
-<EMPHASIS ROLE=BOLD>FIXME! FIXME!</>
-IFS, quoted strings, and evaluation results -- and how things differ
-from usual shell languages, and how they are alike with PERL!
-</PARA></LISTITEM>
+In standard shells the <ENVAR>IFS</> guides on how variable expansion
+results are to be treated.  Namely in cases where the expansion happens
+without being enclosed into double-quotes, the expansion result is at first
+split with <ENVAR>IFS</> contained characters forming the separation sequences.
+</PARA>
+
+<PARA>
+ZMailer's ``shell'' behaves alike PERL in this regard, and will not do
+<ENVAR>IFS</> interpolation on the result.   However, unlike with PERL,
+double-quoted evaluation will not have its contents re-evaluated.
+</PARA>
+
+<PARA>
+Thus it is equally safe to do assignments like:
+</PARA>
+<PROGRAMLISTING>
+<![CDATA[
+  var1='some text here'
+  var2=' more text
+  cat1="$var1$var2"
+  cat2=$var1$var2
+]]>
+</PROGRAMLISTING>
+<PARA>The notable thing at this particular example is that
+<EMPHASIS ROLE=BOLD>both</> result variables are catenates
+of the input strings.
+</PARA>
+<PARA>
+However! If either of inputs is a list of any kind, then the catenate
+is not to be done this way! See <FUNCTION>lappend</>.
+</PARA>
+</LISTITEM>
 
 <LISTITEM><PARA>
+Due to lack of implicite split by the <ENVAR>IFS</> characters,
+ZMailer ``shell'' contains function <FUNCTION>ifssplit</>.
+</PARA>
+</LISTITEM>
+
+<LISTITEM><PARA>
+The <FUNCTION>for</> construct is even more strange, and classical
+Bourne script:
+</PARA>
+<PROGRAMLISTING>
+<![CDATA[
+  countvar='1 2 3 4 5 6'
+  for x in $countvar; do ... ; done
+]]>
+</PROGRAMLISTING>
+<PARA>
+Yields only nasty surprise.
+</PARA>
+<PARA>
+Here are two alternates on how to do it:
+</PARA>
+<PROGRAMLISTING>
+<![CDATA[
+  countvar='1 2 3 4 5 6'
+  for x in $(ifssplit $countvar); do ... ; done
+
+  countvar=(1 2 3 4 5 6)
+  for x in $(elements $countvar); do ... ; done
+]]>
+</PROGRAMLISTING>
+</LISTITEM>
+
+<LISTITEM><PARA>
 Conditional substitution forms are supported:
 <PROGRAMLISTING>
 <![CDATA[
@@ -150,8 +263,11 @@
 </PARA></LISTITEM>
 
 <LISTITEM><PARA>
-Patterns (in case labels) are evaluated once,
+Patterns (in case labels) are parsed once,
 the first time they are encountered.
+</PARA>
+<PARA>
+This is like with PERL's ``m/../o'' patterns.
 </PARA></LISTITEM>
 
 <LISTITEM><PARA>
@@ -194,7 +310,7 @@
 </PARA>
 
 <PARA>
-Overall usage of these ``<FUNCTION>sifts</>'' is very much like that of
+Overall usage of these ``<FUNCTION>sift</>s'' is very much like that of
 ``<FUNCTION>case</>'', including the need for matching termination tokens:
 <PROGRAMLISTING>
 <![CDATA[
@@ -218,11 +334,15 @@
 
 <LISTITEM><PARA>
 The general form of function calls in the system is:
+</PARA>
+<PARA>
 <PROGRAMLISTING>
 <![CDATA[
   $(funcname arguments)
 ]]>
 </PROGRAMLISTING>
+</PARA>
+<PARA>
 It returns a scalar or list object, and the result can be stored
 into variables at will.
 </PARA></LISTITEM>
@@ -340,10 +460,6 @@
 <LISTITEM><PARA>
 Non-critical but recommended functions:
 <VARIABLELIST>
-<VARLISTENTRY><TERM><FUNCTION>getzenv</></><LISTITEM><PARA>
-retrieves global ZMailer configuration values
-</PARA></LISTITEM></VARLISTENTRY>
-
 <VARLISTENTRY><TERM><FUNCTION>echo</></><LISTITEM><PARA>
 emulates <COMMAND>/bin/echo</>
 </PARA></LISTITEM></VARLISTENTRY>
@@ -353,7 +469,7 @@
 </PARA></LISTITEM></VARLISTENTRY>
 
 <VARLISTENTRY><TERM><FUNCTION>hostname</></><LISTITEM><PARA>
-internal function to get and set the system name
+internal function to get and set the local idea about the system name
 </PARA></LISTITEM></VARLISTENTRY>
 
 <VARLISTENTRY><TERM><FUNCTION>trace</></><LISTITEM><PARA>
@@ -430,31 +546,6 @@
 </PARA>
 
 <PARA>
-<EMPHASIS>However careless usage of ``<USERINPUT>$var</>'' is
-<EMPHASIS ROLE="BOLD">dangerous</>, as you may trip on following:</EMPHASIS>
-<PROGRAMLISTING>
-<![CDATA[
-  SS="1 -o bar"
-  if [ $SS = 0 ]; then
-    ...
-  fi
-]]>
-</PROGRAMLISTING>
-<EMPHASIS>
-In this kind of places you must tread carefully, and use double-quotes
-to save your neck:
-</EMPHASIS>
-<PROGRAMLISTING>
-<![CDATA[
-  SS="1 -o bar"
-  if [ "$SS" = 0 ]; then
-    ...
-  fi
-]]>
-</PROGRAMLISTING>
-</PARA>
-
-<PARA>
 To test the configuration or routing data, proceed as
 shown in figure <XREF LINKEND="fig.adm.testing">.
 </PARA>
@@ -502,6 +593,16 @@
 <TITLE>Databases</TITLE>
 
 <PARA>
+<SCREEN>
+FIXME:
+ - Intro
+ - How 'dbases.conf' file works
+ - How the databases are defined in the deep down inside ('relation' function)
+ - How lookup works
+</SCREEN>
+</PARA>
+
+<PARA>
 Many of the decisions and actions taken by configuration file code depend
 on the specifics of the environment the MTA finds itself in.
 So, not just the facts that the local host is attached to (say)
@@ -588,7 +689,7 @@
  <ARG>-f <REPLACEABLE>file</></>
  <ARG>-e<REPLACEABLE>#</></>
  <ARG>-s<REPLACEABLE>#</></>
- <ARG>-bilmnpu</>
+ <ARG>-bilmnpu%</>
  <ARG>-d <REPLACEABLE>driver</></>
  <ARG CHOICE=PLAIN><REPLACEABLE>name</></>
 </CMDSYNOPSIS>
@@ -619,8 +720,8 @@
 The predefined database types are:
 
 <VARIABLELIST>
-<VARLISTENTRY><TERM><OPTION>bash</></><LISTITEM><PARA>
-the database is in BSD DB HASH format.
+<VARLISTENTRY><TERM><OPTION>bhash</></><LISTITEM><PARA>
+the database is in BSD/SleepyCat DB HASH format.
 </PARA></LISTITEM></VARLISTENTRY>
 
 <VARLISTENTRY><TERM><OPTION>bind</></><LISTITEM><PARA>
@@ -631,10 +732,6 @@
 the database is in BSD/SleepyCat DB BTREE format.
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM><OPTION>bhash</></><LISTITEM><PARA>
-the database is in BSD/SleepyCat DB HASH format.
-</PARA></LISTITEM></VARLISTENTRY>
-
 <VARLISTENTRY><TERM><OPTION>dbm</></><LISTITEM><PARA>
 the database is in DBM format.
 Note that the original dbm had no <FUNCTION>dbm_close</>() function,
@@ -773,14 +870,25 @@
 
 <PARA>
 The ``<OPTION>-d</>'' option specifies a search routine.
-Currently the only legal argument to this option is ``<OPTION>pathalias</>'',
+Most commonly used argument for this option is ``<OPTION>pathalias</>'',
 specifying a driver that searches for the key using domain name lookup rules.
 </PARA>
 
+<PARA>
+The ``<OPTION>-%</>'' option enables substitution of ``<LITERAL>%0</>'' thru
+``<LITERAL>%9</>'' patterns in the db lookup results with key, iterated
+partial key, or positional parameter to lookup of the database.
+See Reference <XREF LINKEND=zmshref.relation> for more information.
+</PARA>
+
 <FIGURE ID="fig.adm-dbfrag1" PGWIDE="0" FLOAT="1">
 <TITLE>Some examples of <FUNCTION>relation</> definitions</TITLE>
 <PROGRAMLISTING>
 <![CDATA[
+ relation -lmt  $DBTYPE -f $MAILVAR/db/aliases$DBEXT     aliases
+ relation -lm%t $DBTYPE -f $MAILVAR/db/fqdnaliases$DBEXT fqdnaliases
+ relation -lm%t $DBTYPE -f $MAILVAR/db/routes$DBEXT -d pathalias  routes
+
  if [ -f /etc/resolv.conf ]; then
    relation -nt bind/cname -s 100 canon # T_CNAME canonicalize hostname
    relation -nt bind/uname uname        # T_UNAME UUCP name
@@ -880,9 +988,14 @@
 </PARA>
 
 <SECT2 ID=zadm-rdr-databases-using>
-<TITLE>Using a Pathalias Database</TITLE>
+<TITLE>Using a Pathalias Database With ``%0'' substitution </TITLE>
 
 <PARA>
+<EMPHASIS>The <APPLICATION>pathalias</> is an UUCP era thing, and not quite
+what one would need these days, but just in case&hellip;</EMPHASIS>
+</PARA>
+
+<PARA>
 Accessing route databases is a rather essential capability for a mailer.
 At the University of Toronto, all hosts access a centrally stored database
 through a slightly modified nameserver program.
@@ -891,16 +1004,54 @@
 the <APPLICATION>pathalias</> program.
 </PARA>
 
+<PARA>
+The current ZMailer can do two separate things, which were combined
+into the old pathalias idea:
+</PARA>
+<ITEMIZEDLIST>
+<LISTITEM><PARA>
+<FUNCTION>relation</> defines <EMPHASIS>driver</> routine
+with ``<OPTION>-d pathalias</>''
+</PARA></LISTITEM>
+<LISTITEM><PARA>
+<FUNCTION>relation</> defines that lookup result contained
+``<LITERAL>%0</>'' thru ``<LITERAL>%9</>'' strings may be
+substituted (the ``<OPTION>-%</>'' option).
+</PARA></LISTITEM>
+</ITEMIZEDLIST>
+
 <PARA>
-<APPLICATION>pathalias</> generates key-value pairs of the form:
+The <APPLICATION>pathalias</> generates key-value pairs of the form:
+</PARA>
+
+<PARA>
 <PROGRAMLISTING>
 <![CDATA[
   uunet    ai.toronto.edu!uunet!%s
   .css.gov ai.toronto.edu!uunet!seismo!%s
 ]]>
 </PROGRAMLISTING>
+</PARA>
+
+<PARA>
+which need to be post-processed to:
+</PARA>
+
+<PARA>
+<PROGRAMLISTING>
+<![CDATA[
+  uunet    ai.toronto.edu!uunet!%0
+  .css.gov ai.toronto.edu!uunet!seismo!%0
+]]>
+</PROGRAMLISTING>
+</PARA>
+
+<PARA>
 which when queried about ``uunet'' and ``beno.css.gov''
 correspond to the routes:
+</PARA>
+
+<PARA>
 <PROGRAMLISTING>
 <![CDATA[
   ai.toronto.edu!uunet
@@ -920,7 +1071,7 @@
 </PARA>
 
 <FIGURE ID="fig.adm-pathalias-driver" PGWIDE="0" FLOAT="1">
-<TITLE>An example of lookup driver for <COMMAND>pathalias</>
+<TITLE>An example of lookup driver for genuine <COMMAND>pathalias</>
 generated database</TITLE>
 <PROGRAMLISTING>
 <![CDATA[
@@ -979,7 +1130,7 @@
 An alternate mechanism is to implement lists in the traditional
 <APPLICATION>sendmail</> manner, however it means feeding the message
 to the <COMMAND>scheduler</>, and external program
-(<COMMAND>>/usr/lib/sendmail</>) before it comes back to
+(<COMMAND>/usr/lib/sendmail</>) before it comes back to
 the <COMMAND>router</>.
 </PARA>
 
@@ -1245,73 +1396,6 @@
 
 </SECT3>
 
-<SECT3 ID=zadm-rtr-memory-consumption>
-<TITLE>About Large Lists, and Memory Consumption</TITLE>
-
-<PARA> FIXME! FIXME! -- VERIFY! UPDATE!
-(router internal memory management has improved dramatically at
-2.99.51, and no serious bloat effect appears anymore.)
-</PARA>
-
-<PARA>
-With old configuration scripts there used to be problems with list
-expansion causing serious memory bloat (of $O(n^{2})$ kind of memory
-consumption&hellip;)
-{\em ZMailer-2.98} did introduce a working solution via the builtin
-{\tt\$(listexpand ..)} function.
-</PARA>
-
-<PARA>
-The rest of these notes apply to older config files using old style pipe of:
-<PROGRAMLISTING>
-<![CDATA[
-  $(listaddresses &lt; file | maprrouter ...)
-]]>
-</PROGRAMLISTING>
-where the maprrouter caused the actual memory bloat...
-</PARA>
-
-<PARA>
-The primary reason behind this is that the router does necessary copies
-of objects &mdash; it uses memory in a form of heap storage which is
-allocated progressively and managed via ``<FUNCTION>mark</>()'', and
-``<FUNCTION>release</>()'' type calls.
-The ``<FUNCTION>release</>()'' calls are done when exiting
-``<COMMAND>zmsh</>'' interpreter, and never during script running
-(however calling builtin C functions which call scripts is another
-story &mdash; there are ``<FUNCTION>release</>()'' checkpoints
-available then.)
-</PARA>
-
-<PARA>
-Especially bad thing for memory use to do is to use ``<FUNCTION>setf</>''
-function.
-</PARA>
-
-<PARA>
-Internal list expansion (through the
- <FILENAME>$<VARNAME>MAILVAR</>/lists/LISTNAME</> 
-mechanism) is a sure way to expand <COMMAND>router</> process memory usage.
-</PARA>
-
-<PARA>
-You can decrease the memory requirement dramatically, if you can feed all
-the addresses in the envelope, or via <FILENAME>utils/listexpand.c</>
-utility (alpha-test tool on 1-Sep-94).
-You don't need to worry about it unless your list is 100+ recipients,
-only then the memory usage starts to bloat seriously with the old-style
-in-core <FUNCTION>$(listaddress ...)</> expander.
-</PARA>
-
-<PARA>
-Although more interesting and useful models exist, the mail forwarding
-functionality of ZMailer has been designed to generally emulate the
-interface and behaviour of <COMMAND>sendmail</>(8).
-The mechanisms that accomplish this are likely to be generalized in
-a future version.
-</PARA>
-
-</SECT3>
 
 <SECT3 ID=zadm-rtr-security-considerations>
 <TITLE>Security Considerations</TITLE>
Index: zmailer/doc/manual/zadm-scheduler.sgml
diff -u zmailer/doc/manual/zadm-scheduler.sgml:1.6 zmailer/doc/manual/zadm-scheduler.sgml:1.10
--- zmailer/doc/manual/zadm-scheduler.sgml:1.6	Wed Feb 21 18:20:26 2001
+++ zmailer/doc/manual/zadm-scheduler.sgml	Tue Apr  3 14:30:03 2001
@@ -1,5 +1,5 @@
 <CHAPTER ID="ZADM-SCHEDULER"><?dbhtml filename="zadm-scheduler.html">
-<TITLE><COMMAND>Scheduler</> Configuration</TITLE>
+<TITLE><COMMAND>Scheduler</> Administration</TITLE>
 
 <PARA>
 The <COMMAND>scheduler</> is the part of the ZMailer that manages
@@ -7,15 +7,248 @@
 </PARA>
 
 <PARA>
+The <XREF LINKEND=fig.zadmsch.zmprocs> repeats earlier picture
+showing central components of the system, and where the <COMMAND>scheduler</>
+is in relation to them all.
+</PARA>
+
+
+<FIGURE PGWIDE="1" FLOAT="1" ID=fig.zadmsch.zmprocs>
+  <TITLE ID=figtit.zadmsch.zmprocs>ZMailer's processes; Scheduler</TITLE>
+  <MEDIAOBJECT>
+    <IMAGEOBJECT>
+      <IMAGEDATA FILEREF="zmprocs-scheduler.&GEXT;" FORMAT="&GEXT;">
+    </IMAGEOBJECT>
+  </MEDIAOBJECT>
+</FIGURE>
+
+
+<PARA>
+<SCREEN>
+TODO!FIXME!
+
+  Here we present longer examples out of the  scheduler.conf, and
+  reasons why the default script is as it is
+
+  - Intro
+  - Principles of scheduling, "threads"
+  - Clause selectors
+    - "local/*"
+    - "smtp/*.xyz"
+    - "smtp/*"
+    - "OTHER/*"
+    - How to roll your own when needed
+  - Something about the resource control ?
+  - scheduler.auth file, and its purpose
+  - MAILQv1/v2 interface, mailq-command
+    - but the protocols are REFERENCE material
+  - (manual-)expirer
+  - Diagnostics reporting, forms files
+
+  Appendix B contains full samples of scheduler.conf, and scheduler.auth
+</SCREEN>
+</PARA>
+
+<PARA>
 The major action of the <COMMAND>scheduler</> is to periodically
 start up <EMPHASIS>Transport Agents</> and tell them what to do.
 This is controlled by a table in a configuration file that is read by the
 <COMMAND>scheduler</> when it starts.  
 </PARA>
 
+<PARA>
+The <COMMAND>scheduler</> receives the messages from the <COMMAND>router</>
+in <EMPHASIS>two</> files: Original message file in
+<FILENAME CLASS=DIRECTORY>$<VARNAME>POSTOFFICE</>/queue/</>, and
+<COMMAND>router</> written transport-specifications in 
+<FILENAME CLASS=DIRECTORY>$<VARNAME>POSTOFFICE</>/transport/</>.
+</PARA>
+
+<PARA>
+Because usually (UNIX) systems don't like of having very large amounts of
+files in directories, as lookups for them become intolerably slow, the
+<COMMAND>scheduler</> has a subdirectory hashing mechanism.  Both
+<FILENAME CLASS=DIRECTORY>queue/</> and <FILENAME CLASS=DIRECTORY>transport/</>
+<EMPHASIS ROLE=BOLD>can</> be split to subdirectories at one or two levels
+with names of ``<LITERAL>A</>'' thru ``<LITERAL>Z</>''.
+See for the ``<OPTION>-H</>'' option of the <COMMAND>scheduler</> below.
+</PARA>
+
+<PARA>
+The idea with the sub-directory hashes is to split the workset into as even
+subsets as possible, usually busy systems are run with ``<OPTION>-HH</>'' to
+have 26*26 sub-sub-directories into which the sets gets divided.
+</PARA>
+
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<SECT1 ID=zadm-scheduler-threads>
+<TITLE>Principiles of scheduling: Threads</TITLE>
+
+<PARA>
+The <COMMAND>router</> produces recipients ``address quads'' which
+consists of four components:
+<ITEMIZEDLIST>
+<LISTITEM><PARA>Channel</PARA></LISTITEM>
+<LISTITEM><PARA>Host</PARA></LISTITEM>
+<LISTITEM><PARA>User</PARA></LISTITEM>
+<LISTITEM><PARA>Privilege</PARA></LISTITEM>
+</ITEMIZEDLIST>
+</PARA>
+
+<PARA>
+Of these, <EMPHASIS>Channel</>, and <EMPHASIS>Host</> parts are used
+by the <COMMAND>scheduler</> to classify message recipients and to
+choose to what <EMPHASIS>Transport Agents</> to use, and how to use them.
+</PARA>
+
+<PARA>
+To control how messages are sent out, the <COMMAND>scheduler</> uses
+catenation of: <EMPHASIS>Channel/Host</> to group recipients.
+All recipients with <EMPHASIS>same</> values there are groupped
+together in what is called <EMPHASIS>thread</>.
+</PARA>
+
+<PARA>
+Another related thing is so called <EMPHASIS>thread group</>, which
+is the collection of all threads within same <EMPHASIS>scheduler</>
+<EMPHASIS>Selector Clause</>.
+See <XREF LINKEND=zadm-scheduler-scheduler.conf>.
+</PARA>
+
+<FIGURE PGWIDE="1" FLOAT="1" ID=fig.zadmsch.threads>
+  <TITLE ID=figtit.zadmsch.threads>Scheduler's Threads/Thread Groups</TITLE>
+  <MEDIAOBJECT>
+    <IMAGEOBJECT>
+      <IMAGEDATA FILEREF="zadm-sch-threads.&GEXT;" FORMAT="&GEXT;">
+    </IMAGEOBJECT>
+  </MEDIAOBJECT>
+</FIGURE>
+
+<PARA>
+In normal case the scheduling is done by running <EMPHASIS>single</>
+transport agent for the <EMPHASIS>thread</>, which delivers messages
+one at the time.
+This means that a single destination with thousands of messages does
+not block the system significantly more than some other destination
+with a single message.
+</PARA>
+
+<PARA>
+Also in normal cases, when messages in given thread are all delivered,
+or otherwise determined that nothing can be done, the transport agent
+can be switched to another thread within the same <EMPHASIS>thread group</>.
+</PARA>
+
+</SECT1>
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<SECT1 ID=zadm-scheduler-resource-control>
+<TITLE><COMMAND>Scheduler</> Resource Control</TITLE>
+
+<PARA>FIXME! TO BE WRITTEN!</PARA>
+
+<PARA>
+Note, there are three kinds of resource-pool limitation parameters
+which control when a given channel+host pair (thread) is NOT taken
+into processing:
+
+<VARIABLELIST>
+<VARLISTENTRY><TERM><LITERAL>MaxTA</>:   (Set in "*/*" clause)</TERM>
+<LISTITEM>
+<PARA>
+ GLOBAL parameter limiting the number of transport-agent processes
+ that the scheduler can have running at the same time.
+</PARA>
+
 <PARA>
-Any line starting with a ``#'' character is assumed to be a comment 
-line, and is ignored, as are empty lines.
+ With this you can limit the number of TA processes running at the
+ same time lower than maximum allowed by your OS setup.
+</PARA>
+
+<PARA>
+ The scheduler detects the max number of FDs allowed for a process,
+ and analyzing how many FDs each TA interface will need -- plus
+ reserving 10 FDs for the itself, result is ``probed maxkids''.
+</PARA>
+</LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><LITERAL>MaxChannel</>: (default: ``probed maxkids'')</>
+<LISTITEM>
+<PARA>
+ Selector clause specific value limiting how many transport-agent
+ processes can be running on which the ``channel'' part is the same.
+ You may specify dis-similar values for these as well.  For example
+ you may use value '50' for all your 'smtp' channel entries, except
+ that you want always to guarantee at least five more for your own
+ domain deliveries, and thus have:
+</PARA>
+
+<SCREEN>
+      smtp/*your.domain
+            maxchannel=55
+</SCREEN>
+
+<PARA>
+ If the sum of all ``maxchannel'' values in different channels exceeds
+ that of ``maxta'', then ``maxta'' value will limit the amount of work
+ done in extreme load situations.
+</PARA>
+</LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><LITERAL>MaxRing</>: (default: ``probed maxkids'')</>
+<LISTITEM>
+<PARA>
+ This limits the number of parallel transport agents within each
+ selector definition.
+ This defined the size of the POOL of transport agent processes
+ available for processing the threads matching the selector clause.
+</PARA>
+</LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><LITERAL>MaxTHR</>: (default: 1)</>
+<LISTITEM>
+<PARA>
+ This limits the number of parallel transport agents within each
+ thread; that is, using higher value than default ``1'' will allow
+ running more than one TA for the jobs at the thread.
+</PARA>
+
+<PARA>
+ Do note that running more than one TA in parallel may also require
+ lowering OVERFEED value.  (E.g. having a queue of 30 messages will
+ not benefit from more TAs, unless they all get something to process.
+ Having OVERFEED per default at 150 will essentially feed whole queue
+ to one TA, others are not getting any.)
+</PARA>
+</LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><LITERAL>OverFeed</>:</>
+<LISTITEM>
+<PARA>
+ This tells how many job specifiers to feed to the TA when
+ the TA process state is ``STUFFING''  Because the scheduler
+ is a bit sluggish to spin around to spot active TAs, it does
+ make sense to feed more than one task to a TA, and then wait
+ for the results.
+</PARA></LISTITEM></VARLISTENTRY>
+</VARIABLELIST>
+
+</PARA>
+
+</SECT1>
+
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<SECT1 ID=zadm-scheduler-scheduler.conf>
+<TITLE>The <FILENAME>scheduler.conf</> file</TITLE>
+
+<PARA>
+Any line starting with a ``<LITERAL>#</>'' character is assumed to be
+a comment line, and is ignored, as are empty lines.
 All other lines must follow a rigid format. 
 </PARA>
 
@@ -90,22 +323,19 @@
 </PARA></LISTITEM>
 
 <LISTITEM><PARA>
- a  clause  matching  the  local delivery channel
-(usually local).
+a clause matching the local delivery channel (usually local).
 </PARA></LISTITEM>
 
 <LISTITEM><PARA>
- a clause matching the deferred    delivery  channel
-(usually hold).
+a clause matching the deferred delivery channel (usually hold).
 </PARA></LISTITEM>
 
 <LISTITEM><PARA>
- a  clause  matching  the error reporting channel
-(usually error).
+a clause matching the error reporting channel (usually error).
 </PARA></LISTITEM>
 
 <LISTITEM><PARA>
-clauses specific to the other channels  known  by
+clauses specific to the other channels known by
 the <COMMAND>router</>, for example: smtp and uucp.
 </PARA></LISTITEM>
 </ITEMIZEDLIST>
@@ -343,5 +573,56 @@
 The actual host is picked at random from the current choices, to avoid
 systematic errors leading to a deadlock of any queue.
 </PARA>
+
+</SECT1>
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<SECT1 ID=zadm-scheduler-mailq-interface>
+<TITLE><COMMAND>Scheduler</>'s <COMMAND>Mailq</></TITLE>
+
+<PARA>FIXME! TO BE WRITTEN!</PARA>
+
+</SECT1>
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<SECT1 ID=zadm-scheduler-scheduler.auth>
+<TITLE><COMMAND>Scheduler</>'s <FILENAME>scheduler.auth</> control file</TITLE>
+
+<PARA>FIXME! TO BE WRITTEN!</PARA>
+
+</SECT1>
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<SECT1 ID=zadm-scheduler-manual-expirer>
+<TITLE><COMMAND>manual-expirer</></TITLE>
+
+<PARA>FIXME! TO BE WRITTEN!</PARA>
+
+</SECT1>
+
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<SECT1 ID=zadm-scheduler-diagnostics>
+<TITLE><COMMAND>Scheduler</>'s Diagnostics Reporting</TITLE>
+
+<PARA>FIXME! TO BE WRITTEN!</PARA>
+
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<SECT2 ID=zadm-scheduler-forms-files>
+<TITLE><COMMAND>Scheduler</>'s Diagnostics Reporting, Forms Files</TITLE>
+
+<PARA>FIXME! TO BE WRITTEN!</PARA>
+
+</SECT2>
+
+</SECT1>
+
+
 
 </CHAPTER>
Index: zmailer/doc/manual/zadm-security.sgml
diff -u zmailer/doc/manual/zadm-security.sgml:1.6 zmailer/doc/manual/zadm-security.sgml:1.7
--- zmailer/doc/manual/zadm-security.sgml:1.6	Wed Feb 21 18:20:26 2001
+++ zmailer/doc/manual/zadm-security.sgml	Sat Feb 24 00:11:56 2001
@@ -2,6 +2,29 @@
 <TITLE>Security Issues</TITLE>
 
 <PARA>
+The intention of the security mechanisms is not to prevent address faking,
+but to control the privileges which are used to execute pipes, and
+accessing files (read, and write).
+</PARA>
+
+<PARA>
+In addition of doing strict privilege control on who can do what,
+ZMailer has a concept of <EMPHASIS>trust</>, which shows as a group
+of accounts who can claim wildly ``fradulent'' data in their headers.
+</PARA>
+
+<PARA>
+The <EMPHASIS>trusted</> accounts are those listed in the ZMailer group
+or the ``trusted'' variable in the system configuration
+(<FILENAME>router.cf</>) file.
+</PARA>
+
+<PARA>
+Of course when one uses SMTP protocol to inject email, it is extremely
+easy to ``fake'' any source and destination envelope and visible addresses.
+</PARA>
+
+<PARA>
 Having local-parts that allow delivery to arbitrary files, or which can
 trigger execution of arbitrary programs, can clearly lead to a huge security
 problem.
@@ -87,22 +110,6 @@
 If a discrepancy is discovered, appropriate action will be taken.
 This means that there is no way to forge the internal origin of
 a message without access to a trusted account.
-</PARA>
-
-<PARA>
-Trusted accounts are those listed in the ZMailer group or the ``trusted'' 
-variable in the system configuration (<FILENAME>router.cf</>) file.
-</PARA>
-
-<PARA>
-Of course when one uses SMTP protocol to inject email, it is extremely
-easy to ``fake'' any source and destination envelope and visible addresses.
-</PARA>
-
-<PARA>
-The intention of the security mechanisms is not to prevent address faking,
-but to control the privileges which are used to execute pipes, and
-accessing files (read, and write).
 </PARA>
 
 </CHAPTER>
Index: zmailer/doc/manual/zadm-sm.sgml
diff -u zmailer/doc/manual/zadm-sm.sgml:1.5 zmailer/doc/manual/zadm-sm.sgml:removed
--- zmailer/doc/manual/zadm-sm.sgml:1.5	Wed Feb 14 20:51:42 2001
+++ zmailer/doc/manual/zadm-sm.sgml	Tue May  8 16:00:09 2001
@@ -1,194 +0,0 @@
-<CHAPTER ID="ZADM-SM"><?dbhtml filename="zadm-sm.html">
-<TITLE><COMMAND>Sm</> Configuration</TITLE>
-
-<PARA>
-<COMMAND>sm</> is a ZMailer's <COMMAND>sendmail</>(8) compatible
-<EMPHASIS>transport agent</> to deliver messages by invoking a program
-with facilities and in a way compatible with a <COMMAND>sendmail</>(8)
-MTA.
-</PARA>
-
-<PARA>
-The program scans the message control files named on stdin for addresses
-destined for the channel and/or the host given on the command line.
-If any are found, all matching addresses and messages are processed
-according to the specifications for the mailer in the configuration file.
-</PARA>
-
-<PARA>
-The exit status of a mailer should be one of the standard values specified in
- <EMPHASIS>#include &lt;<FILENAME CLASS="HEADERFILE">sysexits.h</>&gt;</>.
-Of these, <ERRORCODE>EX_OK</> indicates successful deliver, and
- <ERRORCODE>EX_DATAERR</>, <ERRORCODE>EX_NOUSER</>, <ERRORCODE>EX_NOHOST</>,
- <ERRORCODE>EX_UNAVAILABLE</>, and <ERRORCODE>EX_NOPERM</> indicate
-permanent failure.
-All other exit codes will be treated as a temporary failure and the delivery
-will be retried.
-</PARA>
-
-<PARA>
-Usage:
-
-<CMDSYNOPSIS>
-<COMMAND>sm</COMMAND>
-  <ARG>-8</ARG>
-  <ARG>-H</ARG>
-  <ARG>-Q</ARG>
-  <ARG>-V</ARG>
-  <ARG>-f <REPLACEABLE>configfile</></ARG>
-  <ARG CHOICE=PLAIN>-c <REPLACEABLE>channel</></ARG>
-  <ARG CHOICE=PLAIN>-h <REPLACEABLE>host</></ARG>
-  <ARG CHOICE=PLAIN><REPLACEABLE>mailer</></ARG>
-</CMDSYNOPSIS>
-</PARA>
-
-<PARA>
-Configuration:
-</PARA>
-
-<PARA>
-The configuration file <FILENAME>$<VARNAME>MAILSHARE</>/sm.conf</>
-associates the mailer keyword from the command line with a specification
-of a delivery program.
-This is very similar to the way the definition of a ``mailer'' in
-<COMMAND>sendmail</>(8).
-It requires flags, a program name, and a command line specification.
-These are in fact the fields of the entries of the configuration file.
-Lines starting with whitespace or a ``<EMPHASIS ROLE="STRONG">#</>''
-are ignored, and all others are assumed to follow format shown in figure
-<XREF LINKEND="fig.adm.sample-sm-conf">.
-</PARA>
-
-<FIGURE ID="fig.adm.sample-sm-conf" PGWIDE="1" FLOAT="1">
-<TITLE>Sample <FILENAME>sm.conf</> file</TITLE>
-<SCREEN>
-#mailer flags program        argument list
-#------ ----- -------------- --------------------------------
-local   mS    sm/localm      localm -r $g $u
-prog    -     /bin/sh        sh -c $u
-tty     rs    /usr/local/to  to $u
-uucp    U     /usr/bin/uux   uux - -r -a$g -gC $h!rmail ($u)
-usenet  m     sm/usenet      usenet $u
-test    n     sm/test        test $u
-</SCREEN>
-</FIGURE>
-
-<PARA>
-The mailer field extends from the beginning of the line to the first
-whitespace.
-It is used simply as a key index to the configuration file contents.
-One or more whitespace is used as the field separator for all the fields.
-</PARA>
-
-<PARA>
-The flags field contains a concatenation of one-letter flags.
-If no flags are desired, a ``<EMPHASIS ROLE="STRONG">-</>''
-character should be used to indicate presence of the field.
-All normal <APPLICATION>sendmail</> (<EMPHASIS>of 5.x era..</>)
-flags are recognized, but the ones that do not make sense in
-the context of ZMailer will produce an error (or some are ignored).
-The flags that change the behaviour of <COMMAND>sm</> are:
-
-<VARIABLELIST>
-<VARLISTENTRY><TERM><OPTION>b</OPTION></TERM><LISTITEM><PARA>
-will activate BSMTP-type wrapping with a ``hidden-dot''
-algorithm; e.g. quite ordinary SMTP stream, but in ``batch mode''.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>B</OPTION></TERM><LISTITEM><PARA>
-The  first ``<OPTION>B</>''  turns on similar BSMTP wrapping
-as ``<OPTION>b</>'', but adds
-SIZE and, if the <COMMAND>sm</> is  started  with option ``<OPTION>-8</>'',
-also 8BITMIME options.  The second ``<OPTION>B</>'' adds there also DSN
-(Delivery Status  Notification) parameters.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>E</OPTION></TERM><LISTITEM><PARA>
-will prepend ``<OPTION>&gt;</>'' to any message body line starting
-with ``<EMPHASIS ROLE="STRONG">From </>''. (Read: ``From-space'')
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>f</OPTION></TERM><LISTITEM><PARA>
-adds ``<OPTION>-f sender</>'' arguments to the delivery program.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>n</OPTION></TERM><LISTITEM><PARA>
-will not prepend a ``<EMPHASIS ROLE="STRONG">From </>''-line
-(normal mailbox separator line) to the message.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>r</OPTION></TERM><LISTITEM><PARA>
-adds ``<OPTION>-r sender</>'' arguments to the delivery program.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>S</OPTION></TERM><LISTITEM><PARA>
-will run the delivery program with the same real and effective uid as
-the <COMMAND>sm</> process.
-If this flag is not set, the delivery program will be run with the real
-uid of the <COMMAND>sm</> process.
-This may be useful if <COMMAND>sm</> is setuid.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>m</OPTION></TERM><LISTITEM><PARA>
-informs <COMMAND>sm</> that each instance of the delivery program
-can deliver to many destinations.
-This affects <OPTION>$u</>  expansion  in the argument list, see below.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>P</OPTION></TERM><LISTITEM><PARA>
-prepends a ``Return-Path:'' header to the message.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>U</OPTION></TERM><LISTITEM><PARA>
-will prepend a ``<EMPHASIS ROLE="STRONG">From </>''-line, with
-a ``remote from myuucpname'' at the end, to the message.
-This is what is expected by remote  <COMMAND>rmail</>(1)
-programs for incoming UUCP mail.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>R</OPTION></TERM><LISTITEM><PARA>
-use CRLF sequence as end-of-line sequence. Without
-it, will use LF-only end-of-line sequence.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>X</OPTION></TERM><LISTITEM><PARA>
-does SMTP-like ``hidden-dot'' algorithm  of doubling
-all dots that are at the start of the line.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>7</OPTION></TERM><LISTITEM><PARA>
-will strip (set to 0) the 8th bit of every character in the message.
-</PARA></LISTITEM></VARLISTENTRY>
-</VARIABLELIST>
-</PARA>
-
-<PARA>
-The path field specifies the location of the delivery program.
-Relative pathnames are allowed and are relative to the
-<FILENAME CLASS="DIRECTORY">$<VARNAME>MAILBIN</>/</> directory.
-</PARA>
-
-<PARA>
-The arguments field extends to the end of the line.
-It contains whitespace separated <OPTION>argv</> parameters which may
-contain one of the following sequences:
-
-<VARIABLELIST>
-<VARLISTENTRY><TERM><OPTION>$g</OPTION></TERM><LISTITEM><PARA>
-which is replaced by the sender address.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>$h</OPTION></TERM><LISTITEM><PARA>
-which is replaced by the destination host.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM><OPTION>$u</OPTION></TERM><LISTITEM><PARA>
-which is replaced by the recipient address.
-If the ``<OPTION>m</>'' mailer flag is set and there are several
-recipients for this message, the argument containing the ``<OPTION>$u</>''
-will be replicated as necessary for each recipient.
-</PARA></LISTITEM></VARLISTENTRY>
-</VARIABLELIST>
-</PARA>
-
-</CHAPTER>
Index: zmailer/doc/manual/zadm-smtpserver.sgml
diff -u zmailer/doc/manual/zadm-smtpserver.sgml:1.8 zmailer/doc/manual/zadm-smtpserver.sgml:1.11
--- zmailer/doc/manual/zadm-smtpserver.sgml:1.8	Wed Feb 21 18:20:26 2001
+++ zmailer/doc/manual/zadm-smtpserver.sgml	Thu Mar  8 00:31:29 2001
@@ -1,26 +1,58 @@
-<CHAPTER ID="ZADM-SMTPSERVER-CONFIG"><?dbhtml filename="zadm-smtpserver.html">
-<TITLE><COMMAND>Smtpserver</> Configuration</TITLE>
+<CHAPTER ID="ZADM-SMTPSERVER"><?dbhtml filename="zadm-smtpserver.html">
+<TITLE><COMMAND>Smtpserver</> Administration</TITLE>
 
+<PARA><SCREEN>
+Things to place here 
+ - administrative stuff
+ - runtime command-line parameters (most important of them)
+ - smtpserver.conf
+   - PARAM entries (most common/important ones)
+   - SMTP policy-control
+   - content-policy interface
+</SCREEN></PARA>
+
 <PARA>
 The <COMMAND>smtpserver</> is ZMailer's component to receive incoming
 email via SMTP protocol.  Be it thru TCP channel, or thru Batch-SMTP.
 </PARA>
 
 <PARA>
+The <XREF LINKEND=fig.zadmsmtps.zmprocs> repeats earlier picture
+showing central components of the system, and where the <COMMAND>smtpserver</>
+is in relation to them all.
+</PARA>
+
+
+<FIGURE PGWIDE="1" FLOAT="1" ID=fig.zadmsmtps.zmprocs>
+  <TITLE ID=figtit.zadmsmtps.zmprocs>ZMailer's processes; Smtpserver</TITLE>
+  <MEDIAOBJECT>
+    <IMAGEOBJECT>
+      <IMAGEDATA FILEREF="zmprocs-smtps.&GEXT;" FORMAT="&GEXT;">
+    </IMAGEOBJECT>
+  </MEDIAOBJECT>
+</FIGURE>
+
+
+
+<PARA>
 The <COMMAND>smtpserver</> program actually has several operational modes.
+<ITEMIZEDLIST>
+<LISTITEM><PARA>
 It can operate as a stand-alone internet service socket listener, which
 forks off childs that do the actual SMTP-protocol service.
-</PARA>
+</PARA></LISTITEM>
 
-<PARA>
+<LISTITEM><PARA>
 It can be started from under the control of the <COMMAND>inetd</>(8) server,
 and it can there fulfill most of the the same roles as it does in
 the stand-alone mode.
-</PARA>
+</PARA></LISTITEM>
 
-<PARA>
+<LISTITEM><PARA>
 It can even be used to accept Batch-SMTP from incoming files (UUCP,
 and BITNET uses, for example).
+</PARA></LISTITEM>
+</ITEMIZEDLIST>
 </PARA>
 
 <PARA>
@@ -155,13 +187,25 @@
 
 <FIGURE ID="fig.sample-smtpserver-cfg" PGWIDE="0" FLOAT="1">
 <TITLE>Sample <FILENAME>smtpserver.conf</> file</TITLE>
-<SCREEN>
+<PROGRAMLISTING>
+<![CDATA[
 #PARAM maxsize          10000000    # Same as -M -option
 #PARAM max-error-recipients    3    # More than this is propably SPAM!
 #PARAM MaxSameIpSource        10    # Max simultaneous connections from
 #                                   # any IP source address
 #PARAM ListenQueueSize        10    # listen(2) parameter
 #
+# Enables of some commands:
+#PARAM  DEBUGcmd
+#PARAM  EXPNcmd
+#PARAM  VRFYcmd
+#PARAM  enable-router # This is a security decission for you.
+#                   # This is needed for EXPN/VRFY and interactive
+#                   # processing of MAIL FROM and RCPT TO addresses.
+#                   # However it also may allow external user entrance
+#                   # to ZMailer router shell environment with suitably
+#                   # pervert input, if quotation rules are broken in
+#                   # the scripts.
 PARAM help -------------------------------------------------------------
 PARAM help  This mail-server is at Yoyodyne Propulsion Inc.
 PARAM help  Our telephone number is: +1-234-567-8900, and
@@ -171,7 +215,21 @@
 # The policy database:  (NOTE: See  'makedb'  for its default suffixes!)
 PARAM  policydb  $DBTYPE  $MAILVAR/db/smtp-policy
 
+# External program for received message content analysis:
+#PARAM  contentfilter   $MAILBIN/smtp-contentfilter
+....
+#
+# TLSv1/SSLv[23] parameters; all must be used for the system to work!
+#
+# See  doc/guides/openssl,  or:
+# http://www.aet.tu-cottbus.de/personen/jaenicke/pfixtls/doc/setup.html
 #
+#PARAM  use-tls
+#PARAM  tls-CAfile      $MAILVAR/db/smtpserver-CAcert.pem
+#PARAM  tls-cert-file   $MAILVAR/db/smtpserver-cert.pem
+#PARAM  tls-key-file    $MAILVAR/db/smtpserver-key.pe
+....
+#
 # HELO/EHLO-pattern     style-flags
 #               [max loadavg]
 #
@@ -189,7 +247,8 @@
 # on that detail, remove the "R" from "veR" string below:
 
 *                   999 veR
-</SCREEN>
+]]>
+</PROGRAMLISTING>
 </FIGURE>
 
 <SECT2 ID=zadm-smtpserver-conf-param-keywords>
@@ -252,7 +311,36 @@
 "attack" by the failing network routing.
 </PARA></LISTITEM></VARLISTENTRY>
 
+
 <VARLISTENTRY>
+<TERM><OPTION>DEBUGcmd</></TERM>
+<LISTITEM><PARA>
+FIXME! WRITEME!
+#PARAM  DEBUGcmd
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY>
+<TERM><OPTION>EXPNcmd</></TERM>
+<LISTITEM><PARA>
+FIXME! WRITEME!
+#PARAM  EXPNcmd
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY>
+<TERM><OPTION>VRFYcmd</></TERM>
+<LISTITEM><PARA>
+FIXME! WRITEME!
+#PARAM  VRFYcmd
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY>
+<TERM><OPTION>enable-router</></TERM>
+<LISTITEM><PARA>
+FIXME! WRITEME!
+#PARAM  enable-router # This is a security decission for you.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY>
 <TERM><OPTION>help</> <REPLACEABLE>'string'</></TERM>
 <LISTITEM><PARA>
 This one adds yet another string (no quotes are used) into those
@@ -270,9 +358,24 @@
 database appends ".pag" and ".dir", while BSD-Btree appends only
 ".db".  (And the latter has only one file, while the first has two.)
 </PARA><PARA>
-For an operative overview, see <XREF LINKEND=zadm-smtpserver-policy-filtering>,
-and for deeper details, see <XREF LINKEND=zref-smtpserver-policy-filtering>.
+For an operative overview, see <XREF LINKEND=zadm-smtpserver-policy-relaying>,
+and for deeper details, see <XREF LINKEND=zref-smtpserver-policy-relaying>.
 </PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY>
+<TERM><OPTION>contentfilter</> <REPLACEABLE>programpath</></TERM>
+<LISTITEM><PARA>
+The <EMPHASIS>contentfilter</> studies the received message at the end
+of the DATA or BDAT transaction, and produces syncronous report about
+should be message be accepted or not.  Unlike the <OPTION>PolicyDB</>,
+this does not (should not) care about validity of envelope source and
+recipient address validities, although perhaps it should consider at
+least the recipients in some cases -- e.g. accept about anything when
+the destination is <LITERAL>&lt;postmaster&gt;</>.
+</PARA><PARA>
+For an operative overview, see <XREF LINKEND=zadm-smtpserver-content-filter>,
+and for deeper details, see <XREF LINKEND=zref-smtpserver-content-filter>.
+</PARA></LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
 </PARA>
 
@@ -341,10 +444,10 @@
 </SECT1>
 
 
-<SECT1 ID="zadm-smtpserver-policy-filtering">
-<TITLE>Policy Based Filtering</TITLE>
-<INDEXTERM ID=zadm-smtps-policy-filtering1><PRIMARY><FILENAME>smtpserver.conf</></><SECONDARY>input policy filters</></>
-<INDEXTERM ID=zadm-smtps-policy-filtering2><PRIMARY>SMTP input</><SECONDARY>policy filtering, admin</></>
+<SECT1 ID="zadm-smtpserver-policy-relaying">
+<TITLE>Policy Based Relaying Control</TITLE>
+<INDEXTERM ID=zadm-smtps-policy-relaying1><PRIMARY><FILENAME>smtpserver.conf</></><SECONDARY>relay policy filters</></>
+<INDEXTERM ID=zadm-smtps-policy-relaying2><PRIMARY>SMTP input</><SECONDARY>relay policy, admin</></>
 
 <PARA>
 The policy database that <COMMAND>smtpserver</> uses is built with
@@ -421,7 +524,7 @@
 </PARA>
 
 <PARA>
-Use  <CONSTANT>[/ip.number]/maskwidth</>  here for listing those senders
+Use  <LITERAL>[ip.number]/maskwidth</>  here for listing those senders
 (networks) we want to trust.  You may also use domains, or domain suffixes
 so that the IP-reversed hostnames are accepted (but that is a it risky thing
 due to ease of fakeing the reversed domain names):
@@ -434,15 +537,16 @@
 </PARA>
 
 <PARA>
-Server sets its internal ``always_accept'' flag at the source IP tests
-before it decides on what to tell to the contacting client.
+Server sets its internal ``<LITERAL>always_accept</>'' flag at the source IP
+address tests before it decides on what to tell to the contacting client.
 The flag is not modified afterwards during the session.
 </PARA>
 
 <PARA>
 Usage of domain names here is discouraged as there is no way to tell
-that domain ``foo.bar'' here has different meaning than same domain
-elsewere &mdash; at ``<FILENAME>smtp-policy.mx</>'', for example.
+that domain ``<LITERAL>foo.bar</>'' here has different meaning than
+same domain elsewere &mdash; at ``<FILENAME>smtp-policy.mx</>,''
+for example.
 </PARA></LISTITEM></VARLISTENTRY>
 
 <VARLISTENTRY>
@@ -456,12 +560,14 @@
 
 <PARA>
 You can substitute this knowledge with a fuzzy feeling by using
-``acceptifmx -'' attribute at the generic boilerplate.
-List here domain names. 
+``<LITERAL>acceptifmx -</>'' attribute at the generic boilerplate.
+List here domain names, possibly suffixes:
 <SCREEN>
   mx-target.dom
   .mx-target.dom
 </SCREEN>
+The suffix (``<LITERAL>.mx-target.dom</>'') <EMPHASIS>does not</>
+match to the ``dot-less'' domain name: ``<LITERAL>mx-target.com</>'' !
 </PARA>
 
 <PARA>
@@ -500,7 +606,8 @@
 
 <FIGURE ID="fig.adm.smtp-policy-boiler" PGWIDE="0" FLOAT="1">
 <TITLE>The <FILENAME>smtp-policy.src</> file default settings fragment</TITLE>
-<SCREEN>
+<PROGRAMLISTING>
+<![CDATA[
 ...
 #| ===========================
 #|
@@ -574,13 +681,15 @@
 #|  (The "+" at the DNS zone defines is treated as shorthand to
 #|   "rbl.maps.vix.com")
 #|
-#|  The Third RBL variant means that all target domains can all by themselves
-#|  choose if they use RBL to do source filtering.  The ``= _RBL1'' test
-#|  *must* be added to all domain instances where the check is wanted.
+#|  The Third RBL variant means that all target domains can all by
+#|  themselves choose if they use RBL to do source filtering.
+#|  The ``= _RBL1'' test *must* be added to all domain instances
+#|  where the check is wanted.
 #|  (Including the last-resort domain default of ".")
-#|  (Or inverting: If some recipient domain is *not* wanting RBL-type tests,
-#|   that domain shall have  ``test-rcpt-dns-rbl -'' attribute pair given for
-#|   it at the input datasets -- consider  smtp-policy.mx  file!)
+#|  (Or inverting: If some recipient domain is *not* wanting RBL-type
+#|   tests, that domain shall have  ``test-rcpt-dns-rbl -'' attribute
+#|   pair given for it at the input datasets - consider smtp-policy.mx
+#|   file!)
 #|
 #| These rules mean that locally accepted hostnames MUST be listed in
 #| the database with  'relaytarget +' attribute.  ("acceptifmx *" allows
@@ -599,7 +708,38 @@
 #|
 #| ===========================
 ...
-</SCREEN>
+]]>
+</PROGRAMLISTING>
 </FIGURE>
 </SECT1>
+
+<SECT1 ID="zadm-smtpserver-content-filter">
+<TITLE>Content Based Filtering</TITLE>
+<INDEXTERM ID=zadm-smtps-content-filtering1><PRIMARY><FILENAME>smtpserver.conf</></><SECONDARY>input content filters</></>
+<INDEXTERM ID=zadm-smtps-content-filtering2><PRIMARY>SMTP input</><SECONDARY>content filtering, admin</></>
+
+<PARA>
+The ZMailer <EMPHASIS>can</> do also message content analysis with
+an external program at the end of DATA-dot phase, and BDAT LAST phase
+(that is, when the input message is complete, and final acknowledgement is
+expected by the email sender.)
+</PARA>
+
+<PARA>
+The program becomes active if PARAM entry ``contentfilter''  is set:
+
+<PROGRAMLISTING>
+<![CDATA[
+# External program for received message content analysis:
+#PARAM  contentfilter  $MAILBIN/smtp-contentfilter
+]]>
+</PROGRAMLISTING>
+</PARA>
+
+<PARA>
+More details are at the Reference part: <XREF LINKEND=zref-smtpserver-content-filter>.
+</PARA>
+
+</SECT1>
+
 </CHAPTER>
Index: zmailer/doc/manual/zadm-transport-agents.sgml
diff -u /dev/null zmailer/doc/manual/zadm-transport-agents.sgml:1.1
--- /dev/null	Tue May  8 16:00:09 2001
+++ zmailer/doc/manual/zadm-transport-agents.sgml	Thu Mar  8 00:31:29 2001
@@ -0,0 +1,236 @@
+<CHAPTER ID="ZADM-TA"><?dbhtml filename="zadm-ta.html">
+<TITLE>Transport Agent Administration</TITLE>
+
+<PARA><SCREEN>
+- Move to be a SECTION of Scheduler ?
+  - These are support thingies for the Scheduler anyway.
+- Less details than REFERENCE has, focus differently
+
+- sm
+- smtp
+- mailbox
+- hold
+- expirer
+- errormail
+</SCREEN></PARA>
+
+
+<PARA>
+These are ZMailer's components driven by the <COMMAND>Scheduler</>
+to actually do message delivery actions.
+</PARA>
+
+<PARA>
+The <XREF LINKEND=fig.zadmtragents.zmprocs> repeats earlier picture
+showing central components of the system, and where the
+<EMPHASIS>transport agents</> are in relation to the whole.
+</PARA>
+
+
+<FIGURE PGWIDE="1" FLOAT="1" ID=fig.zadmtragents.zmprocs>
+  <TITLE ID=figtit.zadmtragents.zmprocs>ZMailer's processes; Transport Agents</TITLE>
+  <MEDIAOBJECT>
+    <IMAGEOBJECT>
+      <IMAGEDATA FILEREF="zmprocs-tragents.&GEXT;" FORMAT="&GEXT;">
+    </IMAGEOBJECT>
+  </MEDIAOBJECT>
+</FIGURE>
+
+
+
+<SECT1 ID=zadm-ta-sm>
+<TITLE><COMMAND>Sm</> Transport Agent</TITLE>
+
+<PARA>
+<COMMAND>sm</> is a ZMailer's <COMMAND>sendmail</>(8) compatible
+<EMPHASIS>transport agent</> to deliver messages by invoking a program
+with facilities and in a way compatible with a <COMMAND>sendmail</>(8)
+MTA.
+</PARA>
+
+<PARA>
+The program scans the message control files named on stdin for addresses
+destined for the channel and/or the host given on the command line.
+If any are found, all matching addresses and messages are processed
+according to the specifications for the mailer in the configuration file.
+</PARA>
+
+<PARA>
+The exit status of a mailer should be one of the standard values specified in
+ <EMPHASIS>#include &lt;<FILENAME CLASS="HEADERFILE">sysexits.h</>&gt;</>.
+Of these, <ERRORCODE>EX_OK</> indicates successful deliver, and
+ <ERRORCODE>EX_DATAERR</>, <ERRORCODE>EX_NOUSER</>, <ERRORCODE>EX_NOHOST</>,
+ <ERRORCODE>EX_UNAVAILABLE</>, and <ERRORCODE>EX_NOPERM</> indicate
+permanent failure.
+All other exit codes will be treated as a temporary failure and the delivery
+will be retried.
+</PARA>
+
+<PARA>
+Usage:
+
+<CMDSYNOPSIS>
+<COMMAND>sm</COMMAND>
+  <ARG>-8</ARG>
+  <ARG>-H</ARG>
+  <ARG>-Q</ARG>
+  <ARG>-V</ARG>
+  <ARG>-f <REPLACEABLE>configfile</></ARG>
+  <ARG CHOICE=PLAIN>-c <REPLACEABLE>channel</></ARG>
+  <ARG CHOICE=PLAIN>-h <REPLACEABLE>host</></ARG>
+  <ARG CHOICE=PLAIN><REPLACEABLE>mailer</></ARG>
+</CMDSYNOPSIS>
+</PARA>
+
+<PARA>
+Configuration:
+</PARA>
+
+<PARA>
+The configuration file <FILENAME>$<VARNAME>MAILSHARE</>/sm.conf</>
+associates the mailer keyword from the command line with a specification
+of a delivery program.
+This is very similar to the way the definition of a ``mailer'' in
+<COMMAND>sendmail</>(8).
+It requires flags, a program name, and a command line specification.
+These are in fact the fields of the entries of the configuration file.
+Lines starting with whitespace or a ``<EMPHASIS ROLE="STRONG">#</>''
+are ignored, and all others are assumed to follow format shown in figure
+<XREF LINKEND="fig.adm.sample-sm-conf">.
+</PARA>
+
+<FIGURE ID="fig.adm.sample-sm-conf" PGWIDE="1" FLOAT="1">
+<TITLE>Sample <FILENAME>sm.conf</> file</TITLE>
+<SCREEN>
+#mailer flags program        argument list
+#====== ===== ============== ================================
+local   mS    sm/localm      localm -r $g $u
+prog    -     /bin/sh        sh -c $u
+tty     rs    /usr/local/to  to $u
+uucp    U     /usr/bin/uux   uux - -r -a$g -gC $h!rmail ($u)
+usenet  m     sm/usenet      usenet $u
+test    n     sm/test        test $u
+</SCREEN>
+</FIGURE>
+
+<PARA>
+The mailer field extends from the beginning of the line to the first
+whitespace.
+It is used simply as a key index to the configuration file contents.
+One or more whitespace is used as the field separator for all the fields.
+</PARA>
+
+<PARA>
+The flags field contains a concatenation of one-letter flags.
+If no flags are desired, a ``<LITERAL>-</>''
+character should be used to indicate presence of the field.
+All normal <APPLICATION>sendmail</> (of 8.11(.0))
+flags are recognized, but the ones that do not make sense in
+the context of ZMailer will produce an error (or some are ignored).
+The flags that change the behaviour of <COMMAND>sm</> are:
+
+<VARIABLELIST>
+<VARLISTENTRY><TERM><OPTION>b</OPTION></TERM><LISTITEM><PARA>
+will activate BSMTP-type wrapping with a ``hidden-dot''
+algorithm; e.g. quite ordinary SMTP stream, but in ``batch mode''.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>B</OPTION></TERM><LISTITEM><PARA>
+The  first ``<OPTION>B</>''  turns on similar BSMTP wrapping
+as ``<OPTION>b</>'', but adds
+SIZE and, if the <COMMAND>sm</> is  started  with option ``<OPTION>-8</>'',
+also 8BITMIME options.  The second ``<OPTION>B</>'' adds there also DSN
+(Delivery Status  Notification) parameters.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>E</OPTION></TERM><LISTITEM><PARA>
+will prepend ``<OPTION>&gt;</>'' to any message body line starting
+with ``<EMPHASIS ROLE="STRONG">From </>''. (Read: ``From-space'')
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>f</OPTION></TERM><LISTITEM><PARA>
+adds ``<OPTION>-f sender</>'' arguments to the delivery program.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>n</OPTION></TERM><LISTITEM><PARA>
+will not prepend a ``<EMPHASIS ROLE="STRONG">From </>''-line
+(normal mailbox separator line) to the message.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>r</OPTION></TERM><LISTITEM><PARA>
+adds ``<OPTION>-r sender</>'' arguments to the delivery program.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>S</OPTION></TERM><LISTITEM><PARA>
+will run the delivery program with the same real and effective uid as
+the <COMMAND>sm</> process.
+If this flag is not set, the delivery program will be run with the real
+uid of the <COMMAND>sm</> process.
+This may be useful if <COMMAND>sm</> is setuid.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>m</OPTION></TERM><LISTITEM><PARA>
+informs <COMMAND>sm</> that each instance of the delivery program
+can deliver to many destinations.
+This affects <OPTION>$u</>  expansion  in the argument list, see below.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>P</OPTION></TERM><LISTITEM><PARA>
+prepends a ``Return-Path:'' header to the message.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>U</OPTION></TERM><LISTITEM><PARA>
+will prepend a ``<EMPHASIS ROLE="STRONG">From </>''-line, with
+a ``remote from myuucpname'' at the end, to the message.
+This is what is expected by remote  <COMMAND>rmail</>(1)
+programs for incoming UUCP mail.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>R</OPTION></TERM><LISTITEM><PARA>
+use CRLF sequence as end-of-line sequence. Without
+it, will use LF-only end-of-line sequence.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>X</OPTION></TERM><LISTITEM><PARA>
+does SMTP-like ``hidden-dot'' algorithm  of doubling
+all dots that are at the start of the line.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>7</OPTION></TERM><LISTITEM><PARA>
+will strip (set to 0) the 8th bit of every character in the message.
+</PARA></LISTITEM></VARLISTENTRY>
+</VARIABLELIST>
+</PARA>
+
+<PARA>
+The path field specifies the location of the delivery program.
+Relative pathnames are allowed and are relative to the
+<FILENAME CLASS="DIRECTORY">$<VARNAME>MAILBIN</>/</> directory.
+</PARA>
+
+<PARA>
+The arguments field extends to the end of the line.
+It contains whitespace separated <OPTION>argv</> parameters which may
+contain one of the following sequences:
+
+<VARIABLELIST>
+<VARLISTENTRY><TERM><OPTION>$g</OPTION></TERM><LISTITEM><PARA>
+which is replaced by the sender address.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>$h</OPTION></TERM><LISTITEM><PARA>
+which is replaced by the destination host.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>$u</OPTION></TERM><LISTITEM><PARA>
+which is replaced by the recipient address.
+If the ``<OPTION>m</>'' mailer flag is set and there are several
+recipients for this message, the argument containing the ``<OPTION>$u</>''
+will be replicated as necessary for each recipient.
+</PARA></LISTITEM></VARLISTENTRY>
+</VARIABLELIST>
+</PARA>
+
+</SECT1>
+
+</CHAPTER>
Index: zmailer/doc/manual/zadministration.sgml
diff -u zmailer/doc/manual/zadministration.sgml:1.4 zmailer/doc/manual/zadministration.sgml:1.7
--- zmailer/doc/manual/zadministration.sgml:1.4	Sun Feb 20 22:40:38 2000
+++ zmailer/doc/manual/zadministration.sgml	Thu Mar  8 00:31:29 2001
@@ -10,18 +10,141 @@
 </PARA>
 
 <PARA>
-\segment{zadm-dnsissues}{section}{DNS and ZMailer}
-\segment{zadm-security}{section}{Security Issues}
-\segment{zadm-queues}{section}{The Queue}
-\clearpage
-\segment{zadm-smtpserver}{section}{Smtpserver Configuration}
-\clearpage
-\segment{zadm-router}{section}{Router Configuration}
-\clearpage
-\segment{zadm-scheduler}{section}{Scheduler Configuration}
-\clearpage
-\segment{zadm-sm}{section}{{\em sm} Configuration}
-\clearpage
+The <XREF LINKEND=fig.zadm.zmprocs> repeats earlier picture
+showing central components of the system.
+</PARA>
+
+
+<FIGURE PGWIDE="1" FLOAT="1" ID=fig.zadm.zmprocs>
+  <TITLE ID=figtit.zadm.zmprocs>ZMailer's processes.</TITLE>
+  <MEDIAOBJECT>
+    <IMAGEOBJECT>
+      <IMAGEDATA FILEREF="zmprocs.&GEXT;" FORMAT="&GEXT;">
+    </IMAGEOBJECT>
+  </MEDIAOBJECT>
+</FIGURE>
+
+<PARA>
+The things in the picture are pointed further here, along with
+their related auxiliary programs, etc:
+
+<VARIABLELIST>
+<VARLISTENTRY><TERM><COMMAND>smtpserver</COMMAND></TERM>
+<LISTITEM><PARA>
+Administration of the <COMMAND>smtpserver</> is described at
+<XREF LINKEND=zadm-smtpserver>, and detailed Reference
+is at <XREF LINKEND=zref-smtpserver>.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><COMMAND>sendmail</COMMAND></TERM>
+<LISTITEM><PARA>
+The <COMMAND>sendmail</> client compatibility functions program
+is described at Reference <XREF LINKEND=zref-sendmail>.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><COMMAND>router</COMMAND></TERM>
+<LISTITEM><PARA>
+Administration of the <COMMAND>router</> is at
+ <XREF LINKEND=zadm-router>, and Reference is at
+ <XREF LINKEND=zref-router>.
+</PARA>
+
+<PARA>
+Auxiliary programs used to support the <COMMAND>router</> include:
+
+<VARIABLELIST>
+<VARLISTENTRY><TERM><COMMAND>zmailer newdb</COMMAND></TERM>
+<LISTITEM><PARA>
+This script has two behaviours,
+if <FILENAME>$<VARNAME>MAILVAR</>/db/dbases.conf</> file can be found,
+utility script <COMMAND>newdbprocessor</> is run.  If not, a set of
+pre-determined individual database regeneration actions is done.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><COMMAND>newdb</COMMAND></TERM>
+<LISTITEM><PARA>
+A <APPLICATION>perl</> wrapper for actual internal <COMMAND>makedb</>
+utility taking care of things like correct sequence of file movements
+after successfull generation of new binary database file(s).
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><COMMAND>newaliases</COMMAND></TERM>
+<LISTITEM><PARA>
+Classical <FILENAME>aliases</> database regenerator, subset of
+<COMMAND>zmailer newdb</>.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><COMMAND>newfqdnaliases</COMMAND></TERM>
+<LISTITEM><PARA>
+Behaves like the <COMMAND>newaliases</>, but processes
+different database: <FILENAME>fqdnaliases</>.
+Subset of <COMMAND>zmailer newdb</>.
+</PARA></LISTITEM></VARLISTENTRY>
+
+</VARIABLELIST> <!-- end of 'router' related programs -->
+
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><COMMAND>scheduler</COMMAND></TERM>
+<LISTITEM><PARA>
+Administration of the <COMMAND>scheduler</> is at
+ <XREF LINKEND=zadm-scheduler>, and Reference is at
+ <XREF LINKEND=zref-scheduler>.
+</PARA>
+
+<PARA>
+Auxiliary programs used to support the <COMMAND>scheduler</> include:
+
+<VARIABLELIST>
+<VARLISTENTRY><TERM><COMMAND>mailq</COMMAND></TERM>
+<LISTITEM><PARA>
+Utility for querying <COMMAND>scheduler</>'s view of the universe.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><COMMAND>mailbox</COMMAND></TERM>
+<LISTITEM><PARA>
+Program driven by the <COMMAND>scheduler</> to do (usually) delivery
+to local mailboxes, running pipes, and writing to files.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><COMMAND>smtp</COMMAND></TERM>
+<LISTITEM><PARA>
+Program to do delivery to external systems via SMTP protocol
+(with many supported extensions).
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><COMMAND>hold</COMMAND></TERM>
+<LISTITEM><PARA>
+Handler of ``<LITERAL>hold</>''-channel deliveries.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><COMMAND>sm</COMMAND></TERM>
+<LISTITEM><PARA>
+There are lots of programs intended to be run under <APPLICATION>sendmail</>'s
+<LITERAL>M</>-entry (<EMPHASIS>Mailer-entry</>) lines. This program supplies
+that interface layer to an extent which is meaningfull in ZMailer sense.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><COMMAND>errormail</COMMAND></TERM>
+<LISTITEM><PARA>
+Handler of ``<LITERAL>error</>''-channel deliveries.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><COMMAND>expirer</COMMAND></TERM>
+<LISTITEM><PARA>
+This is actually driven by the administrator via <COMMAND>manual-expirer</>
+wrapper script.
+</PARA></LISTITEM></VARLISTENTRY>
+
+</VARIABLELIST> <!-- end of 'scheduler' related programs -->
+</PARA></LISTITEM></VARLISTENTRY>
+
+</VARIABLELIST>
+</PARA>
+
+
+</PARTINTRO>
+
 <!-- 
   <!ENTITY ZADM-DNSISSUES  SYSTEM "zadm-dnsissues.sgml">
   <!ENTITY ZADM-SECURITY   SYSTEM "zadm-security.sgml">
@@ -29,12 +152,9 @@
   <!ENTITY ZADM-SMTPSERVER SYSTEM "zadm-smtpserver.sgml">
   <!ENTITY ZADM-ROUTER     SYSTEM "zadm-router.sgml">
   <!ENTITY ZADM-SCHEDULER  SYSTEM "zadm-scheduler.sgml">
-  <!ENTITY ZADM-SM         SYSTEM "zadm-sm.sgml">
+  <!ENTITY ZADM-TR-AGENTS  SYSTEM "zadm-transport-agents.sgml">
   <!ENTITY ZADM-LOGGING    SYSTEM "zadm-logging.sgml">
 -->
-</PARA>
-
-</PARTINTRO>
 
 &ZADM-DNSISSUES;
 &ZADM-SECURITY;
@@ -42,7 +162,7 @@
 &ZADM-SMTPSERVER;
 &ZADM-ROUTER;
 &ZADM-SCHEDULER;
-&ZADM-SM;
+&ZADM-TR-AGENTS;
 &ZADM-LOGGING;
 
 </PART>
Index: zmailer/doc/manual/zapp-filefmts.sgml
diff -u zmailer/doc/manual/zapp-filefmts.sgml:1.7 zmailer/doc/manual/zapp-filefmts.sgml:1.11
--- zmailer/doc/manual/zapp-filefmts.sgml:1.7	Wed Feb 21 18:20:26 2001
+++ zmailer/doc/manual/zapp-filefmts.sgml	Tue Apr  3 14:30:03 2001
@@ -1,23 +1,45 @@
 <APPENDIX ID="zapp.msg-file-format"><?dbhtml filename="zapp-filefmts.html">
 <TITLE>Internal File Data Formats</TITLE>
 
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<SECT1 ID=zapp-filefmts>
+<TITLE>ZMailer's Files and Formats </TITLE>
+
+
+<FIGURE PGWIDE=1 FLOAT=1 ID=fig.zappffmt.zmdirs>
+  <TITLE ID=figtit.zappffmt.zmdirs>ZMailer's <FILENAME>$<VARNAME>POSTOFFICE</>/</> directories and files</TITLE>
+  <MEDIAOBJECT>
+    <IMAGEOBJECT>
+      <IMAGEDATA FILEREF="zmdirs.&GEXT;" FORMAT="&GEXT;">
+    </IMAGEOBJECT>
+  </MEDIAOBJECT>
+</FIGURE>
+
+
+</SECT1>
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<SECT1 ID=zapp-filefmts-envelope-header-lines>
+<TITLE>Envelope Header Lines</TITLE>
+
 <PARA>
-As mentioned, the <EMPHASIS>router</> picks up message files from
-a specific directory.
+As the <COMMAND>router</> picks up message files from a specific directory.
 Normally, message file names can be arbitrary valid file names, and indeed
 this is convenient when debugging.
-However, because the <EMPHASIS>router</> daemon scans its own current
+However, because the <COMMAND>router</> daemon scans its own current
 directory, miscellaneous output from the <EMPHASIS>router</> process
 may show up in this directory (e.g. profiling data, or core dumps
 (unthinkable as that is)).
 Furthermore, it is useful to be able to hide files from
-the <EMPHASIS>router</> scanning (indeed the <EMPHASIS>router</> may
+the <COMMAND>router</> scanning (indeed the <COMMAND>router</> may
 wish to do so itself).
 </PARA>
 
 <PARA>
-When the <EMPHASIS>router</> process is scanning for message files then,
-it only considers at file names that have a certain format.
+When the <COMMAND>process</> is scanning for message files, it only
+considers file names that have a certain format.
 Specifically, the message file name must start with a digit.
 This method was chosen to accomodate the message file names, as generated
 by the standard submission interface library routines, which will be strings
@@ -43,9 +65,6 @@
 will be covered later.
 </PARA>
 
-<SECT1 ID=zapp-filefmts-envelope-header-lines>
-<TITLE>Envelope Header Lines</TITLE>
-
 <PARA>
 The message envelope headers are used to carry meta-information about
 the message.
@@ -57,19 +76,24 @@
  *external \n
  *rcvdfrom %s (%s) \n
  *bodytype %s \n
+ *errormsg \n
  *with %s \n
  *identinfo %s \n
+
 <EMPHASIS>Either:</>
-   from &lt;%s&gt; \n
+  from &lt;%s&gt; \n
 <EMPHASIS>Or:</>
-   channel error \n
+  channel error \n
+
  *envid %s \n
  *notaryret %s \n
+
 <EMPHASIS>Then for each recipient pairs of:</>
  *todsn [NOTIFY=...] [ORCPT=...] \n
- to &lt;%s&gt; \n
+  to &lt;%s&gt; \n
+
 <EMPHASIS>Just before the data starts, a magic entry:</>
- env-end \n
+  env-end \n
 </SCREEN>
 Then starts the message RFC-822 headers, and below it, the body.
 </PARA>
@@ -77,83 +101,95 @@
 <PARA>
 The header fields recognized by ZMailer in the message envelope are:
 <VARIABLELIST>
-<VARLISTENTRY><TERM>bodytype <EMPHASIS>word</></TERM>
+<VARLISTENTRY><TERM><OPTION>bodytype </><EMPHASIS>word</></TERM>
 <LISTITEM><PARA>
 not used. Compatibility with the <APPLICATION>sendmail</> feature 
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>channel <EMPHASIS>word</></TERM>
+<VARLISTENTRY><TERM><OPTION>channel </><EMPHASIS>word</></TERM>
 <LISTITEM><PARA>
 sets the channel corresponding to the message origin(*),
-usually as ``channel error''
+usually as ``<LITERAL>channel error</>''
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>comment <EMPHASIS>string</></TERM>
+<VARLISTENTRY><TERM><OPTION>comment </><EMPHASIS>string</></TERM>
 <LISTITEM><PARA>
 arbitrary comment
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>env-end</TERM>
+<VARLISTENTRY><TERM><OPTION>env-end</></TERM>
 <LISTITEM><PARA>
-separator between the envelope and the RFC822 headers
+separator flag-word in between the envelope and the RFC822 headers
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>env-eof</TERM>
+<VARLISTENTRY><TERM><OPTION>env-eof</></TERM>
 <LISTITEM><PARA>
-alias to env-end
+alias to <OPTION>env-end</>
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>envid <EMPHASIS>xtext</></TERM>
+<VARLISTENTRY><TERM><OPTION>errormsg</></TERM>
 <LISTITEM><PARA>
+Special internal flag-word telling that the message in question
+has been produced by <COMMAND>scheduler</> or <COMMAND>errormail</>,
+and is considered an error message.
+</PARA><PARA>
+This distinction can be used at routing to determine use of different
+default route lookup key for recipients in this case.
+See file <FILENAME>p-routes.cf</>.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>envid </><EMPHASIS>xtext</></TERM>
+<LISTITEM><PARA>
 ESMTP DSN ENVID value
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>external</TERM>
+<VARLISTENTRY><TERM><OPTION>external</></TERM>
 <LISTITEM><PARA>
-keyword indicating the external origin of a message
+A flag-word indicating the external origin of a message
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>from <EMPHASIS>``address''</></TERM>
+<VARLISTENTRY><TERM><OPTION>from </><EMPHASIS>``address''</></TERM>
 <LISTITEM><PARA>
 a source address(*)
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>fullname <EMPHASIS>``phrase''</></TERM>
+<VARLISTENTRY><TERM><OPTION>fullname </><EMPHASIS>``phrase''</></TERM>
 <LISTITEM><PARA>
 sets the full name of the local sender
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>identinfo <EMPHASIS>``string''</></TERM>
+<VARLISTENTRY><TERM><OPTION>identinfo </><EMPHASIS>``string''</></TERM>
 <LISTITEM><PARA>
 The SMTP server's ident lookup result, this does not guarantee anything
 about the sender though.
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>loginname <EMPHASIS>``word''</></TERM>
+<VARLISTENTRY><TERM><OPTION>loginname </><EMPHASIS>``word''</></TERM>
 <LISTITEM><PARA>
 requests using this mail id for the local sender
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>notaryret <EMPHASIS>``word''</></TERM>
+<VARLISTENTRY><TERM><OPTION>notaryret </><EMPHASIS>``word''</></TERM>
 <LISTITEM><PARA>
-ESMTP DSN RET=<EMPHASIS>word</>, either ``FULL'' ``HDRS''
+ESMTP DSN RET=<EMPHASIS>word</>, either ``<LITERAL>FULL</>'',
+or ``<LITERAL>HDRS</>''
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>rcvdfrom <EMPHASIS>``domain'' (opt comment)</></TERM>
+<VARLISTENTRY><TERM><OPTION>rcvdfrom </><EMPHASIS>``domain'' (opt comment)</></TERM>
 <LISTITEM><PARA>
-An optional envelope entry, which sets ``Received:'' header's
-``from'' field value.
+An optional envelope entry, which sets ``<LITERAL>Received:</>'' header's
+``<LITERAL>from</>'' field value.
 </PARA>
 
 <PARA>
 This should <EMPHASIS>only</> be used on messages that are originated
 thru ``trusted'' mechanisms, and especially <EMPHASIS ROLE="BOLD">not</>
 be used when the message is originated by some John Doe in the system.
-(E.g. this is reserved for <EMPHASIS>smtpserver</> and friends, not
+(E.g. this is reserved for <COMMAND>smtpserver</> and friends, not
  for arbitrary users.)
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>to <EMPHASIS>``address-list''</></TERM>
+<VARLISTENTRY><TERM><OPTION>to </><EMPHASIS>``address-list''</></TERM>
 <LISTITEM><PARA>
 Normal recipient address list; usually used in form of listing
 one address in angle braces:
@@ -162,14 +198,14 @@
 </SCREEN>
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>todsn <EMPHASIS>``phrase''</></TERM>
+<VARLISTENTRY><TERM><OPTION>todsn </><EMPHASIS>``phrase''</></TERM>
 <LISTITEM><PARA>
 ESMTP DSN recipient parameters.
-Note: this must be before the recipient ``to'' line for which
+Note: this must be before the recipient ``<OPTION>to</>'' line for which
 this gives the extra parameters.
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>user <EMPHASIS>``local-part''</></TERM>
+<VARLISTENTRY><TERM><OPTION>user </><EMPHASIS>``local-part''</></TERM>
 <LISTITEM><PARA>
 Optional envelope entry telling who the message originating user
 was.   The system is extremely suspicuous on this entry, and will
@@ -177,7 +213,7 @@
 owner uid is known to belong to trusted users.
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>verbose <EMPHASIS>``filename''</></TERM>
+<VARLISTENTRY><TERM><OPTION>verbose </><EMPHASIS>``filename''</></TERM>
 <LISTITEM><PARA>
 This optional envelope entry tells the router, what filename
 the sending client expects the subsystems to use as a feedback
@@ -191,23 +227,23 @@
 the message spool file.
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>via <EMPHASIS>``word''</></TERM>
+<VARLISTENTRY><TERM><OPTION>via </><EMPHASIS>``word''</></TERM>
 <LISTITEM><PARA>
-An optional envelope entry that will define ``Received:'' header's
-optional ``via'' tag telling what physical transport mechanism was
-used.
+An optional envelope entry that will define ``<LITERAL>Received:</>''
+header's optional ``<LITERAL>via</>'' tag telling what physical transport
+mechanism was used.
 </PARA><PARA>
 Usually this entry is <EMPHASIS>not</> used.
-(For an exceptions, see <EMPHASIS>rmail</> and
- <EMPHASIS>listexpand</> utility.)
+(For an exceptions, see <COMMAND>rmail</> and
+ <COMMAND>listexpand</> utility.)
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>with <EMPHASIS>``word''</></TERM>
+<VARLISTENTRY><TERM><OPTION>with </><EMPHASIS>``word''</></TERM>
 <LISTITEM><PARA>
-An optional envelope entry that will define ``Received:'' header's
-optional ``with'' tag telling what protocol was used.
+An optional envelope entry that will define ``<LITERAL>Received:</>''
+header's optional ``<LITERAL>with</>'' tag telling what protocol was used.
 </PARA><PARA>
-Unlike RFC-822 tells, ZMailer supports only one ``with'' instance.
+Unlike RFC-822 tells, ZMailer supports only one ``<LITERAL>with</>'' instance.
 </PARA></LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
 </PARA>
@@ -215,27 +251,27 @@
 <PARA>
 The (*)'s beside the descriptions indicate this is a privileged field.
 That is, the action will only happen if ZMailer trusts the owner of the
-message file (*Note Security: security.). 
+message file (*Note Security: security. XREF ??). 
 As with a normal RFC822 header, other fields are allowed (though they
 will be ignored), and case is not significant in the field name.
-The <EMPHASIS>router</> will do appropriate checks for the fields that
+The <COMMAND>router</> will do appropriate checks for the fields that
 require it.
 </PARA>
 
 <PARA>
 With this knowledge, we can now appreciate the minimal message file:
 <SCREEN>
-  --------------------
+  ====================
   to bond
    
-  --------------------
+  ====================
 </SCREEN></PARA>
 
 <PARA>
 This will cause an empty message to be sent to <EMPHASIS>bond</>.
 A slightly more sophisticated version is:
 <SCREEN>
-  --------------------
+  ====================
   from m
   to bond
   via courier
@@ -245,14 +281,14 @@
   Subject: do get a receipt, 007!
      
   You are working for the Government, remember?
-  --------------------
+  ====================
 </SCREEN></PARA>
 
 <PARA>
 Notice that there is no delimiter between the message envelope and the
 message header.  A more sophisticated example in the same vein:
 <SCREEN>
-  --------------------
+  ====================
   from ps/d-ops
   to &lt;007@sis.mod.uk&gt;
   env-end
@@ -264,15 +300,15 @@
   Priority: Flash
      
   We have another madman on the loose.  Contact "Q" for usual routine.
-  --------------------
+  ====================
 </SCREEN>
 </PARA>
 
 <PARA>
 If the <EMPHASIS>Classification:</> header is paid attention to in ZMailer,
-this requires that the <EMPHASIS>router</> recognize it in the message
+this requires that the <COMMAND>router</> recognize it in the message
 header, and take appropriate action.
-In general the <EMPHASIS>router</> can extract most of the information in
+In general the <COMMAND>router</> can extract most of the information in
 the message header, and make use of it if the information is lacking in
 the envelope.
 The envelope headers in the above message are superfluous, since the same
@@ -280,11 +316,11 @@
 Using the following envelope headers would be exactly equivalent to using
 the ones shown above (assuming the local host is <EMPHASIS>sis.mod.uk</>):
 <SCREEN>
-  --------------------
+  ====================
   From Moneypenny &lt;ps/d-ops@sis.mod.uk&gt;
   To James Bond &lt;007@sis.mod.uk&gt;
   ...
-  --------------------
+  ====================
 </SCREEN></PARA>
 
 <PARA>
@@ -296,24 +332,25 @@
 
 <PARA>
 The message body is not interpreted by ZMailer itself.
-As far as the <EMPHASIS>router</> is concerned, it can be arbitrary data.
+As far as the <COMMAND>router</> is concerned, it can be arbitrary data.
 However, certain <EMPHASIS>Transport Agents</> may require limitations on
 the message body data.
 For example, the SMTP only deals with ASCII data with a small guaranteed
 line length.
 </PARA>
 
-
 </SECT1>
 
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
 <SECT1 ID=zapp-filefmts-message-control-file>
 <TITLE>Message Control File</TITLE>
 
 <PARA>
-A message control file is a file created by the <EMPHASIS>router</> to
+A message control file is a file created by the <COMMAND>router</> to
 contain all the information necessary for delivery of a message submitted
 in a corresponding message file.
-It is interpreted by the <EMPHASIS>scheduler</>, which needs to know
+It is interpreted by the <COMMAND>scheduler</>, which needs to know
 at all times which messages are pending to go where, and how.
 It is also interpreted by one or more <EMPHASIS>Transport Agents</>,
 possibly concurrently, that extract the delivery information relevant
@@ -338,7 +375,7 @@
 <PARA>
 Apart from necessary envelope and control information, a control file also
 contains the new message header for the message, which contains the header
-addresses as rewritten by the <EMPHASIS>router</>.
+addresses as rewritten by the <COMMAND>router</>.
 Since a message may have several destinations with incompatible address
 format requirements, there may be several corresponding groups of message
 headers.
@@ -347,6 +384,8 @@
 </PARA>
 
 
+<!-- ============================================================= -->
+
 <SECT2 ID=zapp-filefmts-message-control-file-format>
 <TITLE>Format</TITLE>
 
@@ -363,13 +402,14 @@
 Here is a simple control file produced by a test message, just before it
 was removed by the Scheduler:
 <SCREEN>
-  --------------------
+  ====================
+  @ 0x00000007
   i 24700
   o 72
   l &lt;88Jan10.003129est.24700@bay.csri.toronto.edu&gt;
   e Rayan Zachariassen &lt;rayan&gt;
   s local - rayan
-  r+local - rayan 2003
+  r+          local - rayan 2003
   m
   Received: by bay.csri.toronto.edu id 24700; Sun, 10 Jan 88 00:31:29 EST
   From:   Rayan Zachariassen &lt;rayan&gt;
@@ -379,7 +419,7 @@
   Date:   Sun, 10 Jan 88 00:31:24 EST
   
   s local - rayan@bay.csri.toronto.edu
-  r+smtp ephemeral.ai.toronto.edu rayan@ephemeral.ai.toronto.edu 2003
+  r+          smtp ephemeral.ai.toronto.edu rayan@ephemeral.ai.toronto.edu 2003
   m
   Received: by bay.csri.toronto.edu id 24700; Sun, 10 Jan 88 00:31:29 EST
   From:   Rayan Zachariassen &lt;rayan@csri.toronto.edu&gt;
@@ -388,95 +428,177 @@
   Message-Id: &lt;88Jan10.003129est.24700@bay.csri.toronto.edu&gt;
   Date:   Sun, 10 Jan 88 00:31:24 EST
   
-  --------------------
+  ====================
 </SCREEN>
 </PARA>
 
 <PARA>
 The id character values are defined in
-the <FILENAME CLASS="HEADERFILE">mail.h</> system header file,
+the <FILENAME CLASS=HEADERFILE>mail.h</> system header file,
 which currently contains:
 <SCREEN>
+/* These are in order (roughly) what the router writes out. */
+#define _CF_FORMAT      '@'     /* What format variant are we ?? */
+
+#define _CF_FORMAT_TA_PID       0x00000001 /* At 'r' or 'X' lines */
+#define _CF_FORMAT_DELAY1       0x00000002 /* At 'r' or 'X' lines */
+#define _CF_FORMAT_MIMESTRUCT   0x00000004 /* The 'M' block       */
+#define _CF_FORMAT_KNOWN_SET (_CF_FORMAT_DELAY1|_CF_FORMAT_TA_PID | \
+                              _CF_FORMAT_MIMESTRUCT)
+
+#define _CF_VERBOSE     'v'     /* log file name for verbose log (mail -v) */
 #define _CF_MESSAGEID   'i'     /* inode number of file containing message */
 #define _CF_BODYOFFSET  'o'     /* byte offset into message file of body */
+#define _CF_LOGIDENT    'l'     /* identification string for log entries */
 #define _CF_BODYFILE    'b'     /* alternate message file for new body */
+#define _CF_ERRORADDR   'e'     /* return address for error messages */
+#define _CF_OBSOLETES   'x'     /* message id of message obsoleted by this */
+#define _CF_TURNME      'T'     /* trigger scheduler to attempt delivery now */
 #define _CF_SENDER      's'     /* sender triple (channel, host, user) */
-#define _CF_RECIPIENT   'r'     /* recipient n-tuple, n &gt;= 3 */
+#define _CF_RECIPIENT   'r'     /* recipient n-tuple, n >= 3 */
 #define _CF_DSNRETMODE  'R'     /* DSN message body return control */
 #define _CF_XORECIPIENT 'X'     /* one of XOR set of recipient n-tuples */
 #define _CF_RCPTNOTARY  'N'     /* DSN parameters for previous recipient */
-#define _CF_DSNENVID    'n'     /* DSN 'MAIL FROM&lt;&gt; ENVID=XXXX' data */
-#define _CF_ERRORADDR   'e'     /* return address for error messages */
-#define _CF_DIAGNOSTIC  'd'     /* diagnostic message for ctlfile offset */
+#define _CF_DSNENVID    'n'     /* DSN 'MAIL FROM&lt;> ENVID=XXXX' data */
 #define _CF_MSGHEADERS  'm'     /* message header for preceeding recipients */
-#define _CF_LOGIDENT    'l'     /* identification string for log entries */
-#define _CF_OBSOLETES   'x'     /* message id of message obsoleted by this */
-#define _CF_VERBOSE     'v'     /* log file name for verbose log (mail -v) */
-#define _CF_TURNME      'T'     /* trigger scheduler to attempt delivery now */
-#define _CF_RCVFROM     'F'     /* Where-from we are coming ? */               
+#define _CF_MIMESTRUCT  'M'     /* compacted MIME structure data for message */
+#define _CF_DIAGNOSTIC  'd'     /* diagnostic message for ctlfile offset */
+
+/* The following characters may appear in the second column after most _CF_* */
+#define _CFTAG_NORMAL   ' '     /* what the router sets it to be */
+#define _CFTAG_LOCK     '~'     /* that line is being processed, lock it */
+#define _CFTAG_OK       '+'     /* positive outcome of processing */
+#define _CFTAG_NOTOK    '-'     /* something went wrong */
+#define _CFTAG_DEFER    _CFTAG_NORMAL   /* try again later */
 </SCREEN>
 </PARA>
 
 <PARA>
-There is one field per line, except for <CONSTANT>_CF_MSGHEADERS</> which
-has some special semantics described below.
+There is one field per line, except for <CONSTANT>_CF_MSGHEADERS</>,
+and <CONSTANT>_CF_MIMESTRUCT</>, which have some special semantics
+described below.
+</PARA>
+
+<PARA>
 The following describes the fields in detail:
 
 <VARIABLELIST>
-<VARLISTENTRY><TERM>i</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>@</> <EMPHASIS>hex-encoded-bitflagset</></TERM><LISTITEM><PARA>
+This carries a hex-encoded bitflag set which is used by
+the <COMMAND>scheduler</>, and <EMPHASIS>Transport Agents</> to detect
+if the <COMMAND>router</> produces files with incompatible features to
+what the latter programs know.
+</PARA><PARA>
+This is used to ensure that there stays a capability relation of:
+<SCREEN>
+  router <= scheduler <= transport-agents
+</SCREEN>
+</PARA><PARA>
+For example:
+<SCREEN>
+  @ 0x00000007
+</SCREEN>
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>v</> <EMPHASIS>relative-file-path</></TERM><LISTITEM><PARA>
+Log file name for verbose log (<USERINPUT>mail -v</>):
+<SCREEN>
+ v ../public/v_some_magic_tmpfile
+</SCREEN>
+</PARA></LISTITEM></VARLISTENTRY>
+
+
+<VARLISTENTRY><TERM><OPTION>i</> <EMPHASIS>filename</></TERM><LISTITEM><PARA>
 This field identifies the message file corresponding to this control file.
 It is the name of the message file in the <EMPHASIS>QUEUE</> directory
 (<FILENAME CLASS="DIRECTORY">$<VARNAME>POSTOFFICE</>/queue/</>).
+</PARA><PARA>
 This is typically the same as the inode number for that file, but need not be.
 It is used by <EMPHASIS>Transport Agents</> when copying the message body,
-and by the <EMPHASIS>Scheduler</> when unlinking the file after all
+and by the <COMMAND>scheduler</> when unlinking the file after all of
 the destination addresses have been processed.
+</PARA><PARA>
 For example:
 <SCREEN>
-  i 21456
+  i 21456-789
 </SCREEN>
+
+
+<INFORMALFIGURE PGWIDE=0 FLOAT=0 ID=fig.zappffmt.zmsched1>
+<!--  <TITLE ID=figtit.zappffmt.zmsched1>The ``<LITERAL>i</>'' reference meaning</TITLE> -->
+  <MEDIAOBJECT>
+    <IMAGEOBJECT>
+      <IMAGEDATA FILEREF="zmsched1.&GEXT;" FORMAT="&GEXT;">
+    </IMAGEOBJECT>
+  </MEDIAOBJECT>
+</INFORMALFIGURE>
+
+
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>o</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>o</> <EMPHASIS>decimal-number</></TERM><LISTITEM><PARA>
 Specifies the byte offset of the message body in the message file.
 It is used by <EMPHASIS>Transport Agents</> in order to copy
 the message body quickly, without parsing the message file.
+</PARA><PARA>
 For example:
 <SCREEN>
   o 466
 </SCREEN>
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>b</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>l</> <EMPHASIS>message-id-string</></TERM><LISTITEM><PARA>
+The field value is an uninterpreted string which should prefix all log
+messages and accounting records associated with this message.
+This value is typically the message id string.
+</PARA><PARA>
+For example:
+<SCREEN>
+  l &lt;88Jan6.103158gmt.24694@sis.mod.uk&gt;
+</SCREEN>
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>b</> <EMPHASIS>filename</></TERM><LISTITEM><PARA>
 Alternate message file for new body.
+(<EMPHASIS>Currently not supported!</>)
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>e</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>e</> <EMPHASIS>error-address</></TERM><LISTITEM><PARA>
 Gives an address to which delivery errors should be sent.
-The address must be an RFC822 mailbox.
+The address must be a RFC822 mailbox.
+</PARA><PARA>
 For example:
 <SCREEN>
   e "Operations Directorate" &lt;d-ops@sis.mod.uk&gt;
 </SCREEN>
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>l</TERM><LISTITEM><PARA>
-The field value is an uninterpreted string which should prefix all log
-messages and accounting records associated with this message.
-This value is typically the message id string.
+<VARLISTENTRY><TERM><OPTION>x</> <EMPHASIS>message-id-string</></TERM><LISTITEM><PARA>
+Message id of message obsoleted by this.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>T</></TERM><LISTITEM><PARA>
+This is mainly <COMMAND>smtpserver</> created message directing
+the <COMMAND>scheduler</> to trigger sending of given queue
+(or other parameter) right (resources permitting).
+This is mainly superceded by <EMPHASIS>MAILQv2</> ETRN IPC mechanism.
+</PARA><PARA>
 For example:
 <SCREEN>
-  l &lt;88Jan6.103158gmt.24694@sis.mod.uk&gt;
+  T some.specific.domain (trigger originator IP address)
 </SCREEN>
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>s</TERM><LISTITEM><PARA>
+
+<VARLISTENTRY><TERM><OPTION>s</> <EMPHASIS>sender-quad</></TERM><LISTITEM><PARA>
 This field specifies an originator (sender) address triple, in the
 sequence: previous channel, previous host, return address.
 It remains the current sender address until the next instance of this field.
+</PARA><PARA>
 Since there can only be one sender of a message, multiple instances of
 the field will correspond to different return address formats as
-produced by the <FUNCTION>crossbar</> algorithm in the <EMPHASIS>router</>.
+produced by the <FUNCTION>crossbar</> algorithm in the <COMMAND>router</>.
+</PARA><PARA>
 For example:
 <SCREEN>
   s smtp sis.mod.uk @lab.sis.mod.uk:q@deadly-sun.lab.sis.mod.uk
@@ -484,49 +606,83 @@
 </SCREEN>
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>r</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>r</> <EMPHASIS>10-spaces rcpt-quad</></TERM><LISTITEM><PARA>
 This field specifies a destination (recipient) address triple, in the
 sequence: next channel, next host, address for next host.
 Optional information to be passed to the <EMPHASIS>Transport Agent</>
 may be placed after the mandatory fields; this currently refers to
 the delivery privilege of the destination address.
 Since the optional values of this field are only interpreted by the
-<EMPHASIS>Transport Agent</>, changes in what the <EMPHASIS>router</>
+<EMPHASIS>Transport Agent</>, changes in what the <COMMAND>router</>
 writes must be coordinated with the code of the <EMPHASIS>Transport Agents</>
 that might interpret this field.
+</PARA><PARA>
+For recipient processing interlocks, and delay report flags there is
+6+4 spaces before the actual recipient address quad.
+</PARA><PARA>
 For example:
 <SCREEN>
-  r local - bond 0
-  r uucp uunet sisops!bond -2
+  ==123456ABCD....
+  r           local - bond 0
+  r           uucp uunet sisops!bond -2
 </SCREEN>
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>R</TERM><LISTITEM><PARA>
-DSN message body return control.
+<VARLISTENTRY><TERM><OPTION>X</></TERM><LISTITEM><PARA>
+One of XOR set of recipient 4-tuples.
+(<EMPHASIS>Not used so far.</>)
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>X</TERM><LISTITEM><PARA>
-One of XOR set of recipient n-tuples.
-</PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>N</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>N</></TERM><LISTITEM><PARA>
 DSN parameters for previous recipient.
+</PARA><PARA>
+For example:
+<SCREEN>
+  ==123456ABCD....
+  r           local - bond 0
+  N ORCPT=rfc822;bond NOTIFY=DELAY,FAILURE
+</SCREEN>
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>n</TERM><LISTITEM><PARA>
-DSN <COMPUTEROUTPUT>MAIL FROM&lt;&gt; ENVID=XXXX</> data.
+<VARLISTENTRY><TERM><OPTION>R</></TERM><LISTITEM><PARA>
+DSN message body return control flag.
+(While this is stored once per every message
+</PARA><PARA>
+For example:
+<SCREEN>
+  ==123456ABCD....
+  r           local - bond 0
+  N ORCPT=rfc822;bond NOTIFY=DELAY,FAILURE
+  R HDRS
+</SCREEN>
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>n</></TERM><LISTITEM><PARA>
+DSN <LITERAL>MAIL FROM&lt;..&gt; ENVID=XXXX</> data.
+</PARA><PARA>
+For example:
+<SCREEN>
+  ==123456ABCD....
+  r           local - bond 0
+  N ORCPT=rfc822;bond NOTIFY=DELAY,FAILURE
+  R HDRS
+  n XXXX
+</SCREEN>
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>m</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>m</></TERM><LISTITEM><PARA>
 Apart from a message body, a <EMPHASIS>Transport Agent</>
 needs the message headers to construct the message it delivers.
 These message headers are stored as the value of this field.
+</PARA><PARA>
 Since message headers obviously can span lines, the syntax for
 this field is somewhat different than for the others.
 The field id is immediately followed by a newline, which is followed
 by a complete set of message headers.
 These are terminated (in the usual fashion) by an empty line, which also
 terminates this field.
+</PARA><PARA>
 In the following example, the last line of text is followed by an empty line,
 after which another field may start:
 <SCREEN>
@@ -534,45 +690,39 @@
   From: M
   To: Bond
   Subject: do get a receipt, 007!
+  
+  s ...
+  r ...
 </SCREEN>
 </PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>M</></TERM><LISTITEM><PARA>
+This is another multi-line structure reserved for latter support of
+pre-scanned MIME structure data so that the transport-agents have
+easier work ahead of them when planning things like content transformations
+during the transport action. (12-Mar-2001)
+</PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>d</TERM><LISTITEM><PARA>
-This field is <EMPHASIS>not</> written by the <EMPHASIS>router</>.
-t is written by the <EMPHASIS>Scheduler</> or <EMPHASIS>transport agents</>
+<VARLISTENTRY><TERM><OPTION>d</></TERM><LISTITEM><PARA>
+This field is <EMPHASIS>not</> written by the <COMMAND>router</>.
+It is written by the <COMMAND>scheduler</> or <EMPHASIS>Transport Agents</>
 to remember errors associated with specific addresses.
 The field value has two parts, the first being the byte offset in the control
 file of the destination (recipient) address causing the error, and the rest
 of the line being an error message.
 The <EMPHASIS>Transport Agents</> discover these errors and report them
-to the <EMPHASIS>Scheduler</>.
-The <EMPHASIS>Scheduler</> will collect them and report them to
+to the <COMMAND>scheduler</>.
+</PARA><PARA>
+The <COMMAND>scheduler</> will collect them and report them to
 the error return address (if any) after all the destinations have been
 processed.
-For example:
+</PARA><PARA>
+For example: (FIXME! XREF to detail data ?)
 <SCREEN>
   d 878 No such local user: 'bond'.
 </SCREEN>
 </PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>x</TERM><LISTITEM><PARA>
-Message id of message obsoleted by this.
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM>v</TERM><LISTITEM><PARA>
-Log file name for verbose log (<USERINPUT>mail -v</>):
-<SCREEN>
- v ../public/v_some_magic_tmpfile
-</SCREEN>
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM>T</TERM><LISTITEM><PARA>
-Trigger scheduler to attempt delivery now. (ETRN)
-</PARA></LISTITEM></VARLISTENTRY>
-
-<VARLISTENTRY><TERM>F</TERM><LISTITEM><PARA>
-Where-from we are coming ?               
-</PARA></LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
 </PARA>
 
@@ -626,84 +776,124 @@
 </SECT2>
 </SECT1>
 
-<SECT1 ID=zapp-filefmts-scheduler-to-ta-protocol>
-<TITLE>Scheduler and Transport Agent Protocol</TITLE>
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
 
-<PARA>
-The transport agent interface follows a master-slave model,
-where the TA informs the scheduler that it is ready for the work,
-and then the scheduler sends it one job  description, and waits
-for diagnistics.
-Once the job is finished, the TA notifies the scheduler that it is
-ready for a new job.
-</PARA>
-
-<PARA>
-A short sample session looks like this:
-<SCREEN>
-<EMPHASIS>(start the transport agent)</>
-#hungry                <EMPHASIS>--&gt; (TA to scheduler)</>
-spoolid \t hostspec    <EMPHASIS>&lt;-- (scheduler to TA)</>
-diagnostics            <EMPHASIS>--&gt; (TA to scheduler)</>
-#hungry                <EMPHASIS>--&gt; (TA to scheduler)</>
-...</SCREEN></PARA>
-
-<PARA>
-Normal diagnostic output is of the form:
-<SCREEN>
-  id / offset \t notarydata \t status message
-</SCREEN>
-where:
-<VARIABLELIST>
-<VARLISTENTRY><TERM>id</TERM><LISTITEM><PARA>
-is the inode number of the message file,
-</PARA></LISTITEM></VARLISTENTRY>
+<SECT1 ID=zapp-filefmts-database-fmts>
+<TITLE>Database File Formats</TITLE>
 
-<VARLISTENTRY><TERM>offset</TERM><LISTITEM><PARA>
-is a byte offset within its control file where the address
-being  reported on  is kept,
-</PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>notarydata</TERM><LISTITEM><PARA>
-is a <EMPHASIS>Ctrl-A</> separated tuple is delivery-status-notification
-information for  the message, 
-</PARA></LISTITEM></VARLISTENTRY>
 
-<VARLISTENTRY><TERM>status</TERM><LISTITEM><PARA>
-is one of:<EMPHASIS>ok, ok2, ok3, error, error2, deferred, retryat</>
-</PARA></LISTITEM></VARLISTENTRY>
+<!-- ============================================================= -->
 
-<VARLISTENTRY><TERM>message</TERM><LISTITEM><PARA>
-is descriptive text associated with the report.
-The text is terminated by a linefeed.
-</PARA></LISTITEM></VARLISTENTRY>
-</VARIABLELIST></PARA>
+<SECT2 ID=zapp-filefmts-database-fmts-dbases.conf>
+<TITLE>The <FILENAME>dbases.conf</> file</TITLE>
 
 <PARA>
-Any other format (as might be produced by subprocesses) is passed
-to standard output for logging in the scheduler log.
-The <EMPHASIS>retryat</> response will assume the first word of the text
-is a numeric parameter, either an incremental time in seconds if prefixed
-by ``+'', or otherwise an absolute time in seconds since UNIX epoch.
-</PARA>
+Sample of <FILENAME>$<VARNAME>MAILVAR</>/db/dbases.conf</> file:
+<SCREEN>
+#|
+#|  This configuration file is used to translate a semi-vague idea
+#|  about what database sources (in what forms) are mapped together
+#|  under which lookup names, and what format they are, etc..
+#|
+#|  This is used by  'zmailer newdb'  command to generate all databases
+#|  described here, and to produce relevant  .zmsh  scripts for the
+#|  router to use things.  The  'zmailer newdb' invocation does not mandate
+#|  router restart in case the database definitions have not changed
+#|  (reverse is true:  If definitions are added/modified/removed, the router
+#|                     MUST be restarted)
+#|
+
+#|Fields:
+#|     relation-name
+#|         dbtype(,subtype)
+#|              dbpriv control data (or "-")
+#|                  newdb_compile_options (-a for aliases!)
+#|                     dbfile (or "-")
+#|                         dbflags (or "-") ... (until end of line)
+#|
+#| The  dbtype  can be "magic" '$DBTYPE', or any other valid database
+#| type for the Router.  Somewhat magic treatment (newdb runs) are
+#| done when the dbtype is any of: *DBTYPE/dbm/gdbm/ndbm/btree
+#|
+#| The "dbfile" need not be located underneath of $MAILVAR, as long as
+#| it is in system local filesystem (for performance reasons.)  E.g.
+#| one can place one of e.g. aliases files to some persons directory.
+#|
+#| At  dbflags  (until end of the line), characters ':' and '%' have special
+#| meaning as their existence generates lookup routines which pass user's
+#| optional parameters.  See documentation about 'dblookup'.
+#|
+
+#|Example:
+#|
+#|Security sensitive ones ("dbpriv" must be defined!)
+#| aliases         $DBTYPE  0:0:644    -la $MAILVAR/db/aliases        -lm
+#| aliases         $DBTYPE  root:0:644 -la $MAILVAR/db/aliases-2      -lm
+#| fqdnaliases     $DBTYPE  root:0:644 -la $MAILVAR/db/fqdnaliases    -lm
+#| userdb          $DBTYPE  root:0:644 -la $MAILVAR/db/userdb         -lm
+#|
+#|Security insensitive ones ("dbpriv" need not be defined!)
+#| fqdnaliasesldap ldap   -  -   $MAILVAR/db/fqdnalias.ldap -lm -e 2000 -s 9000
+#| fullnamemap     $DBTYPE  -    -l  $MAILVAR/db/fullnames    -lm
+#| mboxmap         $DBTYPE  -    -l  $MAILSHARE/db/mboxmap    -lm
+#| expired         $DBTYPE  -    -l  $MAILVAR/db/expiredaccts -lm
+#| iproutesdb      $DBTYPE  -    -l  $MAILVAR/db/iproutes     -lmd longestmatch
+#| routesdb        $DBTYPE  -    -l  $MAILVAR/db/routes       -lm%:d pathalias
+#| thishost        $DBTYPE  -    -l  $MAILVAR/db/localnames   -lm%d  pathalias
+#| thishost        unordered -   -   $MAILVAR/db/localnames   -ld    pathalias
+#| thishost        bind,mxlocal - -  -                        -ld    pathalias
+#| otherservers    unordered -   -   $MAILVAR/db/otherservers -lmd   pathalias
+#| newsgroup       $DBTYPE  -    -l  $MAILVAR/db/active       -lm
+
+
+aliases         $DBTYPE 0:0:644    -la $MAILVAR/db/aliases      -lm
+fqdnaliases     $DBTYPE root:0:644 -la $MAILVAR/db/fqdnaliases  -lm%
+userdb          $DBTYPE root:0:644 -la $MAILVAR/db/userdb       -lm
+
+routesdb        $DBTYPE -   -l  $MAILVAR/db/routes      -lm%:d pathalias
+thishost        $DBTYPE -   -l  $MAILVAR/db/localnames  -lm%d  pathalias
+
+#| =================================================================
+#|    Set of boilerplate tail-keepers, these lookups fail ALWAYS.
+#| These are given because if user ever removes any of the relations
+#| mentioned above, the generated "RELATIONNAME.zmsh" script won't
+#| just magically disappear!
+#| =================================================================
+
+aliases         NONE - - - -
+expired         NONE - - - -
+fqdnaliasesldap NONE - - - -
+fqdnaliases     NONE - - - -
+fullnamemap     NONE - - - -
+iproutesdb      NONE - - - -
+newsgroup       NONE - - - -
+otherservers    NONE - - - -
+routesdb        NONE - - - -
+thishost        NONE - - - -
+userdb          NONE - - - -
 
-<PARA>
-The exit status is a code from
-<FILENAME CLASS="HEADERFILE">&lt;sysexits.h&gt;</>.
+#| NOTE:  mboxmap  MUST NOT exist at all if its secondary-effects
+#|        are to be avoided!
+</SCREEN>
 </PARA>
-
-</SECT1>
 
-
-<SECT1 ID=zapp-filefmts-database-fmts>
-<TITLE>Database File Formats</TITLE>
-
+</SECT2>
 
+<!-- ============================================================= -->
 
 <SECT2 ID=zapp-filefmts-database-fmts-aliases>
 <TITLE>Aliases File</TITLE>
 
+<PARA>For relation: <LITERAL>aliases</></PARA>
 
+<PARA>Syntax of this file is simple: blank lines, and comments with ``#''
+character at column 1 are ignored, the key is non-white-space string of
+characters terminating on double-colon + whitespace
+(actually '"quoted string":' is also valid key!), rest of the line
+(and possible continuation lines) are data.
+</PARA>
+
 <SCREEN>
   postmaster: root
   postoffice: root
@@ -724,6 +914,7 @@
 
   nobody: /dev/null
   no-one: /dev/null
+  "no body": /dev/null
   junk-trap: /dev/null
 
   #test-gw: "|/..."
@@ -750,20 +941,438 @@
 </PARA>
 </SECT2>
 
+<!-- ============================================================= -->
+
 <SECT2 ID=zapp-filefmts-database-fmts-fqdnaliases>
 <TITLE>FQDNAliases File</TITLE>
-<PARA>Filler text</PARA>
+<PARA>This is syntactically alike the <FILENAME>aliases</> database
+(the double-colon + whitespace terminate the key), rest of the line
+(and possible continuation lines) are data, however it can have some
+interesting keys:
+<VARIABLELIST>
+
+<VARLISTENTRY><TERM><LITERAL>local@domain:</></TERM><LISTITEM><PARA>
+Matches given address, including possible incoming
+<LITERAL>local+tag@domain</> versions.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><LITERAL>@domain:</></TERM><LISTITEM><PARA>
+This matches all addresses with given domain.
+</PARA><PARA>
+The result data may contain ``<LITERAL>%1</>'' which is filled
+with <LITERAL>user</>
+part of the input address, example:
+<SCREEN>
+  @domain:  %1@domain2
+</SCREEN>
+It can thus be used to map e.g. <LITERAL>user@domain1</> to <LITERAL>user@domain2</>.
+</PARA></LISTITEM></VARLISTENTRY>
+
+</VARIABLELIST>
+
+The main difference with <APPLICATION>sendmail</>'s virtuser method is
+that this is generic <EMPHASIS>alias</> type mapper, e.g. it can result
+in multiple addresses going out, or programs be driven, or&hellip;
+</PARA>
 </SECT2>
 
+<!-- ============================================================= -->
+
 <SECT2 ID=zapp-filefmts-database-fmts-routes>
 <TITLE>Routes File</TITLE>
-<PARA>Filler text</PARA>
+
+<PARA>For relation: <LITERAL>routesdb</></PARA>
+
+<PARA>
+Sampling here the default boilerplate
+``<FILENAME>$<VARNAME>MAILVAR</>/db/routes</>'' file:
+
+<SCREEN>
+# Routing Configuration File
+#
+# Entries in this file are checked first by router.cf.
+# They have the form:
+#    name  channel!next_destination
+# A leading . on the name indicates that all subdomains match as well
+#
+# We have TWO different fallback lookup tags:
+#    .:ERROR  for cases where ERROR MESSAGES we generated are being routed
+#    .        for general case
+#
+# This dictomy is due to need to route everything by explicite tables,
+# EXCEPT in case of errors when '.' maps to 'error!something'
+# ("We know to whom we route, others get error report back.")
+#
+# To generate runtime BINARY database of this source, issue command:
+#   $MAILBIN/newdb $MAILSHARE/db/routes
+# or in this directory with usual configuration:
+#   ../bin/newdb routes
+#
+
+#
+#  Sample route statements (and channels):
+#
+#   .foo  error!cannedmsgfilename
+#   #       Canned error message from $MAILSHARE/forms/cannedmsgfilename
+#
+#   .bar  smtpx!
+#   #       Send all traffic destined to any subdomain under this
+#   #       suffix via "smtpx" channel to that domain
+#
+#   .bar  smtp-etrn!
+#   .bar  smtp-tls!
+#   .bar  smtp-log!
+#   .bar  smtp77!
+#   .bar  smtp77x!
+#   .bar  smtp8!
+#   .bar  smtp8x!
+#   #       Ditto
+#
+#   .bar  smtpgw-xyz!
+#   #       Drives genericish gateway function kit
+#
+#   junkdom      bitbucket!
+#   myself       local!
+#   news.domain  usenet!
+#   uunode.dom   uucp!uunode
+#
+#   # Usual ISP smart-host setup
+#   .       smtpx!ISP.smtp.gw
+#
+#   # Not so usual - fallback to error, except for error messages
+#   .:ERROR smtp!
+#   .       error!notourcustomer
+#
+</SCREEN>
+</PARA>
+</SECT2>
+
+<SECT2 ID=zapp-filefmts-database-fmts-localnames>
+<TITLE>Localnames</TITLE>
+<PARA>For relation: <LITERAL>thishost</></PARA>
+
+<PARA>FIXME! WRITEME!</PARA>
 </SECT2>
 
+<SECT2 ID=zapp-filefmts-database-fmts-otherservers>
+<TITLE>Otherservers</TITLE>
+<PARA>For relation: <LITERAL>otherservers</></PARA>
+
+<PARA>FIXME! WRITEME!</PARA>
+</SECT2>
+
+<SECT2 ID=zapp-filefmts-database-fmts-iproutes>
+<TITLE>Iproutes</TITLE>
+<PARA>For relation: <LITERAL>iproutesdb</></PARA>
+
+<PARA>FIXME! WRITEME!</PARA>
+</SECT2>
+
+
+<SECT2 ID=zapp-filefmts-database-fmts-fullnames>
+<TITLE>Fullnames</TITLE>
+<PARA>For relation: <LITERAL>fullnamemap</></PARA>
+
+<PARA>This used to be a <LITERAL>firstname.lastname</> keyed
+mapping database yielding login-ids, but these days this is
+superceded by ability to have dots in alias keys.
+</PARA><PARA>
+Example:
+<SCREEN>
+  firstname.lastname   loginid
+</SCREEN>
+</PARA>
+</SECT2>
+
+<SECT2 ID=zapp-filefmts-database-fmts-userdb>
+<TITLE>Userdb</TITLE>
+<PARA>For relation: <LITERAL>userdb</></PARA>
+<PARA>FIXME! WRITEME!</PARA>
+</SECT2>
+
+<SECT2 ID=zapp-filefmts-database-fmts-expiredaccts>
+<TITLE>Expiredaccts</TITLE>
+<PARA>For relation: <LITERAL>expired</></PARA>
+<PARA>FIXME! WRITEME!</PARA>
+</SECT2>
+
+<SECT2 ID=zapp-filefmts-database-fmts-newsgroup>
+<TITLE>Active (newsgroups)</TITLE>
+<PARA>For relation: <LITERAL>newsgroup</></PARA>
+<PARA>FIXME! WRITEME!</PARA>
+</SECT2>
+
+<SECT2 ID=zapp-filefmts-database-fmts-aliases.ldap>
+<TITLE>Aliases.ldap</TITLE>
+<PARA>For relation: <LITERAL>aliases</></PARA>
+<PARA>FIXME! WRITEME!</PARA>
+</SECT2>
+
+<SECT2 ID=zapp-filefmts-database-fmts-fqdnaliases.ldap>
+<TITLE>Fqdnaliases.ldap</TITLE>
+<PARA>For relation: <LITERAL>fqdnaliasesldap</></PARA>
+<PARA>FIXME! WRITEME!</PARA>
+</SECT2>
+
 <SECT2 ID=zapp-filefmts-database-fmts-mailbox>
 <TITLE>Mailbox File</TITLE>
-<PARA>Filler text</PARA>
+<PARA>Err... Uh.. What can be said ?  The standard UNIX mailbox ?</PARA>
+<PARA>FIXME! Or was this supposed to be the MBOXMAP thing ?</PARA>
 </SECT2>
 
+
+</SECT1>
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<SECT1 ID=zapp-filefmts-scheduler-perflog>
+<TITLE><COMMAND>Scheduler</> Statistics Log</>
+
+<PARA>
+The  statistics log reports condenced performance oriented
+information in following format:
+<INFORMALTABLE FRAME=NONE PGWIDE=0>
+<TGROUP COLS=6 ALIGN=LEFT COLSEP=0 ROWSEP=0>
+<COLSPEC ALIGN=LEFT   COLWIDTH=2>
+<COLSPEC ALIGN=LEFT   COLWIDTH=2>
+<COLSPEC ALIGN=CENTER COLWIDTH=1>
+<COLSPEC ALIGN=CENTER COLWIDTH=1>
+<COLSPEC ALIGN=LEFT   COLWIDTH=2>
+<COLSPEC ALIGN=LEFT   COLWIDTH=6>
+<THEAD>
+<ROW ROWSEP=1>
+ <ENTRY ALIGN=LEFT>timestamp</>
+ <ENTRY ALIGN=LEFT>fileid</>
+ <ENTRY ALIGN=CENTER>dt1</>
+ <ENTRY ALIGN=CENTER>dt2</>
+ <ENTRY ALIGN=LEFT>state</>
+ <ENTRY ALIGN=LEFT>$channel/$host</>
+</ROW>
+</THEAD>
+<TBODY>
+<ROW>
+ <ENTRY>812876190</>
+ <ENTRY>90401-2</>
+ <ENTRY>0</>
+ <ENTRY>5</>
+ <ENTRY>ok</>
+ <ENTRY>usenet/-</>
+</ROW>
+<ROW>
+ <ENTRY>812876228</>
+ <ENTRY>90401-1</>
+ <ENTRY>0</>
+ <ENTRY>7</>
+ <ENTRY>ok</>
+ <ENTRY>usenet/-</>
+</ROW>
+<ROW>
+ <ENTRY>812876244</>
+ <ENTRY>90401-1</>
+ <ENTRY>0</>
+ <ENTRY>1</>
+ <ENTRY>ok</>
+ <ENTRY>local/gopher-admin</>
+</ROW>
+<ROW>
+ <ENTRY>812876244</>
+ <ENTRY>90401-1</>
+ <ENTRY>0</>
+ <ENTRY>5</>
+ <ENTRY>ok</>
+ <ENTRY>smtp/funet.fi</>
+</ROW>
+<ROW>
+ <ENTRY>812876559</>
+ <ENTRY>90401-1</>
+ <ENTRY>0</>
+ <ENTRY>21</>
+ <ENTRY>ok</>
+ <ENTRY>smtp/utu.fi</>
+</ROW>
+</TBODY>
+</TGROUP>
+</INFORMALTABLE>
+</PARA>
+
+<PARA>
+Where the fields are:
+
+<VARIABLELIST>
+<VARLISTENTRY><TERM><OPTION>timestamp</></><LISTITEM><PARA>
+The original spoolfile <EMPHASIS>ctime</> (creation time) stamp in decimal.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>fileid</></><LISTITEM><PARA>
+Spoolfile name after the router has processed it.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>dt1</></><LISTITEM><PARA>
+The time difference from spoolfile ctime to 
+scheduler control file creation by the router.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>dt2</></><LISTITEM><PARA>
+The time difference from scheduler file <EMPHASIS>ctime</> to
+the delivery that is logged on.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>state</></><LISTITEM><PARA>
+What happened?  Values: ok, ok2, ok3, error, error2, expiry
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>$channel/$host</></><LISTITEM><PARA>
+Where/how it was processed.
+</PARA></LISTITEM></VARLISTENTRY>
+</VARIABLELIST>
+</PARA>
+
 </SECT1>
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<SECT1 ID=zapp-filefmts-syslogged-log-formats>
+<TITLE>Syslogged Log Formats</>
+
+<PARA>
+At <EMPHASIS>syslog</> facility the system logs also material,
+if it has so been configured.
+</PARA>
+
+<PARA>
+Different subsystems do different logs, they are described below.
+</PARA>
+
+<SECT2 ID=zapp-filefmts-syslog-from-smtpserver>
+<TITLE><COMMAND>Smtpserver</>'s Syslog Format</TITLE>
+
+<PARA>
+The <EMPHASIS>smtpserver</> may log in multiple formats:
+<VARIABLELIST>
+<VARLISTENTRY>
+<TERM>INFO: connection from ...</TERM>
+<TERM>WARN: refusing connection from ...</TERM>
+<TERM>INFO: accepted id ... into freeze..</TERM>
+<TERM>INFO: TASPID accepted from...</TERM>
+<LISTITEM><PARA>
+where TASPID: A spool-id that is valid throughout message lifetime
+in the system, and should be long-term unique, even.  (Per system.)
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY>
+<TERM>EMERG: smtpserver policy database problem...</TERM>
+<TERM>ERR:  MAILBIN unspecified in zmailer.conf</TERM>
+<LISTITEM><PARA></PARA></LISTITEM>
+</VARLISTENTRY>
+</VARIABLELIST>
+</PARA>
+
+</SECT2>
+
+<SECT2 ID=zapp-filefmts-syslog-from-router>
+<TITLE><COMMAND>Router</>'s Syslog Format</TITLE>
+
+<PARA>
+The <COMMAND>router</> does <FUNCTION>syslog</>() in following format:
+</PARA>
+
+<PARA>
+<SYNOPSIS>taspid: from=&lt;addr&gt;, rrelay=smtprelay, size=nnn, nrcpts=nnn, msgid=str, delay=xx, xdelay=xx</SYNOPSIS>
+</PARA>
+
+<PARA>
+Where:
+<VARIABLELIST>
+<VARLISTENTRY><TERM><OPTION>taspid</></><LISTITEM><PARA>
+The TA-SPOOL-ID &mdash; A spool-id that is valid throughout message lifetime
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>from=</></><LISTITEM><PARA>
+the envelope source address
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>rrelay=</></><LISTITEM><PARA>
+the message ``rcvdfrom'' envelope header reports.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>size=</></><LISTITEM><PARA>
+Total message size in bytes (envelope+headers+body)
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>nrcpts=</></><LISTITEM><PARA>
+Number of recipients for this message
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>msgid=</></><LISTITEM><PARA>
+The ``Message-ID:'' header content
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>delay=</></><LISTITEM><PARA>
+Delay from message arrival to the system to this logging moment
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>xdelay=</></><LISTITEM><PARA>
+Delay during processing &mdash; tells how much time was spent to
+process the message.
+</PARA></LISTITEM></VARLISTENTRY>
+</VARIABLELIST>
+</PARA>
+
+</SECT2>
+
+<SECT2 ID=zaapp-filefmts-syslog-from-transport-agents>
+<TITLE>Transport Agent's Syslog Format</TITLE>
+
+<PARA>
+The transport agents log in following format:
+</PARA>
+
+<PARA>
+<SYNOPSIS>taspid: to=&lt;addr&gt;, delay=dd, xdelay=xx, mailer=mm, relay=rr (wtt), stat=%s msg</SYNOPSIS>
+</PARA>
+
+<PARA>
+Here the fields are:
+<VARIABLELIST>
+<VARLISTENTRY><TERM><OPTION>taspid</></><LISTITEM><PARA>
+The ta-spool-id &mdash; A spool-id that is valid throughout message lifetime
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>to=</></><LISTITEM><PARA>
+Destination address in whatever form the transport agent uses.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>delay=</></><LISTITEM><PARA>
+Delay from message arrival to the system to this logging moment
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>xdelay=</></><LISTITEM><PARA>
+Delay during this processing attempt &mdash; tells how much time <EMPHASIS>this</>
+time was spent to process the message.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>mailer=</></><LISTITEM><PARA>
+Tells what ``channel'' was used.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>relay=</></><LISTITEM><PARA>
+Reports on which host the message is relayed thru (``wtthost''), and for
+SMTP, also (in parenthesis) what was the relay's IP address.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM><OPTION>stat=</></><LISTITEM><PARA>
+What status was achieved: ok*, delayed, failed, ...
+<EMPHASIS ROLE=BOLD>CHECK!</>
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM>msg</><LISTITEM><PARA>
+Arbitrary text line from whatever system is out there.
+</PARA></LISTITEM></VARLISTENTRY>
+</VARIABLELIST>
+</PARA>
+
+</SECT2>
+</SECT1>
+
+
 </APPENDIX>
Index: zmailer/doc/manual/zapp-rfc821.sgml
diff -u zmailer/doc/manual/zapp-rfc821.sgml:1.2 zmailer/doc/manual/zapp-rfc821.sgml:1.3
--- zmailer/doc/manual/zapp-rfc821.sgml:1.2	Fri Feb 25 01:37:00 2000
+++ zmailer/doc/manual/zapp-rfc821.sgml	Thu Mar  8 00:31:29 2001
@@ -4,4 +4,19 @@
 <PARA>
 This will contain juicy bits regarding RFC 821, the SMTP protocol.
 </PARA>
+
+
+<SECT1 ID=rfc821.from><TITLE>RFC821: "MAIL FROM:"</>
+<PARA>WRITEME! FIXME!</PARA>
+</SECT1>
+
+<SECT1 ID=rfc821.to><TITLE>RFC821: "RCPT TO:"</>
+<PARA>WRITEME! FIXME!</PARA>
+</SECT1>
+
+<SECT1 ID=rfc821.data><TITLE>RFC821: "DATA"</>
+<PARA>WRITEME! FIXME!</PARA>
+</SECT1>
+
+
 </APPENDIX>
Index: zmailer/doc/manual/zapp-rfc822.sgml
diff -u zmailer/doc/manual/zapp-rfc822.sgml:1.2 zmailer/doc/manual/zapp-rfc822.sgml:1.3
--- zmailer/doc/manual/zapp-rfc822.sgml:1.2	Fri Feb 25 01:37:00 2000
+++ zmailer/doc/manual/zapp-rfc822.sgml	Thu Mar  8 00:31:29 2001
@@ -5,4 +5,29 @@
 This will contain juicy bits regarding RFC 822, the message
 <EMPHASIS>visible</> header specification.
 </PARA>
+
+<SECT1 ID=rfc822.from><TITLE>RFC822: "From:"</>
+<PARA>WRITEME! FIXME!</PARA>
+</SECT1>
+
+<SECT1 ID=rfc822.to><TITLE>RFC822: "To:"</>
+<PARA>WRITEME! FIXME!</PARA>
+</SECT1>
+
+<SECT1 ID=rfc822.cc><TITLE>RFC822: "Cc:"</>
+<PARA>WRITEME! FIXME!</PARA>
+</SECT1>
+
+<SECT1 ID=rfc822.subject><TITLE>RFC822: "Subject:"</>
+<PARA>WRITEME! FIXME!</PARA>
+</SECT1>
+
+<SECT1 ID=rfc822.date><TITLE>RFC822: "Date:"</>
+<PARA>WRITEME! FIXME!</PARA>
+</SECT1>
+
+<SECT1 ID=rfc822.sender><TITLE>RFC822: "Sender:"</>
+<PARA>WRITEME! FIXME!</PARA>
+</SECT1>
+
 </APPENDIX>
Index: zmailer/doc/manual/zappendices.sgml
diff -u zmailer/doc/manual/zappendices.sgml:1.2 zmailer/doc/manual/zappendices.sgml:1.3
--- zmailer/doc/manual/zappendices.sgml:1.2	Mon Feb 21 03:14:23 2000
+++ zmailer/doc/manual/zappendices.sgml	Sat Feb 24 00:11:56 2001
@@ -4,12 +4,18 @@
 <!-- % \segment{zapp-scripts}{chapter}{Sample Router Configuration Scripts} -->
 <!-- \chapter{Sample Router Configuration Scripts}			-->
 &ZAPP-SCRIPTS;
+
+&ZAPP-SCHEDULER;
+
 <!-- \segment{zapp-listmgrs}{chapter}{Using ZMailer with Mailinglist Managers} -->
 &ZAPP-LISTMGRS;
+
 <!-- \segment{zapp-tragents}{chapter}{Adding new transport agents}	-->
 &ZAPP-TR-AGENTS;
+
 <!-- \segment{zapp-filefmts}{chapter}{Internal File Data Formats}	-->
 &ZAPP-FILEFMTS;
+
 <!-- \segment{zapp-ssl-lang}{chapter}{S/SL Language}			-->
 &ZAPP-SSL-LANG;
 
Index: zmailer/doc/manual/zinstall.sgml
diff -u zmailer/doc/manual/zinstall.sgml:1.18 zmailer/doc/manual/zinstall.sgml:1.22
--- zmailer/doc/manual/zinstall.sgml:1.18	Wed Feb 21 18:20:26 2001
+++ zmailer/doc/manual/zinstall.sgml	Fri May  4 14:07:41 2001
@@ -105,7 +105,7 @@
 <PARA>
 In following we refer to those often in style of:
 <SCREEN>
-  $MAILVAR   $MAILSHARE   ...
+  $MAILVAR   $MAILSHARE   &hellip;
 </SCREEN>
 Which essentially means expanding in Bourne-shell like manner given
 <EMPHASIS>ZENV-variable</> from this file.
@@ -239,8 +239,8 @@
 as system ``<COMMAND>make</>''!)
 <SCREEN>
   <PROMPT>$ </><USERINPUT>mkdir myhost ; cd myhost</>
-  <PROMPT>$ </><USERINPUT>../configure ...</>
-  <PROMPT>$ </><USERINPUT>make </>...
+  <PROMPT>$ </><USERINPUT>../configure &hellip;</>
+  <PROMPT>$ </><USERINPUT>make </>&hellip;
 </SCREEN>
 </PARA>
 
@@ -386,7 +386,7 @@
 A sort of method to quickly handle your sendmail queue is to
 start ZMailer's SMTP server, reconfigure the old sendmail to
 use smart-host, which happens to be at the same machine.
-(Or at an adjacent machine if you moved the queue, or ...)
+(Or at an adjacent machine if you moved the queue, or &hellip;)
 Anyway the point is to get the sendmail to send its queue
 via SMTP to the ZMailer.
 An equally valid option is to drain the sendmail's queue by running
@@ -482,7 +482,7 @@
 <SECT1 ID=zins.run-time-files><TITLE>Run-time files</TITLE>
 <PARA>
 This section describes the configuration in short. More detailed information 
-can be found in section FIXME! FIXME! xxxxx....
+can be found in Administration and Reference parts.
 </PARA>
 
 <SECT2 ID=zins-rtf-zmailer.conf><TITLE><FILENAME>zmailer.conf</></>
@@ -493,7 +493,7 @@
 <PARA>
 In following we refer to those often in style of:
 <SCREEN>
-  $MAILVAR   $MAILSHARE   ...
+  $MAILVAR   $MAILSHARE   &hellip;
 </SCREEN>
 Which essentially means expanding in Bourne-shell like manner given
 <EMPHASIS>ZENV-variable</> from this file.
@@ -551,7 +551,7 @@
 
 <WARNING><PARA>
 <EMPHASIS>SECURITY ITEM</>: Those users at <LITERAL>zmailer</> group
-<EMPHASIS ROLE="BOLD">must not</> contain <LITERAL>nobody</>!
+<EMPHASIS ROLE=BOLD>must not</> contain <LITERAL>nobody</>!
 </PARA><PARA>
 The <LITERAL>nobody</> is used to prevent externally given inputs from being
 able to execute arbitrary programs at the system, or from writing to
@@ -569,7 +569,7 @@
 </SCREEN>
 Indeed this isn't <EMPHASIS>quite</> mandatory, as the <COMMAND>scheduler</>
 subsystem can be configured to use different IPC socket.
-See more about this at Scheduler's PARAM entries: <XREF LINKEND="scheduler.param.entries">.
+See more about this at Scheduler's PARAM entries: <XREF LINKEND="zref-scheduler-param-entries">.
 </PARA>
 
 </SECT2>
@@ -670,15 +670,17 @@
 
 <PARA>
 You should see something like:
-<SCREEN>
-  ZMailer router (2.99.50 #4: Sun May 10 15:24:09 EEST 1998)
+<PROGRAMLISTING>
+<![CDATA[
+  ZMailer router (2.99.55 #4: Tue Feb 22 15:24:09 EET 2001)
   you@hostname:/some/path/to/src/zmailer/router
   Copyright 1992 Rayan S. Zachariassen
   Copyright 1992-2001 Matti Aarnio
-  Configured with command: 'CC='gcc -Wall' CFLAGS='-g -O' ../configure ...'
+  Configured with command: 'CC='gcc -Wall' CFLAGS='-g -O' ../configure &hellip;'
   
   z#
-</SCREEN>
+]]>
+</PROGRAMLISTING>
 </PARA>
 
 <PARA>
@@ -722,9 +724,8 @@
 </PARA>
 
 <PARA>
-This script is skeleton driver for lots of things in the ZMailer,
-including <EMPHASIS>the not so small a feat</> of acting as SysV-Init's
-init-script as well.
+This script is skeleton driver for lots of things in the ZMailer, including
+the not so small a feat of acting as SysV-Init's init-script as well.
 </PARA>
 </SECT3>
 
@@ -743,7 +744,7 @@
 <PARA>
 This configuration file is used to translate a semi-vague idea
 about what database sources (in what forms) are mapped together
-under which look-up names, and what format they are, etc..
+under which look-up names, and what format they are, etc&hellip;
 </PARA>
 
 <PARA>
@@ -758,7 +759,8 @@
 
 <PARA>
 <EMPHASIS>When you use ``<COMMAND>zmailer newdb</>'' command, you recompile
-all databases defined in the <FILENAME>dbases.conf</> file -- or if you don't
+all databases defined in the controlling configuration file
+<FILENAME>$<VARNAME>MAILVAR</>/dbases.conf</> -- or if you don't
 have that file, then all databases listed below, as creation/update of those
 are the system defaults.</EMPHASIS>
 </PARA>
@@ -829,7 +831,7 @@
 <SCREEN>
  319 aliases, longest 209 bytes, 16695 bytes total
 </SCREEN>
-exact numbers vary, of course...
+exact numbers vary, of course&hellip;
 </PARA>
 
 <PARA>
@@ -892,13 +894,13 @@
 The ``<USERINPUT>%1</>'' local part is special (and experimental, as of
 21-Feb-2001) substitution pattern where <EMPHASIS>local part (user)</>
 can be replaced into the looked up data.
-More details at <XREF LINKEND=zmshref.dblookup>,
-and at <XREF LINKEND=zmshref.relation>
+More details at <XREF LINKEND=zmshref.dblookup> (dblookup),
+and at <XREF LINKEND=zmshref.relation> (<FUNCTION>relation</> declaration).
 </PARA>
 
 <PARA>
 You may even handle just a few users for each of those domains, and then
-have the ``<FILENAME>routes</>'' entry (see above at
+have the ``<FILENAME>routes</>'' entry (see below at
 <XREF LINKEND="fig.inst.routes">) to declare something
 suitable:
 <SCREEN>
@@ -1095,11 +1097,21 @@
 Relaying policy control via ``<FILENAME>smtp-policy</>'' database.
 </PARA></LISTITEM>
 <LISTITEM><PARA>
+Optional message content analysis via ``contentfilter'' mechanism.
+</PARA></LISTITEM>
+<LISTITEM><PARA>
 Optional PAM authentication framework for SMTP AUTH extension.
 </PARA></LISTITEM>
+<LISTITEM><PARA>
+Optional externally driven program to autenticate users; command line contains username, and STDIN gets the user supplied password. 
+</PARA></LISTITEM>
 </ITEMIZEDLIST>
 </PARA>
 
+<PARA>
+See the Administration <XREF LINKEND=ZADM-SMTPSERVER> for further details.
+</PARA>
+
 <SECT2 ID=zins.smtps-smtpserver.conf-file>
 <TITLE>The ``<FILENAME>smtpserver.conf</>'', and smtp-policy databases</>
 <INDEXTERM ID=idx.build-smtpserver.conf-file><PRIMARY>smtpserver</><SECONDARY><FILENAME>smtpserver.conf</>-file</></>
@@ -1114,7 +1126,7 @@
 Basically you want to install the boilerplates and the tool scripts,
 edit them a bit, and run <COMMAND>policy-builder.sh</> script.
 For further details on this, see chapter
-<XREF LINKEND="zadm-smtpserver-policy-filtering">.
+<XREF LINKEND="zadm-smtpserver-policy-relaying">.
 </PARA>
 
 <PARA>
@@ -1161,24 +1173,24 @@
 
 <SCREEN>
  000- Lots of debug information
- ....
+ &hellip;
  220 some greeting
  <USERINPUT>EHLO foobar</>
  000- Lots of debug information
- ....
+ &hellip;
  250-local.host.name Hello foobar
  250-8BITMIME
  250-PIPELINING
- ....
+ &hellip;
  250 HELP
  <USERINPUT>MAIL FROM:&lt;&gt</>
  000- Lots of debug information
- ....
- 250 Ok ...
+ &hellip;
+ 250 Ok &hellip;
  <USERINPUT>RCPT TO:&lt;user@some.where&gt;</>
  000- Lots of debug information
- ....
- 250 Ok ...
+ &hellip;
+ 250 Ok &hellip;
 </SCREEN>
 
 <PARA>
@@ -1212,6 +1224,14 @@
 </PARA>
 
 <PARA>
+The default ``<FILENAME>scheduler.conf</>'' contains also linkage to
+``<FILENAME>scheduler.auth</>''
+(see <XREF LINKEND=zref-scheduler-scheduler.auth>), which is access-control
+for interacting with the scheduler from external programs, like
+<COMMAND>mailq</>.
+</PARA>
+
+<PARA>
 In <XREF LINKEND="fig.inst.scheduler1"> there are some salient points
 about tuning the ``<FILENAME>local</>'' channel behaviour.
 </PARA>
@@ -1262,21 +1282,40 @@
 
 <PARA>
 For more information regarding <EMPHASIS>scheduler</> configuration language,
-see <XREF LINKEND="zref.schedulerconfig">.
+see <XREF LINKEND="zref-scheduler-scheduler.conf-language">.
+</PARA>
+</SECT2>
+
+<SECT2 ID="zins.scheduler.scheduler.auth">
+<TITLE>Checking <FILENAME>scheduler.auth</> file</>
+<INDEXTERM ID=idx.zins-scheduler.auth-file.1><PRIMARY>Install</><SECONDARY><FILENAME>scheduler.auth</>-file</></>
+<INDEXTERM ID=idx.zins-scheduler.auth-file.2><PRIMARY><FILENAME>scheduler.auth</>-file</><SECONDARY>Install time checking</></>
+
+<PARA>
+Access-control to the <COMMAND>Scheduler</>'s internal state data is
+defined at file <FILENAME>scheduler.auth</>, which should be usable
+in its default form.
+</PARA>
+
+<PARA>
+For more information about this, see Administration
+<XREF LINKEND=zadm-scheduler-scheduler.auth>, and Reference
+<XREF LINKEND=zref-scheduler-scheduler.auth>.
 </PARA>
+
 </SECT2>
 
 <SECT2 ID="zins.sm.conf"><TITLE>Checking <FILENAME>sm.conf</> file</>
-<INDEXTERM ID=idx.zins-sm.conf-file><PRIMARY><FILENAME>sm.conf</>-file</></>
+<INDEXTERM ID=idx.zins-sm.conf-file><PRIMARY>Install</><SECONDARY><FILENAME>sm.conf</>-file</></>
 
 <PARA>
-For some uses the scheduler runs <COMMAND>sm</>(8) program &mdash; called
-``sendmail-like mailer''.
+For some uses the <COMMAND>scheduler</> runs <COMMAND>sm</>(8)
+program &mdash; called ``sendmail-like mailer''.
 </PARA>
 
 <PARA>
 This supports <EMPHASIS>most</> of <APPLICATION>sendmail</>'s
-<FILENAME>M</>-entry flags, at least flags with versions previous to 8.x
+<FILENAME>M</>-entry flags, at least flags with versions previous to 8.11(.0)
 </PARA>
 
 <PARA>
@@ -1327,7 +1366,10 @@
 </PARA>
 
 <PARA>
-<EMPHASIS>FIXME: FIXME: XREF to Scheduler</>
+More details at Scheduler Administration
+  <XREF LINKEND=zadm-scheduler-forms-files>,
+and at Scheduler Reference
+  <XREF LINKEND=zref-scheduler-forms-files>.
 </PARA>
 
 </SECT2>
@@ -1528,7 +1570,7 @@
 
 <VARIABLELIST TERMLENGTH="99">
 <TITLE>The following files/programs are needed on clients:</TITLE>
-<VARLISTENTRY><TERM><FILENAME>$<VARNAME>MAILVAR</>/zmailer.conf</></>
+<VARLISTENTRY><TERM><FILENAME>$<VARNAME>MAILSHARE</>/zmailer.conf</></>
 <LISTITEM><PARA>
 The $<VARNAME>MAILSERVER</> variable may be set to the mail server host's name.
 This is not required as <COMMAND>mailq</> will usually be able to discover this
@@ -1579,7 +1621,7 @@
 
 <PARA>
 <EMPHASIS>The best advice is to NOT to mount anything over NFS</>,
-but some people can't be persuaded...
+but some people can't be persuaded&hellip;
 </PARA>
 
 <PARA>
@@ -1597,12 +1639,12 @@
 <PARA>
 Often if the mail folder directory is shared, also
 one of following (depending upon the system):
-<SCREEN>
-   /usr/mail
-   /usr/spool/mail
-   /var/mail
-   /var/spool/mail
-</SCREEN>
+<SIMPLELIST>
+<MEMBER><FILENAME CLASS=DIRECTORY>/usr/mail</></>
+<MEMBER><FILENAME CLASS=DIRECTORY>/usr/spool/mail</></>
+<MEMBER><FILENAME CLASS=DIRECTORY>/var/mail</></>
+<MEMBER><FILENAME CLASS=DIRECTORY>/var/spool/mail</></>
+</SIMPLELIST>
 </PARA>
 
 </SECT1>
@@ -1617,7 +1659,7 @@
 <INDEXTERM ID=idx.zins.configure.options><PRIMARY>configure</><SECONDARY>options</></>
 
 <PARA>
-configure  options of ZMailer package, per version 2.99.50.
+configure  options of ZMailer package, per version 2.99.55.
 </PARA>
 
 <PARA>
@@ -1648,7 +1690,7 @@
 <TERM><VARNAME>CC</>="command"</>
 <TERM><VARNAME>CFLAGS</>="options"</>
 <LISTITEM><PARA>
-Obvious ones, compiler, and possible "-g -O" flags...
+Obvious ones, compiler, and possible "-g -O" flags&hellip;
 </PARA></LISTITEM></VARLISTENTRY>
 
 <VARLISTENTRY>
@@ -1660,8 +1702,8 @@
 <VARLISTENTRY>
 <TERM><VARNAME>INEWSBIN</>=/file/path</>
 <LISTITEM><PARA>
-If you want to pre-define where your `inews' program
-is &mdash; for possible use of `usenet' channel.
+If you want to pre-define where your ``<EMPHASIS ROLE=STRONG>inews</>'' program
+is &mdash; for possible use of ``<EMPHASIS ROLE=STRONG>usenet</>'' channel.
 </PARA></LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
 
@@ -1740,6 +1782,17 @@
 </PARA></LISTITEM></VARLISTENTRY>
 
 <VARLISTENTRY>
+<TERM><OPTION>&dd;with-zconfig-noload</OPTION></TERM>
+<LISTITEM><PARA>
+Without this option the configuration will load ZENV variable values
+from possibly existing <ENVAR>ZCONFIG</> file.
+</PARA>
+
+<PARA>
+Default: values will be preloaded without this option.
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY>
 <TERM><OPTION>&dd;with-mailbox=/DIR/PATH</OPTION></TERM>
 <LISTITEM><PARA>
 Overrides system-dependent location of the user mail-boxes.
@@ -1792,7 +1845,7 @@
 <VARLISTENTRY>
 <TERM><OPTION>&dd;with-nntpserver=HOST</OPTION></TERM>
 <LISTITEM><PARA>
-If you want to use ``<COMMAND>usenet</>'' channel, you need to name
+If you want to use ``<EMPHASIS ROLE=STRONG>usenet</>'' channel, you need to name
 NNTP server into which you feed news with NNTP.
 </PARA></LISTITEM></VARLISTENTRY>
 
@@ -1909,11 +1962,11 @@
 doing   <FUNCTION>fsync</>()  is wasteful.  This disables
 <FUNCTION>fsync</>() in cases where it is not needed.
 (In others it may boost your system performance by about 20% &mdash;
- with dangers..
+ with dangers&hellip;
 On the other hand, once a system disk(?) fault which hang mailer at
 spool directory access did cause severe damage all over, and probably
-use of this option would not have made any difference..
- <COMMAND>fsck</> was mighty unhappy..)
+use of this option would not have made any difference;
+ <COMMAND>fsck</> was mighty unhappy.)
 </PARA></LISTITEM></VARLISTENTRY>
 
 <VARLISTENTRY>
@@ -1946,7 +1999,7 @@
 <LISTITEM><PARA>
 Don't use <FUNCTION>maillock</>(3) even if system has it.
 (Solaris <FUNCTION>maillock</>(3) is ok, some early Linux
- versions weren't..)
+ versions weren't&hellip;)
 </PARA></LISTITEM></VARLISTENTRY>
 
 <VARLISTENTRY>
@@ -2087,6 +2140,15 @@
 
 <CHAPTER ID=ch.zins.verification><?dbhtml filename="zins-verification.html">
 <TITLE>Verifying the System</TITLE>
+
+<PARA>
+FIXME! FIXME! <EMPHASIS> TO BE WRITTEN !</>
+</PARA>
+
+</CHAPTER>
+
+<CHAPTER ID=installing-whoson-service><?dbhtml filename="zins-whoson.html">
+<TITLE>Installing Whoson Service</TITLE>
 
 <PARA>
 FIXME! FIXME! <EMPHASIS> TO BE WRITTEN !</>
Index: zmailer/doc/manual/zmanual.dsl
diff -u zmailer/doc/manual/zmanual.dsl:1.8 zmailer/doc/manual/zmanual.dsl:1.10
--- zmailer/doc/manual/zmanual.dsl:1.8	Tue Feb 20 18:51:30 2001
+++ zmailer/doc/manual/zmanual.dsl	Thu Mar  8 00:31:29 2001
@@ -8,21 +8,21 @@
 <!ENTITY % GEXT "gif">
 <!ENTITY % print "IGNORE">
 <!ENTITY % pdf   "IGNORE">
-<!ENTITY docbook.dsl SYSTEM "/usr/lib/sgml/stylesheets/nwalsh-modular/html/docbook.dsl" CDATA dsssl>
+<!ENTITY docbook.dsl SYSTEM "/usr/share/sgml/docbook/dsssl-stylesheets/html/docbook.dsl" CDATA dsssl>
 ]]>
 <!ENTITY % print "INCLUDE">
 <![%print;[
 <!ENTITY % GEXT "eps">
 <!ENTITY % html  "IGNORE">
 <!ENTITY % pdf   "IGNORE">
-<!ENTITY docbook.dsl SYSTEM "/usr/lib/sgml/stylesheets/nwalsh-modular/print/docbook.dsl" CDATA dsssl>
+<!ENTITY docbook.dsl SYSTEM "/usr/share/sgml/docbook/dsssl-stylesheets/print/docbook.dsl" CDATA dsssl>
 ]]>
 <!ENTITY % pdf "INCLUDE">
 <![%print;[
 <!ENTITY % GEXT "pdf">
 <!ENTITY % html  "IGNORE">
 <!ENTITY % print "IGNORE">
-<!ENTITY docbook.dsl SYSTEM "/usr/lib/sgml/stylesheets/nwalsh-modular/print/docbook.dsl" CDATA dsssl>
+<!ENTITY docbook.dsl SYSTEM "/usr/share/sgml/docbook/dsssl-stylesheets/print/docbook.dsl" CDATA dsssl>
 ]]>
 ]>
 
@@ -30,9 +30,9 @@
 <style-specification id="pdf" use="docbook">
 <style-specification-body> 
 
-;; ====================
-;; customize the PDF stylesheet
-;; ====================
+;; ================================
+;;   customize the PDF stylesheet
+;; ================================
 
 ;; this is necessary because right now jadetex does not understand
 ;; symbolic entities, whereas things work well with numeric entities.
@@ -129,9 +129,9 @@
 <style-specification id="print" use="docbook">
 <style-specification-body> 
 
-;; ====================
-;; customize the print stylesheet
-;; ====================
+;; ================================
+;;  customize the PRINT stylesheet
+;; ================================
 
 
 
@@ -220,9 +220,9 @@
 <style-specification id="html" use="docbook">
 <style-specification-body> 
 
-;; ====================
-;; customize the html stylesheet here
-;; ====================
+;; ===============================
+;;  customize the HTML stylesheet 
+;; ===============================
 
 ;;
 ;; No breaking at top-most SECTION levels, only at CHAPTER and alike.
@@ -246,6 +246,11 @@
         (normalize "set")  ;; sets are definitely chunks...
         ))
 
+
+(define (chunk-section-depth)
+  99)
+
+
 ;;
 ;; Redefine TOC-DEPTH for HTML so TOC will contain more of sublevel data
 ;; Default limit level for PRINT mode is 7 ...
@@ -257,8 +262,43 @@
 ;;      1))
 
 ;; Returns the depth of auto TOC that should be made at the nd-level
-(define (toc-depth nd)
-  99)
+(define (toc-depth nd)  99)
+(define chapter-toc?    #t)
+(define %force-chapter-toc% #t)
+
+(define %admon-graphics%
+  ;; REFENTRY admon-graphics
+  ;; PURP Use graphics in admonitions?
+  ;; DESC
+  ;; If true, admonitions are presented in an alternate style that uses
+  ;; a graphic.  Default graphics are provided in the distribution.
+  ;; /DESC
+  ;; AUTHOR N/A
+  ;; /REFENTRY
+  #t)
+
+(define %admon-graphics-path%
+  ;; REFENTRY admon-graphics-path
+  ;; PURP Path to admonition graphics
+  ;; DESC
+  ;; Sets the path, probably relative to the directory where the HTML
+  ;; files are created, to the admonition graphics.
+  ;; /DESC
+  ;; AUTHOR N/A
+  ;; /REFENTRY
+  "stylesheet-images/")
+
+
+(define %indent-synopsis-lines% 
+  ;; REFENTRY indent-synopsis-lines
+  ;; PURP Indent lines in a 'Synopsis'?
+  ;; DESC
+  ;; If not '#f', each line in the display will be indented
+  ;; with the content of this variable.  Usually it is set to some number
+  ;; of spaces, but you can indent with any string you wish.
+  ;; /DESC
+  ;; /REFENTRY
+  #f)
 
 
 (define %hyphenation%
@@ -286,6 +326,18 @@
   ;; Place elements on title page in document order?
   #t)
 
+(element sbr 
+  ;;
+  ;;  SBR  processor making explicite indention for following line
+  ;;
+  (make sequence
+    (make empty-element gi: "BR")
+    (make element gi: "CODE"
+	  (make entity-ref name: "nbsp")
+	  (make entity-ref name: "nbsp")
+	  (make entity-ref name: "nbsp")
+	  (make entity-ref name: "nbsp"))))
+
 
 (define (dingbat usrname)
   ;; Print dingbats and other characters selected by name
@@ -302,6 +354,8 @@
       ;; Straight out of Unicode
       (("ldquo")                "\"")
       (("rdquo")                "\"")
+      (("ldquor")               "``")
+      (("rdquor")               "''")
       (("lsquo")                "'")
       (("rsquo")                "'")
       (("en-dash")              "-")
Index: zmailer/doc/manual/zmanual.sgml
diff -u zmailer/doc/manual/zmanual.sgml:1.13 zmailer/doc/manual/zmanual.sgml:1.17
--- zmailer/doc/manual/zmanual.sgml:1.13	Wed Feb 14 19:05:27 2001
+++ zmailer/doc/manual/zmanual.sgml	Tue Apr  3 14:30:03 2001
@@ -12,7 +12,7 @@
 <!ENTITY % local.notation.class "| PDF">
 <!NOTATION PDF SYSTEM "PDF">
 
-<!ENTITY ZManVersion     "v1.99.21">
+<!ENTITY ZManVersion     SYSTEM "z-version.txt">
 
 <!-- double-dash -->
 <!ENTITY ddash    SDATA "[ddash]"    -- Double-Dash for ZMailer docs       -->
@@ -36,7 +36,7 @@
 <!ENTITY ZADM-SMTPSERVER SYSTEM "zadm-smtpserver.sgml">
 <!ENTITY ZADM-ROUTER     SYSTEM "zadm-router.sgml">
 <!ENTITY ZADM-SCHEDULER  SYSTEM "zadm-scheduler.sgml">
-<!ENTITY ZADM-SM         SYSTEM "zadm-sm.sgml">
+<!ENTITY ZADM-TR-AGENTS  SYSTEM "zadm-transport-agents.sgml">
 <!ENTITY ZADM-LOGGING    SYSTEM "zadm-logging.sgml">
 
 <!ENTITY ZREFERENCE      SYSTEM "zreference.sgml">
@@ -51,6 +51,7 @@
 
 <!ENTITY ZAPPENDICES     SYSTEM "zappendices.sgml">
 <!ENTITY ZAPP-SCRIPTS    SYSTEM "zapp-scripts.sgml">
+<!ENTITY ZAPP-SCHEDULER  SYSTEM "zapp-scheduler.sgml">
 <!ENTITY ZAPP-LISTMGRS   SYSTEM "zapp-listmgrs.sgml">
 <!ENTITY ZAPP-TR-AGENTS  SYSTEM "zapp-tragents.sgml">
 <!ENTITY ZAPP-FILEFMTS   SYSTEM "zapp-filefmts.sgml">
Index: zmailer/doc/manual/zmdirs.fig
diff -u zmailer/doc/manual/zmdirs.fig:1.1 zmailer/doc/manual/zmdirs.fig:1.2
--- zmailer/doc/manual/zmdirs.fig:1.1	Wed May 13 00:41:21 1998
+++ zmailer/doc/manual/zmdirs.fig	Sat Feb 24 00:11:56 2001
@@ -31,7 +31,6 @@
 	 5040 4050 5805 4455 5895 5850 5715 6840 4995 7065
 	 0.000 1.000 1.000 1.000 0.000
 4 0 -1 0 0 18 20 0.0000 4 270 2985 1125 1800 $POSTOFFICE/public/\001
-4 0 -1 0 0 18 24 0.0000 4 285 3345 3150 675 ZMailer directories\001
 4 0 -1 0 0 18 20 0.0000 4 240 2955 1125 3375 $POSTOFFICE/router/\001
 4 0 -1 0 0 18 20 0.0000 4 270 2985 1125 4950 $POSTOFFICE/queue/\001
 4 0 -1 0 0 18 20 0.0000 4 270 3390 1125 6525 $POSTOFFICE/transport/\001
Index: zmailer/doc/manual/zmnewsched1.fig
diff -u zmailer/doc/manual/zmnewsched1.fig:1.1 zmailer/doc/manual/zmnewsched1.fig:1.2
--- zmailer/doc/manual/zmnewsched1.fig:1.1	Wed May 13 00:41:21 1998
+++ zmailer/doc/manual/zmnewsched1.fig	Thu Mar  8 00:31:29 2001
@@ -216,25 +216,6 @@
 	0 0 1.00 60.00 120.00
 	 7799 3075 7724 4200 7724 4725
 	 0.000 -1.000 0.000
-3 2 0 1 -1 7 0 0 -1 0.000 0 1 0 8
-	0 0 1.00 60.00 120.00
-	 9224 2625 9674 2400 9599 2175 8924 2100 1949 2100 1649 2175
-	 1649 2475 1874 2550
-	 0.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 0.000
-3 2 0 1 -1 7 0 0 -1 0.000 0 1 0 10
-	0 0 1.00 60.00 120.00
-	 1874 2775 1649 2775 1499 3000 1649 3225 1949 3300 9149 3300
-	 9449 3300 9599 3150 9524 2925 9299 2850
-	 0.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000
-	 -1.000 0.000
-3 2 0 1 -1 7 0 0 -1 0.000 0 1 0 6
-	0 0 1.00 60.00 120.00
-	 7424 4725 7049 4425 7199 3975 8699 3975 9074 4275 8699 4725
-	 0.000 -1.000 -1.000 -1.000 -1.000 0.000
-3 2 0 1 -1 7 0 0 -1 0.000 0 1 0 6
-	0 0 1.00 60.00 120.00
-	 8549 4725 8924 4275 8549 4050 7274 4050 7124 4425 7424 4650
-	 0.000 -1.000 -1.000 -1.000 -1.000 0.000
 3 2 0 1 -1 7 0 0 -1 0.000 0 1 0 3
 	0 0 1.00 60.00 120.00
 	 8549 5250 9299 5400 9899 5925
@@ -279,18 +260,6 @@
 	0 0 1.00 60.00 120.00
 	 3224 4800 3974 4725 4574 4800
 	 0.000 -1.000 0.000
-3 2 0 1 -1 7 0 0 -1 0.000 0 1 0 9
-	0 0 1.00 60.00 120.00
-	 5924 4800 6149 4800 6374 4575 6224 4275 4049 4125 1874 4200
-	 1649 4575 1724 4800 1874 4875
-	 0.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000
-	 0.000
-3 2 0 1 -1 7 0 0 -1 0.000 0 1 0 9
-	0 0 1.00 60.00 120.00
-	 1949 4800 1799 4725 1724 4500 2099 4200 4124 4200 5924 4275
-	 6224 4425 6224 4650 5924 4725
-	 0.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000
-	 0.000
 3 2 0 1 -1 7 0 0 -1 0.000 0 1 0 3
 	0 0 1.00 60.00 120.00
 	 4574 4725 3899 4650 3224 4725
@@ -307,8 +276,40 @@
 	0 0 1.00 60.00 120.00
 	 1949 5251 1274 5251 1274 5401
 	 0.000 1.000 0.000
+3 0 0 1 -1 7 0 0 -1 0.000 0 1 0 10
+	0 0 1.00 60.00 120.00
+	 1874 2775 1649 2775 1499 3000 1649 3225 1949 3300 9149 3300
+	 9449 3300 9599 3150 9524 2925 9299 2850
+	 0.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+	 1.000 0.000
+3 0 0 1 -1 7 0 0 -1 0.000 0 1 0 7
+	0 0 1.00 60.00 120.00
+	 9224 2625 9674 2400 9599 2175 8924 2100 1125 2025 1649 2475
+	 1874 2550
+	 0.000 1.000 1.000 1.000 1.000 1.000 0.000
+3 0 0 1 -1 7 0 0 -1 0.000 0 1 0 9
+	0 0 1.00 60.00 120.00
+	 1949 4800 1799 4725 1724 4500 2099 4200 4124 4200 5924 4275
+	 6224 4425 6224 4650 5924 4725
+	 0.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+	 0.000
+3 0 0 1 -1 7 0 0 -1 0.000 0 1 0 9
+	0 0 1.00 60.00 120.00
+	 5924 4800 6149 4800 6374 4575 6224 4275 4049 4125 1874 4200
+	 1649 4575 1724 4800 1874 4875
+	 0.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+	 0.000
+3 0 0 1 -1 7 0 0 -1 0.000 0 1 0 6
+	0 0 1.00 60.00 120.00
+	 8549 4725 8924 4275 8549 4050 7274 4050 7124 4425 7424 4650
+	 0.000 1.000 1.000 1.000 1.000 0.000
+3 0 0 1 -1 7 0 0 -1 0.000 0 1 0 6
+	0 0 1.00 60.00 120.00
+	 7424 4725 7049 4425 7199 3975 8699 3975 9074 4275 8699 4725
+	 0.000 1.000 1.000 1.000 1.000 0.000
 4 0 -1 0 0 18 20 0.0000 4 270 1320 749 1800 Thrg_root\001
 4 0 -1 0 0 18 20 0.0000 4 210 645 9599 6450 Proc\001
-4 0 -1 0 0 18 20 0.0000 4 210 5055 2324 900 ZMailer-3.0 Scheduler datastructures\001
 4 0 -1 0 0 18 20 0.0000 4 270 1770 299 3825 Thread_head\001
 4 0 -1 0 0 18 20 0.0000 4 270 1500 10049 4125 Thread_tail\001
+4 0 -1 0 0 18 20 0.0000 4 210 5205 2324 900 ZMailer-2.99 Scheduler datastructures\001
+4 0 0 50 0 0 12 0.0000 4 135 810 3975 1200 Circa 1998\001
Index: zmailer/doc/manual/zmprocs-router.fig
diff -u /dev/null zmailer/doc/manual/zmprocs-router.fig:1.2
--- /dev/null	Tue May  8 16:00:10 2001
+++ zmailer/doc/manual/zmprocs-router.fig	Thu Mar  8 00:31:29 2001
@@ -0,0 +1,123 @@
+#FIG 3.2
+Landscape
+Center
+Metric
+A4      
+100.00
+Single
+-2
+1200 2
+6 450 585 1570 1705
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 790 970 135 135 790 970 925 970
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 1240 970 135 135 1240 970 1375 970
+1 3 0 5 0 7 0 0 -1 0.000 1 0.0000 790 1015 10 10 790 1015 800 1015
+1 3 0 5 0 7 0 0 -1 0.000 1 0.0000 1240 1015 10 10 1240 1015 1250 1015
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 1010 1145 560 560 1010 1145 1570 1135
+3 2 0 3 0 7 0 0 -1 0.000 0 0 0 3
+	 655 1195 790 1420 1015 1420
+	 0.000 -1.000 0.000
+3 2 0 3 0 7 0 0 -1 0.000 0 0 0 3
+	 1375 1195 1240 1420 1015 1420
+	 0.000 -1.000 0.000
+-6
+6 450 7065 1570 8185
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 790 7450 135 135 790 7450 925 7450
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 1240 7450 135 135 1240 7450 1375 7450
+1 3 0 5 0 7 0 0 -1 0.000 1 0.0000 790 7495 10 10 790 7495 800 7495
+1 3 0 5 0 7 0 0 -1 0.000 1 0.0000 1240 7495 10 10 1240 7495 1250 7495
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 1010 7625 560 560 1010 7625 1570 7615
+3 2 0 3 0 7 0 0 -1 0.000 0 0 0 3
+	 655 7675 790 7900 1015 7900
+	 0.000 -1.000 0.000
+3 2 0 3 0 7 0 0 -1 0.000 0 0 0 3
+	 1375 7675 1240 7900 1015 7900
+	 0.000 -1.000 0.000
+-6
+6 2430 2475 4500 3420
+2 4 0 2 0 7 10 0 16 0.000 0 0 7 0 0 5
+	 4365 3285 2565 3285 2565 2610 4365 2610 4365 3285
+2 4 0 2 0 7 20 0 16 0.000 0 0 7 0 0 5
+	 4455 3195 2655 3195 2655 2520 4455 2520 4455 3195
+2 4 0 2 0 7 5 0 18 0.000 0 0 7 0 0 5
+	 4275 3375 2475 3375 2475 2700 4275 2700 4275 3375
+4 0 0 0 0 0 16 0.0000 4 210 915 2925 3105 Router(s)\001
+-6
+2 4 1 1 0 7 0 0 -1 4.000 0 0 12 0 0 5
+	 7425 675 7425 1800 5625 1800 5625 675 7425 675
+2 4 1 1 0 7 0 0 -1 4.000 0 0 12 0 0 5
+	 7425 2250 7425 3600 5625 3600 5625 2250 7425 2250
+2 4 0 2 0 7 0 0 -1 6.000 0 0 7 0 0 5
+	 4275 2025 4275 1350 2475 1350 2475 2025 4275 2025
+2 4 0 2 0 7 0 0 -1 6.000 0 0 7 0 0 5
+	 4275 900 4275 225 2475 225 2475 900 4275 900
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 1575 900 2475 585
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 1575 1350 2475 1665
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 4275 675 5625 1125
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 4275 1575 5625 1350
+2 4 0 2 0 7 0 0 -1 6.000 0 0 7 0 0 5
+	 4275 4950 4275 4275 2475 4275 2475 4950 4275 4950
+2 4 0 2 0 7 10 0 20 0.000 0 0 7 0 0 5
+	 4815 6660 3015 6660 3015 5985 4815 5985 4815 6660
+2 4 0 2 0 7 20 0 20 0.000 0 0 7 0 0 5
+	 4905 6570 3105 6570 3105 5895 4905 5895 4905 6570
+2 4 0 2 0 7 5 0 20 0.000 0 0 7 0 0 5
+	 4725 6750 2925 6750 2925 6075 4725 6075 4725 6750
+2 1 0 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 3600 4950 4365 5895
+2 1 0 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 3375 4950 4050 5985
+2 1 0 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 3150 4950 3600 6075
+2 4 1 1 0 7 0 0 -1 4.000 0 0 12 0 0 5
+	 7425 4500 7425 6300 5625 6300 5625 4500 7425 4500
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 1 2
+	0 0 2.00 120.00 240.00
+	0 0 2.00 120.00 240.00
+	 4950 6300 5805 5985
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 1 2
+	0 0 2.00 120.00 240.00
+	0 0 2.00 120.00 240.00
+	 4320 4635 5760 5130
+2 4 1 2 0 7 0 0 -1 6.000 0 0 12 0 0 5
+	 4050 8100 4050 7200 2250 7200 2250 8100 4050 8100
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 2250 7650 1620 7650
+3 2 1 2 0 7 0 0 -1 6.000 0 1 1 2
+	0 0 2.00 120.00 240.00
+	0 0 2.00 120.00 240.00
+	 4500 2925 5760 2925
+	 0.000 0.000
+3 0 1 2 0 7 0 0 -1 6.000 0 1 0 5
+	0 0 2.00 120.00 240.00
+	 4950 6570 5625 6930 5625 7515 4950 7875 4140 7785
+	 0.000 1.000 1.000 1.000 0.000
+3 0 1 2 0 7 0 0 -1 6.000 0 1 0 4
+	0 0 2.00 120.00 240.00
+	 5850 3195 5490 3555 5490 4635 5850 4950
+	 0.000 1.000 1.000 0.000
+3 0 1 2 0 7 0 0 -1 6.000 0 1 0 4
+	0 0 2.00 120.00 240.00
+	 5850 1575 5490 1935 5490 2340 5850 2700
+	 0.000 1.000 1.000 0.000
+4 0 0 0 0 0 16 0.0000 4 210 1080 2880 1755 smtpserver\001
+4 0 0 0 0 0 16 0.0000 4 165 1185 2835 630 ``sendmail''\001
+4 0 0 0 0 0 16 0.0000 4 225 1500 5895 3015 Router spool(s)\001
+4 0 0 0 0 0 16 0.0000 4 225 1245 3195 6480 Transporters\001
+4 0 0 0 0 0 16 0.0000 4 165 975 2925 4680 Scheduler\001
+4 0 0 0 0 0 16 0.0000 4 165 1080 4095 5355 Command \001
+4 0 0 0 0 0 16 0.0000 4 225 510 4320 5625 pipes\001
+4 0 0 0 0 0 16 0.0000 4 225 1545 5760 5580 Transport spool\001
+4 0 0 0 0 0 16 0.0000 4 225 1095 5985 1305 Input spool\001
+4 0 0 0 0 0 16 0.0000 4 165 840 2610 7740 Mailbox\001
Index: zmailer/doc/manual/zmprocs-scheduler.fig
diff -u /dev/null zmailer/doc/manual/zmprocs-scheduler.fig:1.2
--- /dev/null	Tue May  8 16:00:10 2001
+++ zmailer/doc/manual/zmprocs-scheduler.fig	Thu Mar  8 00:31:29 2001
@@ -0,0 +1,128 @@
+#FIG 3.2
+Landscape
+Center
+Metric
+A4      
+100.00
+Single
+-2
+1200 2
+6 2430 2475 4500 3420
+2 4 0 2 0 7 10 0 20 0.000 0 0 7 0 0 5
+	 4365 3285 2565 3285 2565 2610 4365 2610 4365 3285
+2 4 0 2 0 7 20 0 20 0.000 0 0 7 0 0 5
+	 4455 3195 2655 3195 2655 2520 4455 2520 4455 3195
+2 4 0 2 0 7 5 0 20 0.000 0 0 7 0 0 5
+	 4275 3375 2475 3375 2475 2700 4275 2700 4275 3375
+4 0 0 0 0 0 16 0.0000 4 210 915 2925 3105 Router(s)\001
+-6
+6 450 585 1570 1705
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 790 970 135 135 790 970 925 970
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 1240 970 135 135 1240 970 1375 970
+1 3 0 5 0 7 0 0 -1 0.000 1 0.0000 790 1015 10 10 790 1015 800 1015
+1 3 0 5 0 7 0 0 -1 0.000 1 0.0000 1240 1015 10 10 1240 1015 1250 1015
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 1010 1145 560 560 1010 1145 1570 1135
+3 2 0 3 0 7 0 0 -1 0.000 0 0 0 3
+	 655 1195 790 1420 1015 1420
+	 0.000 -1.000 0.000
+3 2 0 3 0 7 0 0 -1 0.000 0 0 0 3
+	 1375 1195 1240 1420 1015 1420
+	 0.000 -1.000 0.000
+-6
+6 450 7065 1570 8185
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 790 7450 135 135 790 7450 925 7450
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 1240 7450 135 135 1240 7450 1375 7450
+1 3 0 5 0 7 0 0 -1 0.000 1 0.0000 790 7495 10 10 790 7495 800 7495
+1 3 0 5 0 7 0 0 -1 0.000 1 0.0000 1240 7495 10 10 1240 7495 1250 7495
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 1010 7625 560 560 1010 7625 1570 7615
+3 2 0 3 0 7 0 0 -1 0.000 0 0 0 3
+	 655 7675 790 7900 1015 7900
+	 0.000 -1.000 0.000
+3 2 0 3 0 7 0 0 -1 0.000 0 0 0 3
+	 1375 7675 1240 7900 1015 7900
+	 0.000 -1.000 0.000
+-6
+2 4 1 1 0 7 0 0 -1 4.000 0 0 12 0 0 5
+	 7425 675 7425 1800 5625 1800 5625 675 7425 675
+2 4 1 1 0 7 0 0 -1 4.000 0 0 12 0 0 5
+	 7425 2250 7425 3600 5625 3600 5625 2250 7425 2250
+2 4 0 2 0 7 0 0 -1 6.000 0 0 7 0 0 5
+	 4275 2025 4275 1350 2475 1350 2475 2025 4275 2025
+2 4 0 2 0 7 0 0 -1 6.000 0 0 7 0 0 5
+	 4275 900 4275 225 2475 225 2475 900 4275 900
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 1575 900 2475 585
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 1575 1350 2475 1665
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 4275 675 5625 1125
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 4275 1575 5625 1350
+2 4 0 2 0 7 5 0 18 0.000 0 0 7 0 0 5
+	 4275 4950 2475 4950 2475 4275 4275 4275 4275 4950
+2 4 0 2 0 7 10 0 20 0.000 0 0 7 0 0 5
+	 4815 6660 3015 6660 3015 5985 4815 5985 4815 6660
+2 4 0 2 0 7 20 0 20 0.000 0 0 7 0 0 5
+	 4905 6570 3105 6570 3105 5895 4905 5895 4905 6570
+2 4 0 2 0 7 5 0 20 0.000 0 0 7 0 0 5
+	 4725 6750 2925 6750 2925 6075 4725 6075 4725 6750
+2 1 0 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 3600 4950 4365 5895
+2 1 0 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 3375 4950 4050 5985
+2 1 0 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 3150 4950 3600 6075
+2 4 1 1 0 7 0 0 -1 4.000 0 0 12 0 0 5
+	 7425 4500 7425 6300 5625 6300 5625 4500 7425 4500
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 1 2
+	0 0 2.00 120.00 240.00
+	0 0 2.00 120.00 240.00
+	 4950 6300 5805 5985
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 1 2
+	0 0 2.00 120.00 240.00
+	0 0 2.00 120.00 240.00
+	 4320 4635 5760 5130
+2 4 1 2 0 7 0 0 -1 6.000 0 0 12 0 0 5
+	 4050 8100 4050 7200 2250 7200 2250 8100 4050 8100
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 2250 7650 1620 7650
+3 2 1 2 0 7 0 0 -1 6.000 0 1 1 2
+	0 0 2.00 120.00 240.00
+	0 0 2.00 120.00 240.00
+	 4500 2925 5760 2925
+	 0.000 0.000
+3 0 1 2 0 7 0 0 -1 6.000 0 1 0 5
+	0 0 2.00 120.00 240.00
+	 4950 6570 5625 6930 5625 7515 4950 7875 4140 7785
+	 0.000 1.000 1.000 1.000 0.000
+3 0 1 2 0 7 0 0 -1 6.000 0 1 0 4
+	0 0 2.00 120.00 240.00
+	 5850 3195 5490 3555 5490 4635 5850 4950
+	 0.000 1.000 1.000 0.000
+3 0 1 2 0 7 0 0 -1 6.000 0 1 0 4
+	0 0 2.00 120.00 240.00
+	 5850 1575 5490 1935 5490 2340 5850 2700
+	 0.000 1.000 1.000 0.000
+3 0 1 1 0 7 50 0 -1 4.000 0 1 0 6
+	0 0 1.00 60.00 120.00
+	 2475 4410 1980 3915 1980 2655 2250 2250 4770 2475 5625 1620
+	 0.000 1.000 1.000 1.000 1.000 0.000
+4 0 0 0 0 0 16 0.0000 4 210 1080 2880 1755 smtpserver\001
+4 0 0 0 0 0 16 0.0000 4 165 1185 2835 630 ``sendmail''\001
+4 0 0 0 0 0 16 0.0000 4 225 1500 5895 3015 Router spool(s)\001
+4 0 0 0 0 0 16 0.0000 4 225 1245 3195 6480 Transporters\001
+4 0 0 0 0 0 16 0.0000 4 165 975 2925 4680 Scheduler\001
+4 0 0 0 0 0 16 0.0000 4 165 1080 4095 5355 Command \001
+4 0 0 0 0 0 16 0.0000 4 225 510 4320 5625 pipes\001
+4 0 0 0 0 0 16 0.0000 4 225 1545 5760 5580 Transport spool\001
+4 0 0 0 0 0 16 0.0000 4 225 1095 5985 1305 Input spool\001
+4 0 0 0 0 0 16 0.0000 4 165 840 2610 7740 Mailbox\001
+4 0 0 50 0 0 16 1.5708 4 225 1815 1890 4500 Diagnostic Emails\001
Index: zmailer/doc/manual/zmprocs-smtps.fig
diff -u /dev/null zmailer/doc/manual/zmprocs-smtps.fig:1.1
--- /dev/null	Tue May  8 16:00:10 2001
+++ zmailer/doc/manual/zmprocs-smtps.fig	Mon Feb 26 19:42:00 2001
@@ -0,0 +1,123 @@
+#FIG 3.2
+Landscape
+Center
+Metric
+A4      
+100.00
+Single
+-2
+1200 2
+6 2430 2475 4500 3420
+2 4 0 2 0 7 10 0 20 0.000 0 0 7 0 0 5
+	 4365 3285 2565 3285 2565 2610 4365 2610 4365 3285
+2 4 0 2 0 7 20 0 20 0.000 0 0 7 0 0 5
+	 4455 3195 2655 3195 2655 2520 4455 2520 4455 3195
+2 4 0 2 0 7 5 0 20 0.000 0 0 7 0 0 5
+	 4275 3375 2475 3375 2475 2700 4275 2700 4275 3375
+4 0 0 0 0 0 16 0.0000 4 210 915 2925 3105 Router(s)\001
+-6
+6 450 585 1570 1705
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 790 970 135 135 790 970 925 970
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 1240 970 135 135 1240 970 1375 970
+1 3 0 5 0 7 0 0 -1 0.000 1 0.0000 790 1015 10 10 790 1015 800 1015
+1 3 0 5 0 7 0 0 -1 0.000 1 0.0000 1240 1015 10 10 1240 1015 1250 1015
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 1010 1145 560 560 1010 1145 1570 1135
+3 2 0 3 0 7 0 0 -1 0.000 0 0 0 3
+	 655 1195 790 1420 1015 1420
+	 0.000 -1.000 0.000
+3 2 0 3 0 7 0 0 -1 0.000 0 0 0 3
+	 1375 1195 1240 1420 1015 1420
+	 0.000 -1.000 0.000
+-6
+6 450 7065 1570 8185
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 790 7450 135 135 790 7450 925 7450
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 1240 7450 135 135 1240 7450 1375 7450
+1 3 0 5 0 7 0 0 -1 0.000 1 0.0000 790 7495 10 10 790 7495 800 7495
+1 3 0 5 0 7 0 0 -1 0.000 1 0.0000 1240 7495 10 10 1240 7495 1250 7495
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 1010 7625 560 560 1010 7625 1570 7615
+3 2 0 3 0 7 0 0 -1 0.000 0 0 0 3
+	 655 7675 790 7900 1015 7900
+	 0.000 -1.000 0.000
+3 2 0 3 0 7 0 0 -1 0.000 0 0 0 3
+	 1375 7675 1240 7900 1015 7900
+	 0.000 -1.000 0.000
+-6
+2 4 1 1 0 7 0 0 -1 4.000 0 0 12 0 0 5
+	 7425 675 7425 1800 5625 1800 5625 675 7425 675
+2 4 1 1 0 7 0 0 -1 4.000 0 0 12 0 0 5
+	 7425 2250 7425 3600 5625 3600 5625 2250 7425 2250
+2 4 0 2 0 7 0 0 -1 6.000 0 0 7 0 0 5
+	 4275 900 4275 225 2475 225 2475 900 4275 900
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 1575 900 2475 585
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 1575 1350 2475 1665
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 4275 675 5625 1125
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 4275 1575 5625 1350
+2 4 0 2 0 7 0 0 -1 6.000 0 0 7 0 0 5
+	 4275 4950 4275 4275 2475 4275 2475 4950 4275 4950
+2 4 0 2 0 7 10 0 20 0.000 0 0 7 0 0 5
+	 4815 6660 3015 6660 3015 5985 4815 5985 4815 6660
+2 4 0 2 0 7 20 0 20 0.000 0 0 7 0 0 5
+	 4905 6570 3105 6570 3105 5895 4905 5895 4905 6570
+2 4 0 2 0 7 5 0 20 0.000 0 0 7 0 0 5
+	 4725 6750 2925 6750 2925 6075 4725 6075 4725 6750
+2 1 0 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 3600 4950 4365 5895
+2 1 0 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 3375 4950 4050 5985
+2 1 0 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 3150 4950 3600 6075
+2 4 1 1 0 7 0 0 -1 4.000 0 0 12 0 0 5
+	 7425 4500 7425 6300 5625 6300 5625 4500 7425 4500
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 1 2
+	0 0 2.00 120.00 240.00
+	0 0 2.00 120.00 240.00
+	 4950 6300 5805 5985
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 1 2
+	0 0 2.00 120.00 240.00
+	0 0 2.00 120.00 240.00
+	 4320 4635 5760 5130
+2 4 1 2 0 7 0 0 -1 6.000 0 0 12 0 0 5
+	 4050 8100 4050 7200 2250 7200 2250 8100 4050 8100
+2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
+	0 0 2.00 120.00 240.00
+	 2250 7650 1620 7650
+2 4 0 2 0 7 5 0 18 0.000 0 0 7 0 0 5
+	 4275 2025 2475 2025 2475 1350 4275 1350 4275 2025
+3 2 1 2 0 7 0 0 -1 6.000 0 1 1 2
+	0 0 2.00 120.00 240.00
+	0 0 2.00 120.00 240.00
+	 4500 2925 5760 2925
+	 0.000 0.000
+3 0 1 2 0 7 0 0 -1 6.000 0 1 0 5
+	0 0 2.00 120.00 240.00
+	 4950 6570 5625 6930 5625 7515 4950 7875 4140 7785
+	 0.000 1.000 1.000 1.000 0.000
+3 0 1 2 0 7 0 0 -1 6.000 0 1 0 4
+	0 0 2.00 120.00 240.00
+	 5850 3195 5490 3555 5490 4635 5850 4950
+	 0.000 1.000 1.000 0.000
+3 0 1 2 0 7 0 0 -1 6.000 0 1 0 4
+	0 0 2.00 120.00 240.00
+	 5850 1575 5490 1935 5490 2340 5850 2700
+	 0.000 1.000 1.000 0.000
+4 0 0 0 0 0 16 0.0000 4 210 1080 2880 1755 smtpserver\001
+4 0 0 0 0 0 16 0.0000 4 165 1185 2835 630 ``sendmail''\001
+4 0 0 0 0 0 16 0.0000 4 225 1500 5895 3015 Router spool(s)\001
+4 0 0 0 0 0 16 0.0000 4 225 1245 3195 6480 Transporters\001
+4 0 0 0 0 0 16 0.0000 4 165 975 2925 4680 Scheduler\001
+4 0 0 0 0 0 16 0.0000 4 165 1080 4095 5355 Command \001
+4 0 0 0 0 0 16 0.0000 4 225 510 4320 5625 pipes\001
+4 0 0 0 0 0 16 0.0000 4 225 1545 5760 5580 Transport spool\001
+4 0 0 0 0 0 16 0.0000 4 225 1095 5985 1305 Input spool\001
+4 0 0 0 0 0 16 0.0000 4 165 840 2610 7740 Mailbox\001
Index: zmailer/doc/manual/zmsched1.fig
diff -u zmailer/doc/manual/zmsched1.fig:1.1 zmailer/doc/manual/zmsched1.fig:1.2
--- zmailer/doc/manual/zmsched1.fig:1.1	Wed May 13 00:41:21 1998
+++ zmailer/doc/manual/zmsched1.fig	Tue Apr  3 14:30:03 2001
@@ -7,13 +7,6 @@
 Single
 -2
 1200 2
-6 6390 4590 9675 6210
-4 0 -1 0 0 0 16 0.0000 4 225 2700 6391 4771 Unlike versions previous to\001
-4 0 -1 0 0 0 16 0.0000 4 180 2625 6391 5113 mea's 2.99.15, that version\001
-4 0 -1 0 0 0 16 0.0000 4 210 2730 6391 5455 (and its successors) do NOT\001
-4 0 -1 0 0 0 16 0.0000 4 210 3270 6391 5797 have   $POSTOFFICE/scheduler/\001
-4 0 -1 0 0 0 16 0.0000 4 225 1305 6391 6139 subdirectory!\001
--6
 2 2 0 2 -1 7 0 0 -1 0.000 0 0 0 0 0 5
 	 2700 3600 5175 3600 5175 6975 2700 6975 2700 3600
 2 2 0 2 -1 7 0 0 -1 0.000 0 0 0 0 0 5
@@ -22,18 +15,17 @@
 	0 0 2.00 120.00 240.00
 	 3825 4050 5940 4050 6300 3105 5985 2430 5175 2250
 	 0.000 1.000 1.000 1.000 0.000
-4 0 -1 0 0 18 16 0.0000 4 255 3600 2250 3375 $POSTOFFICE/transport/12345\001
+4 0 -1 0 0 18 16 0.0000 4 255 3615 2250 3375 $POSTOFFICE/transport/12345\001
 4 0 -1 0 0 18 16 0.0000 4 180 810 2925 4050 i 12345\001
 4 0 -1 0 0 18 16 0.0000 4 180 2445 2925 4725 r  chan1 host1 data...\001
 4 0 -1 0 0 18 16 0.0000 4 180 2445 2925 5175 r  chan1 host1 data...\001
 4 0 -1 0 0 18 16 0.0000 4 180 2445 2925 5625 r  chan2 host2 data...\001
-4 0 -1 0 0 18 16 0.0000 4 180 960 2925 2700 Content\001
-4 0 -1 0 0 18 16 0.0000 4 255 3270 2250 1575 $POSTOFFICE/queue/12345\001
-4 0 -1 0 0 18 24 0.0000 4 285 4035 4275 900 ZMailer scheduler files\001
-4 0 -1 0 0 18 16 0.0000 4 180 990 2925 2250 Headers\001
-4 0 -1 0 0 18 16 0.0000 4 180 1335 900 4725 information\001
-4 0 -1 0 0 18 16 0.0000 4 240 1710 900 2475 Message body\001
-4 0 -1 0 0 18 16 0.0000 4 240 1320 900 4500 Processing\001
+4 0 -1 0 0 18 16 0.0000 4 180 945 2925 2700 Content\001
+4 0 -1 0 0 18 16 0.0000 4 255 3255 2250 1575 $POSTOFFICE/queue/12345\001
+4 0 -1 0 0 18 16 0.0000 4 180 960 2925 2250 Headers\001
+4 0 -1 0 0 18 16 0.0000 4 180 1320 900 4725 information\001
+4 0 -1 0 0 18 16 0.0000 4 240 1680 900 2475 Message body\001
+4 0 -1 0 0 18 16 0.0000 4 240 1305 900 4500 Processing\001
 4 0 -1 0 0 0 16 0.0000 4 225 1935 6390 2700 "Logical reference"\001
 4 0 -1 0 0 0 16 0.0000 4 225 3090 6390 3042   (Not of any kind of filesystem\001
 4 0 -1 0 0 0 16 0.0000 4 225 2985 6390 3384    link object.  Just the name of\001
Index: zmailer/doc/manual/zref-router.sgml
diff -u zmailer/doc/manual/zref-router.sgml:1.12 zmailer/doc/manual/zref-router.sgml:1.16
--- zmailer/doc/manual/zref-router.sgml:1.12	Wed Feb 21 18:20:26 2001
+++ zmailer/doc/manual/zref-router.sgml	Mon Mar 12 11:12:34 2001
@@ -379,7 +379,50 @@
 
 </SECT1>
 
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
+<SECT1 ID=zmshref-script-wellknown-functions>
+<TITLE>Router Script Well Known Entrypoints</TITLE>
+
+<PARA>
+This section describes the <COMMAND>router</> internal functions
+used as entrypoints by various uses inside and outside the <COMMAND>router</>
+program.
+</PARA>
+
+<SECT2 ID=zmshref.process><TITLE>The <FUNCTION>process()</> function</>
+
+<PARA>
+FIXME! WRITEME!
+</PARA>
+</SECT2>
+
+<SECT2 ID=zmshref.router><TITLE>The <FUNCTION>router()</> function</>
+
+<PARA>
+FIXME! WRITEME!
+</PARA>
+</SECT2>
+
+<SECT2 ID=zmshref.crossbar><TITLE>The <FUNCTION>crossbar()</> function</>
+
+<PARA>
+FIXME! WRITEME!
+</PARA>
+</SECT2>
 
+<SECT2 ID=zmshref.server><TITLE>The <FUNCTION>server()</> function</>
+
+<PARA>
+FIXME! WRITEME!
+</PARA>
+</SECT2>
+
+
+</SECT1>
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+
 <SECT1 ID=zmshref-script-internal-functions>
 <TITLE>Script Language Internal Functions</TITLE>
 
@@ -1108,35 +1151,29 @@
 
 <VARIABLELIST>
 <VARLISTENTRY><TERM>Syntax:</TERM><LISTITEM><PARA>
+
 <CMDSYNOPSIS>
  <COMMAND>db</>
   <ARG CHOICE=REQ>add</>
   <ARG CHOICE=REQ><REPLACEABLE>database</></>
   <ARG CHOICE=REQ><REPLACEABLE>key</></>
   <ARG CHOICE=REQ><REPLACEABLE>value</></>
-</CMDSYNOPSIS>
-<CMDSYNOPSIS>
  <COMMAND>db</>
   <ARG CHOICE=REQ>flush</>
   <ARG CHOICE=REQ><REPLACEABLE>database</></>
-</CMDSYNOPSIS>
-<CMDSYNOPSIS>
  <COMMAND>db</>
   <ARG CHOICE=REQ>owner</>
   <ARG CHOICE=REQ><REPLACEABLE>database</></>
-</CMDSYNOPSIS>
-<CMDSYNOPSIS>
  <COMMAND>db</>
   <ARG CHOICE=REQ>print</>
   <ARG CHOICE=REQ><REPLACEABLE>database</></>
-</CMDSYNOPSIS>
-<CMDSYNOPSIS>
  <COMMAND>db</>
   <ARG CHOICE=REQ>remove</>
   <ARG CHOICE=REQ><REPLACEABLE>database</></>
   <ARG CHOICE=REQ><REPLACEABLE>key</></>
-</CMDSYNOPSIS>
-<CMDSYNOPSIS>
+ <COMMAND>db</>
+  <ARG CHOICE=REQ>count</>
+  <ARG CHOICE=REQ><REPLACEABLE>database</></>
  <COMMAND>db</>
   <ARG CHOICE=REQ>toc</>
 </CMDSYNOPSIS>
@@ -1170,21 +1207,24 @@
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM><OPTION>f[lush]</OPTION></TERM><LISTITEM><PARA>
 
-Remove all entries from the database, 
-if possible.
+For ``incore'' database this means deletion of the content, but
+for others this is IO buffer flush (in case of modifications.)
 
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM><OPTION>o[wner]</OPTION></TERM><LISTITEM><PARA>
 
-Print the account name of the owner 
-of the database, if possible. This is usually determined by the 
-files associated with the database.
+Print the account name of the owner of the database, if possible.
+This is usually determined by the files associated with the database.
 
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM><OPTION>p[rint]</OPTION></TERM><LISTITEM><PARA>
+
+Print all entries of the database, if possible. 
+
+</PARA></LISTITEM></VARLISTENTRY>
+<VARLISTENTRY><TERM><OPTION>c[ount]</OPTION></TERM><LISTITEM><PARA>
 
-Print all entries of the database, 
-if possible. 
+Iterate thru the database and count entries in there.
 
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM><OPTION>r[emove]</OPTION></TERM><LISTITEM><PARA>
@@ -1194,11 +1234,17 @@
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM><OPTION>t[oc]</OPTION></TERM><LISTITEM><PARA>
 
-Print a table of defined relations 
-and their associated information. This table has five columns, 
-in order: the name of the relation, its type and subtype, cache 
-entries and maximum size, flags, and associated files. See the 
-<FUNCTION>relation</> function for more information.
+Print a table of defined relations and their associated information.
+This table has five columns, in order:
+<ITEMIZEDLIST>
+ <LISTITEM><PARA>the name of the relation</></>
+ <LISTITEM><PARA>its type and subtype</></>
+ <LISTITEM><PARA>cache entries and maximum cache size</></>
+ <LISTITEM><PARA>flags</></>
+ <LISTITEM><PARA>and associated files</></>
+</ITEMIZEDLIST>
+See the <FUNCTION>relation</> function for more information.
+(<XREF LINKEND=zmshref.relation>)
 
 </PARA></LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
@@ -1208,14 +1254,14 @@
 <VARLISTENTRY><TERM>Notes:</TERM><LISTITEM><PARA>
 
 <INFORMALTABLE FRAME=ALL ID=tbl-zref-router-db-type-specific-notes>
-<TITLE>DB type specific notes:</TITLE>
-<TGROUP COLS=6 ALIGN=LEFT COLSEP=1 ROWSEP=1>
+<TGROUP COLS=7 ALIGN=LEFT COLSEP=1 ROWSEP=1>
 <COLSPEC COLNAME=C1-DBTYPE-NAME>
 <COLSPEC COLNAME=C2-DBFUNC-ADD>
 <COLSPEC COLNAME=C3-DBFUNC-FLUSH>
 <COLSPEC COLNAME=C4-DBFUNC-OWNER>
 <COLSPEC COLNAME=C5-DBFUNC-PRINT>
 <COLSPEC COLNAME=C6-DBFUNC-REMOVE>
+<COLSPEC COLNAME=C6-DBFUNC-COUNT>
 <THEAD>
 <ROW>
   <ENTRY>DB type</ENTRY>
@@ -1224,6 +1270,7 @@
   <ENTRY>owner</ENTRY>
   <ENTRY>print</ENTRY>
   <ENTRY>remove</ENTRY>
+  <ENTRY>count</ENTRY>
 </ROW>
 </THEAD>
 <!-- <TFOOT> ... </TFOOT> -->
@@ -1235,6 +1282,7 @@
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
+  <ENTRY>yes</ENTRY>
 </ROW>
 <ROW>
   <ENTRY>header</ENTRY>
@@ -1243,6 +1291,7 @@
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
+  <ENTRY>yes</ENTRY>
 </ROW>
 <ROW>
   <ENTRY>ordered</ENTRY>
@@ -1251,6 +1300,7 @@
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
   <ENTRY>no</ENTRY>
+  <ENTRY>yes</ENTRY>
 </ROW>
 <ROW>
   <ENTRY>unordered</ENTRY>
@@ -1259,6 +1309,7 @@
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
+  <ENTRY>yes</ENTRY>
 </ROW>
 <ROW>
   <ENTRY>hostsfile</ENTRY>
@@ -1267,6 +1318,7 @@
   <ENTRY>no</ENTRY>
   <ENTRY>yes</ENTRY>
   <ENTRY>no</ENTRY>
+  <ENTRY>no</ENTRY>
 </ROW>
 <ROW>
   <ENTRY>bind</ENTRY>
@@ -1275,6 +1327,7 @@
   <ENTRY>no</ENTRY>
   <ENTRY>no</ENTRY>
   <ENTRY>no</ENTRY>
+  <ENTRY>no</ENTRY>
 </ROW>
 <ROW>
   <ENTRY>ndbm</ENTRY>
@@ -1283,6 +1336,7 @@
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
+  <ENTRY>yes</ENTRY>
 </ROW>
 <ROW>
   <ENTRY>gdbm</ENTRY>
@@ -1291,6 +1345,7 @@
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
+  <ENTRY>yes</ENTRY>
 </ROW>
 <ROW>
   <ENTRY>dbm</ENTRY>
@@ -1299,6 +1354,7 @@
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
+  <ENTRY>yes</ENTRY>
 </ROW>
 <ROW>
   <ENTRY>yp (NIS)</ENTRY>
@@ -1307,6 +1363,7 @@
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
+  <ENTRY>no</ENTRY>
 </ROW>
 <ROW>
   <ENTRY>bhash</ENTRY>
@@ -1315,6 +1372,7 @@
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
+  <ENTRY>yes</ENTRY>
 </ROW>
 <ROW>
   <ENTRY>btree</ENTRY>
@@ -1323,6 +1381,7 @@
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
   <ENTRY>yes</ENTRY>
+  <ENTRY>yes</ENTRY>
 </ROW>
 <ROW>
   <ENTRY>ldap</ENTRY>
@@ -1331,6 +1390,16 @@
   <ENTRY>yes</ENTRY>
   <ENTRY>no</ENTRY>
   <ENTRY>no</ENTRY>
+  <ENTRY>no</ENTRY>
+</ROW>
+<ROW>
+  <ENTRY>selfmatch</ENTRY>
+  <ENTRY>no</ENTRY>
+  <ENTRY>no</ENTRY>
+  <ENTRY>no</ENTRY>
+  <ENTRY>yes</ENTRY>
+  <ENTRY>no</ENTRY>
+  <ENTRY>yes</ENTRY>
 </ROW>
 </TBODY>
 </TGROUP>
@@ -1366,7 +1435,8 @@
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM><LITERAL>NULL</></TERM><LISTITEM><PARA>
 
-Error.  
+Lookup failed, <LITERAL>$deferred</> may be set if the reason is
+considered <EMPHASIS>temporary</> and thus solvable latter.
 
 </PARA></LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
@@ -1375,7 +1445,7 @@
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM>Options:</TERM><LISTITEM><PARA>
 
-none
+<EMPHASIS>FIXME! Notes about '-:' and '--' OPTIONS.</>
 
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM>Notes:</TERM><LISTITEM><PARA>
@@ -1384,9 +1454,10 @@
 <COMMAND>router</>.
 
 </PARA><PARA>
-
-<EMPHASIS>FIXME! Notes about %[0-9] substitution rules, and their controls.</>
-
+<EMPHASIS>FIXME! Notes about %[0-9] substitution rules, and their controls.
+(That is: <FUNCTION>relation</>'s <OPTION>-%</> option!
+ <XREF LINKEND=zmshref.relation>)
+</>
 </PARA></LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
 
@@ -1399,9 +1470,11 @@
 
 <VARIABLELIST>
 <VARLISTENTRY><TERM>Syntax:</TERM><LISTITEM><PARA>
-<SYNOPSIS>
-echo [-n] [string-expressions]
-</SYNOPSIS>
+<CMDSYNOPSIS>
+<COMMAND>echo</COMMAND>
+ <ARG><OPTION>-n</></ARG>
+ <ARG><REPLACEABLE>string-expressions</></ARG>
+</CMDSYNOPSIS>
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM>Return Values:</TERM><LISTITEM><PARA>
 
@@ -1459,7 +1532,13 @@
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM>Notes:</TERM><LISTITEM><PARA>
 
-none
+This does a side-effect on input list which is need in ``for'' loops:
+<SCREEN>
+for loopvar in $(elements $listvar)
+do
+  ...
+done
+</SCREEN>
 
 </PARA></LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
@@ -1496,7 +1575,7 @@
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM>Notes:</TERM><LISTITEM><PARA>
 
-Print internal variable tree.
+A debug tool to print internal variable tree.
 
 </PARA></LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
@@ -1585,17 +1664,10 @@
 </SYNOPSIS>
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM>Return Values:</TERM><LISTITEM><PARA>
-
-<VARIABLELIST>
-<VARLISTENTRY><TERM>{\tt 0}</TERM><LISTITEM><PARA>
-
 
+does not return, does <FUNCTION>exit(2)</> for the shell/router..
 
 </PARA></LISTITEM></VARLISTENTRY>
-</VARIABLELIST>
-
-
-</PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM>Options:</TERM><LISTITEM><PARA>
 
 none  
@@ -1603,7 +1675,7 @@
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM>Notes: </TERM><LISTITEM><PARA>
 
-Exit from the shell with exit code.
+Exit from the shell/router with exit code.
 
 </PARA></LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
@@ -1790,13 +1862,21 @@
 
 <VARIABLELIST>
 <VARLISTENTRY><TERM>Syntax:</TERM><LISTITEM><PARA>
-
-{\tt get property-list key}
+<CMDSYNOPSIS>
+ <COMMAND>get</COMMAND>
+   <ARG CHOICE=PLAIN>property-list</ARG>
+   <ARG CHOICE=PLAIN>keyname</ARG>
+</CMDSYNOPSIS>
+<CMDSYNOPSIS>
+ <COMMAND>get</COMMAND>
+   <ARG CHOICE=PLAIN>property-list-varname</ARG>
+   <ARG CHOICE=PLAIN>keyname</ARG>
+</CMDSYNOPSIS>
 
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM>Return Values:</TERM><LISTITEM><PARA>
 
-{\tt property-list}
+property-list
 
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM>Options:</TERM><LISTITEM><PARA>
@@ -1806,7 +1886,12 @@
 </PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM>Notes:</TERM><LISTITEM><PARA>
 
-Returns a property list corresponding to key string.
+Returns a property-list corresponding to key string:
+<SCREEN>
+  listvar=(key1 value1 keyname value key3 value3)
+  result1=$(get  listvar keyname)
+  result2=$(get $listvar keyname)
+</SCREEN>
 
 </PARA></LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
@@ -2087,8 +2172,39 @@
 </PARA></LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
 
+</SECT2>
+
+<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+<SECT2 ID="zmshref.ifssplit">
+<TITLE><FUNCTION>ifssplit</FUNCTION></TITLE>
+
+
+<VARIABLELIST>
+<VARLISTENTRY><TERM>Syntax:</TERM><LISTITEM><PARA>
+
+{\tt ifssplit any-string}
+
+</PARA></LISTITEM></VARLISTENTRY>
+<VARLISTENTRY><TERM>Return Values:</TERM><LISTITEM><PARA>
+
+split list
+
+</PARA></LISTITEM></VARLISTENTRY>
+<VARLISTENTRY><TERM>Options:</TERM><LISTITEM><PARA>
+
+none  
+
+</PARA></LISTITEM></VARLISTENTRY>
+<VARLISTENTRY><TERM>Notes:</TERM><LISTITEM><PARA>
+
+This splits given input string per IFS environment variable, and
+produces a list of substrings ready for further use.
+
+</PARA></LISTITEM></VARLISTENTRY>
+</VARIABLELIST>
 
 </SECT2>
+
 <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
 <SECT2 ID="zmshref.lappend">
 <TITLE><FUNCTION>lappend</FUNCTION></TITLE>
@@ -2119,6 +2235,7 @@
 </VARIABLELIST>
 
 </SECT2>
+
 <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
 <SECT2 ID="zmshref.last">
 <TITLE><FUNCTION>last</FUNCTION></TITLE>
@@ -2148,7 +2265,6 @@
 </PARA></LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
 
-
 </SECT2>
 <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
 <SECT2 ID="zmshref.length">
@@ -2419,15 +2535,17 @@
 </PARA>
 
 <SCREEN>
-  tt=(aa 11 bb 22 cc 33 dd 44)
-  lreplace tt aa zz
-  grind $tt
-  (zz 11 bb 22 cc 33 dd 44)
-  lreplace tt 0 aaa
-  grind $tt
+  <PROMPT>$ </><USERINPUT>tt=(aa 11 bb 22 cc 33 dd 44)</>
+  <PROMPT>$ </><USERINPUT>grind $tt</>
+  (aa 11 bb 22 cc 33 dd 44)
+  <PROMPT>$ </><USERINPUT>lreplace tt bb zz</>
+  <PROMPT>$ </><USERINPUT>grind $tt</>
+  (aa 11 bb zz cc 33 dd 44)
+  <PROMPT>$ </><USERINPUT>lreplace tt 0 aaa</>
+  <PROMPT>$ </><USERINPUT>grind $tt</>
   (aaa 11 bb 22 cc 33 dd 44)
-  lreplace tt zz aa
-  grind $tt
+  <PROMPT>$ </><USERINPUT>lreplace tt zz aa</>
+  <PROMPT>$ </><USERINPUT>grind $tt</>
   (aaa 11 bb 22 cc 33 dd 44 zz aa)
 </SCREEN>
 
@@ -2527,6 +2645,7 @@
 
 </SECT2>
 <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
+<!--
 <SECT2 ID="zmshref.process">
 <TITLE><FUNCTION>process</FUNCTION></TITLE>
 
@@ -2574,6 +2693,7 @@
 
 
 </SECT2>
+-->
 <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
 <SECT2 ID="zmshref.read">
 <TITLE><FUNCTION>read</FUNCTION></TITLE>
@@ -2727,18 +2847,107 @@
 
 <VARIABLELIST>
 <VARLISTENTRY><TERM>Syntax:</TERM><LISTITEM><PARA>
+Generic:
 <CMDSYNOPSIS>
   <COMMAND>relation</COMMAND>
-  <ARG>-t <REPLACEABLE>dbtype</><ARG>,<REPLACEABLE>subtype</></ARG></ARG>
+  <ARG><OPTION>-i</></ARG>
+  <ARG><OPTION>-T</></ARG>
+  <ARG CHOICE=PLAIN><OPTION>-t <REPLACEABLE>dbtype</></><ARG><OPTION>/<REPLACEABLE>subtype</></></ARG></ARG>
+  <ARG><OPTION>-f <REPLACEABLE>file</REPLACEABLE></></ARG>
+  <ARG><OPTION>-e <REPLACEABLE>#</></></ARG>
+  <ARG><OPTION>-s <REPLACEABLE>#</></></ARG>
+  <ARG><OPTION>-:%blmnu</></ARG>
+  <ARG><OPTION>-d <REPLACEABLE>driver</></></ARG>
+  <ARG CHOICE=PLAIN><OPTION><REPLACEABLE>name</></></ARG>
+</CMDSYNOPSIS>
+The separator character between ``dbtype'' and ``subtype'' can be either
+a comma (``,'') or a slash (``/''), as user wishes.
+In case the subtype is a filepath (or otherwise begins with a slash),
+the user propably wants to use comma to reduce confusion.
+</PARA><PARA>
+More specific versions:
+<CMDSYNOPSIS>
+
+  <COMMAND>relation</COMMAND>
+  <ARG CHOICE=PLAIN><OPTION>-t yp,<REPLACEABLE>yp-mapname</></></ARG>
+  <ARG CHOICE=PLAIN><OPTION>-f <REPLACEABLE>yp-domain</></></ARG>
+  <ARG><OPTION>-e <REPLACEABLE>#</></></ARG>
+  <ARG><OPTION>-s <REPLACEABLE>#</></></ARG>
+  <ARG><OPTION>-:%blmnu</></ARG>
+  <ARG><OPTION>-d <REPLACEABLE>driver</></></ARG>
+  <ARG CHOICE=PLAIN><OPTION><REPLACEABLE>name</></></ARG>
+
+  <COMMAND>relation</COMMAND>
+  <ARG CHOICE=PLAIN><OPTION>-t bind/<REPLACEABLE>query-type</></></ARG>
   <ARG>-f <REPLACEABLE>file</REPLACEABLE></ARG>
   <ARG>-e <REPLACEABLE>#</></ARG>
   <ARG>-s <REPLACEABLE>#</></ARG>
-  <ARG>-bilmnu</ARG>
+  <ARG>-:%blmnu</ARG>
   <ARG>-d <REPLACEABLE>driver</></ARG>
-  <ARG CHOICE=PLAIN>name</ARG>
+  <ARG CHOICE=PLAIN><OPTION><REPLACEABLE>name</></></ARG>
+
+  <COMMAND>relation</COMMAND>
+  <ARG CHOICE=PLAIN><OPTION>-i</></ARG>
+  <ARG CHOICE=PLAIN><OPTION>-t ordered,<REPLACEABLE>filepath2</></></ARG>
+  <ARG CHOICE=PLAIN><OPTION>-f <REPLACEABLE>filepath1</REPLACEABLE></></ARG>
+  <ARG CHOICE=OPT><OPTION>-e <REPLACEABLE>#</></></ARG>
+  <ARG CHOICE=OPT><OPTION>-s <REPLACEABLE>#</></></ARG>
+  <ARG CHOICE=OPT><OPTION>-:%blmnu</></ARG>
+  <ARG CHOICE=OPT><OPTION>-d <REPLACEABLE>driver</></></ARG>
+  <ARG CHOICE=PLAIN><OPTION><REPLACEABLE>name</></></ARG>
+
+  <COMMAND>relation</COMMAND>
+  <ARG CHOICE=PLAIN><OPTION>-i</></ARG>
+  <ARG CHOICE=PLAIN><OPTION>-t unordered,<REPLACEABLE>filepath2</></></ARG>
+  <ARG CHOICE=PLAIN><OPTION>-f <REPLACEABLE>filepath1</REPLACEABLE></></ARG>
+  <ARG CHOICE=OPT><OPTION>-e <REPLACEABLE>#</></></ARG>
+  <ARG CHOICE=OPT><OPTION>-s <REPLACEABLE>#</></></ARG>
+  <ARG CHOICE=OPT><OPTION>-:%blmnu</></ARG>
+  <ARG CHOICE=OPT><OPTION>-d <REPLACEABLE>driver</></></ARG>
+  <ARG CHOICE=PLAIN><OPTION><REPLACEABLE>name</></></ARG>
+
+  <COMMAND>relation</COMMAND>
+  <ARG CHOICE=PLAIN><OPTION>-t ordered</></ARG>
+  <ARG CHOICE=PLAIN><OPTION>-f <REPLACEABLE>filepath</REPLACEABLE></></ARG>
+  <ARG CHOICE=OPT><OPTION>-e <REPLACEABLE>#</></></ARG>
+  <ARG CHOICE=OPT><OPTION>-s <REPLACEABLE>#</></></ARG>
+  <ARG CHOICE=OPT><OPTION>-:%blmnu</></ARG>
+  <ARG CHOICE=OPT><OPTION>-d <REPLACEABLE>driver</></></ARG>
+  <ARG CHOICE=PLAIN><OPTION><REPLACEABLE>name</></></ARG>
+
+  <COMMAND>relation</COMMAND>
+  <ARG CHOICE=PLAIN><OPTION>-t unordered</></ARG>
+  <ARG CHOICE=PLAIN><OPTION>-f <REPLACEABLE>filepath</REPLACEABLE></></ARG>
+  <ARG CHOICE=OPT><OPTION>-e <REPLACEABLE>#</></></ARG>
+  <ARG CHOICE=OPT><OPTION>-s <REPLACEABLE>#</></></ARG>
+  <ARG CHOICE=OPT><OPTION>-:%blmnu</></ARG>
+  <ARG CHOICE=OPT><OPTION>-d <REPLACEABLE>driver</></></ARG>
+  <ARG CHOICE=PLAIN><OPTION><REPLACEABLE>name</></></ARG>
+
+  <COMMAND>relation</COMMAND>
+  <ARG CHOICE=PLAIN><OPTION>-t <REPLACEABLE>dbtype</></></ARG>
+  <ARG><OPTION>-f <REPLACEABLE>file</REPLACEABLE></></ARG>
+  <ARG><OPTION>-e <REPLACEABLE>#</></></ARG>
+  <ARG><OPTION>-s <REPLACEABLE>#</></></ARG>
+  <ARG><OPTION>-:%blmnu</></ARG>
+  <ARG><OPTION>-d <REPLACEABLE>driver</></></ARG>
+  <ARG CHOICE=PLAIN><OPTION><REPLACEABLE>name</></></ARG>
+
 </CMDSYNOPSIS>
+Note:  ``<COMMAND>zmailer newdb</>'' does not support ``<OPTION>-i</>''
+option use! (FIXME! FIXME! 2001-Mar-8)
+</PARA><PARA>
+Special support for testing of presense of support for given
+<REPLACEABLE>dbtype</>:
+<CMDSYNOPSIS>
+
+  <COMMAND>relation</COMMAND>
+  <ARG CHOICE=PLAIN><OPTION>-T -t <REPLACEABLE>dbtype</></></ARG>
+  <ARG CHOICE=PLAIN><REPLACEABLE>dummy_name</></ARG>
+</CMDSYNOPSIS>
 </PARA>
 
+
 <PARA>
 Options are listed below. <OPTION>name</> is the name of the relation
 that is wanted to be created. Examples:
@@ -2770,156 +2979,436 @@
 <VARLISTENTRY><TERM>Options:</TERM><LISTITEM><PARA>
 
 <VARIABLELIST>
+<VARLISTENTRY><TERM><OPTION>-T</OPTION></TERM><LISTITEM><PARA>
+
+Special flag enabling script to test for given db-type:
+
+<SCREEN>
+  relation -T -t btree dummy && echo "have BTREE database"
+</SCREEN>
+
+</PARA></LISTITEM></VARLISTENTRY>
 <VARLISTENTRY><TERM><OPTION>-t <REPLACEABLE>dbtype</>[,<REPLACEABLE>subtype</>]</OPTION></TERM><LISTITEM><PARA>
+Below is a table to option interdependencies as they
+apply with different database types.
+</PARA>
+
+<FIGURE PGWIDE=1 FLOAT=1>
+<TITLE><FUNCTION>relation</>'s option interdependencies</TITLE>
+<INFORMALTABLE FRAME=ALL ID=tbl.zmshref.relation>
+<TGROUP COLS=3 ALIGN=LEFT COLSEP=0 ROWSEP=0>
+<!-- <COLSPEC COLNAME=C1-MTANAME>
+     <COLSPEC COLNAME=C2-DNS-CONC>
+     <COLSPEC COLNAME=C3-SMTP-CONC>
+     <COLSPEC COLNAME=C4-SMTP-PGB> -->
+<THEAD>
+<ROW>
+  <ENTRY>Db-Type</ENTRY>
+  <ENTRY>Subtype meaning</ENTRY>
+  <ENTRY><OPTION>-f</> option value</ENTRY>
+</ROW>
+</THEAD>
+<!-- <TFOOT>
+    </TFOOT> -->
+<TBODY>
+<ROW>
+  <ENTRY>incore</ENTRY>
+  <ENTRY>ignored</ENTRY>
+  <ENTRY>ignored</ENTRY>
+</ROW>
+<ROW>
+  <ENTRY>header</ENTRY>
+  <ENTRY>ignored</ENTRY>
+  <ENTRY>ignored</ENTRY>
+</ROW>
+
+<ROW>
+  <ENTRY>selfmatch</ENTRY>
+  <ENTRY>ignored</ENTRY>
+  <ENTRY>ignored</ENTRY>
+</ROW>
+<ROW>
+  <ENTRY>hostsfile</ENTRY>
+  <ENTRY>ignored</ENTRY>
+  <ENTRY>ignored (?)</ENTRY>
+</ROW>
+
+<ROW>
+  <ENTRY>ordered</ENTRY>
+  <ENTRY>ignored (without <OPTION>-i</> option)</ENTRY>
+  <ENTRY>path-to-file</ENTRY>
+</ROW>
+<ROW>
+  <ENTRY>unordered</ENTRY>
+  <ENTRY>ignored (without <OPTION>-i</> option)</ENTRY>
+  <ENTRY>path-to-file</ENTRY>
+</ROW>
+<ROW>
+  <ENTRY>ordered</ENTRY>
+  <ENTRY>path-to-file-2 (with <OPTION>-i</> option)</ENTRY>
+  <ENTRY>path-to-file-1</ENTRY>
+</ROW>
+<ROW>
+  <ENTRY>unordered</ENTRY>
+  <ENTRY>path-to-file-2 (with <OPTION>-i</> option)</ENTRY>
+  <ENTRY>path-to-file-1</ENTRY>
+</ROW>
+
+<ROW>
+  <ENTRY>bind</ENTRY>
+  <ENTRY>DNS-query-subtype</ENTRY>
+  <ENTRY>ignored</ENTRY>
+</ROW>
+<ROW>
+  <ENTRY>yp</ENTRY>
+  <ENTRY>YP-mapname</ENTRY>
+  <ENTRY>YP-domain</ENTRY>
+</ROW>
+<ROW>
+  <ENTRY>ldap</ENTRY>
+  <ENTRY>ignored??</ENTRY>
+  <ENTRY>path-to-cfg-file</ENTRY>
+</ROW>
+
+<ROW>
+  <ENTRY>dbm</ENTRY>
+  <ENTRY>ignored</ENTRY>
+  <ENTRY>basepath-to-db-file</ENTRY>
+</ROW>
+<ROW>
+  <ENTRY>ndbm</ENTRY>
+  <ENTRY>ignored</ENTRY>
+  <ENTRY>basepath-to-db-file</ENTRY>
+</ROW>
+<ROW>
+  <ENTRY>gdbm</ENTRY>
+  <ENTRY>ignored</ENTRY>
+  <ENTRY>basepath-to-db-file</ENTRY>
+</ROW>
+<ROW>
+  <ENTRY>btree</ENTRY>
+  <ENTRY>ignored</ENTRY>
+  <ENTRY>basepath-to-db-file</ENTRY>
+</ROW>
+<ROW>
+  <ENTRY>bhash</ENTRY>
+  <ENTRY>ignored</ENTRY>
+  <ENTRY>basepath-to-db-file</ENTRY>
+</ROW>
+</TBODY>
+</TGROUP>
+</INFORMALTABLE>
+</FIGURE>
+
+<PARA>
+One of the known types of databases, currently: 
 
-One of the known types 
-of databases, currently: 
 <VARIABLELIST>
-<VARLISTENTRY><TERM>{\tt incore}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>incore</></TERM><LISTITEM><PARA>
 
-A database maintained in virtual memeory (using 
-splay trees). This type should not be used for any database that must 
+A database maintained in virtual memory (using splay trees).
+This type should not be used for any database that must 
 periodically be flushed, since all occupied memory can be freed.
 
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt header}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>header</></TERM><LISTITEM><PARA>
 
-A database type used to store RFC822 header 
+A special incore database type used to store RFC822 header 
 semantics information. It is unlikely to be used for anything else.
 
+</PARA></LISTITEM></VARLISTENTRY>
+<VARLISTENTRY><TERM><OPTION>ordered</></TERM><LISTITEM><PARA>
+
+The <OPTION>-f</>-option defines the path of the file.
+
+</PARA><PARA>
+
+A file with key-value pairs on every line, separated by whitespace,
+sorted by key. (See <COMMAND>sort</>(1).)
+
+<SCREEN>
+key_at_line_start   data at the same line
+</SCREEN>
+
+</PARA></LISTITEM></VARLISTENTRY>
+<VARLISTENTRY><TERM><OPTION>unordered</></TERM><LISTITEM><PARA>
+
+The <OPTION>-f</>-option defines the path of the file.
+
+</PARA><PARA>
+
+A file with key-value pairs on every line, separated by whitespace. 
+
+<SCREEN>
+key_at_line_start   data at the same line
+</SCREEN>
+
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt ordered}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>ordered,<REPLACEABLE>path-to-file-2</></></><LISTITEM><PARA>
 
-A file with key-value pairs on every line, 
-separated by whitespace, sorted by key. 
+The <OPTION>-f</>-option defines the path of the file-1.
 
+</PARA><PARA>
+
+The version for antique ``<OPTION>-i</>'' mode.
+
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt unordered}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>unordered,<REPLACEABLE>path-to-file-2</></></><LISTITEM><PARA>
 
-A file with key-value pairs on every line, 
-separated by whitespace. 
+The <OPTION>-f</>-option defines the path of the file-1.
+
+</PARA><PARA>
 
+The version for antique ``<OPTION>-i</>'' mode.
+
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt hostsfile}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>hostsfile</></TERM><LISTITEM><PARA>
+
+The <OPTION>-f</>-option defines the path of the file.
+(In theory...)
 
-{\em hosts(5)} file.
+</PARA><PARA>
 
+A rather theorethical database looking into <EMPHASIS>hosts(5)</>
+database file (often <FILENAME>/etc/hosts</>).
+
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt bind}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>bind/query-subtype</></TERM><LISTITEM><PARA>
+
+The <OPTION>-f</>-option defines the path of the resolver configuration file.
+(Not implemented!)
 
+</PARA><PARA>
+
 The BIND implementation of a Domain Name System 
 resolver. The subtype for this type is the name of a Resource Record 
-type in the {\tt IN} class.
+type in the <LITERAL>IN</> class.
+
+</PARA><PARA>
+Supported subtypes are:
+<SIMPLELIST TYPE=INLINE>
+ <MEMBER>A</>
+ <MEMBER>AAAA</>
+ <MEMBER>ANY</>
+ <MEMBER>CNAME</>
+ <MEMBER>MX</>
+ <MEMBER>MXLOCAL</>
+ <MEMBER>MXWKS</>
+ <MEMBER>PTR</>
+ <MEMBER>TXT</>
+ <MEMBER>UINFO</>
+ <MEMBER>WKS</>
+</SIMPLELIST>
+</PARA><PARA>
+
+FIXME! FILL DETAILS! (About the return values)
 
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt ndbm}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>ndbm</></TERM><LISTITEM><PARA>
+
+The <OPTION>-f</>-option defines the base path of the files, and the NDBM
+appends ``.pag'' and ``.dir'' to each file.
+
+</PARA><PARA>
 
-The new DBM library. The BSD4.4 has a thing called 
-{\tt db}, which is a different thing, but it can be used in place 
-of {\tt ndbm} via its interface library. (The {\tt BSD4.4-db} 
-does have only one database file, not two, like {\tt ndbm} does.)
+The newer DBM as created at (I think) BSD 4.2.
+This is two-file database with API utilizing nonglobal API, that is,
+multiple databases can be open simultaneously.
+This appends .dir and .pag to the supplied name!
 
+</PARA><PARA>
+
+Limitation: The length of <EMPHASIS>key</> plus the length of <EMPHASIS>data</>
+must not exceed 1024 bytes.
+With certain kinds of alias databases this may be too low limit!
+
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt gdbm}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>dbm</></TERM><LISTITEM><PARA>
+
+The <OPTION>-f</>-option defines the base path of the files, and the DBM
+appends ``.pag'' and ``.dir'' to each file.
+
+</PARA><PARA>
+
+The old ATT DBM library with even worse limitations than <OPTION>ndbm</> has.
+Avoid if you can.  (ZMailer can manage with this also, each lookup is done
+by opening the DB, and closing immediately after wards.)
+
+</PARA><PARA>
+
+Some versions of ATT DBM <EMPHASIS>did not</> contain externally callable
+<FUNCTION>close</>() function!  ZMailer propably won't work at such a system
+anyway...
+
+</PARA></LISTITEM></VARLISTENTRY>
+<VARLISTENTRY><TERM><OPTION>gdbm</></TERM><LISTITEM><PARA>
+
+The <OPTION>-f</>-option defines the path of the database file,
+the GDBM does not append anything to the name.
+
+</PARA><PARA>
 
 The GNU implementation of the new DBM library. 
-{\bf Note:} GDBM uses one file, which is named exactly as you 
-parametrize it. This is unlike NDBM, which appends .dir and .pag to 
-the supplied name!
+Note: GDBM uses one file, which is named exactly as you parametrize it.
+This is unlike NDBM, which appends .dir and .pag to the supplied name!
 
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt dbm }</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>yp,<REPLACEABLE>mapname</></></><LISTITEM><PARA>
+The Network Information Service from Sun Microsystems Inc.
+(Later renamed to be NIS, the still newer NIS+ is not supported).
+
+</PARA><PARA>
+
+The <OPTION><REPLACEABLE>mapname</></> ``subtype'' passes knowledge
+about which YP-map the query is to be done from.
+
+</PARA><PARA>
 
-The old DBM library. There can be only one DBM 
-open at the time, and this system keeps them all open all the time. 
-Avoid if you can.
+The <OPTION>-f</>-option is used to pass the <EMPHASIS>YP-domain</>
+information to the interface.
 
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt yp}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>btree</></TERM><LISTITEM><PARA>
+
+SleepyCat DB 1.x, 2.x or 3.x B-Tree database
 
-The Network Information Service from Sun Microsystems 
-Inc. (Later renamed to be NIS, the still newer NIS+ is not supported).
+</PARA><PARA>
 
+The <OPTION>-f</>-option defines the path of the database file,
+the SleepyCat DB does not append anything to the name.
+(This is true with versions 1.x and 2.x, version 3.x is not yet supported.)
+
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt btree}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>bhash</></TERM><LISTITEM><PARA>
+
+SleepyCat DB 1.x, 2.x or 3.x HASH database
 
+</PARA><PARA>
+
+The <OPTION>-f</>-option defines the path of the database file,
+the SleepyCat DB does not append anything to the name.
+(This is true with versions 1.x and 2.x, version 3.x is not yet supported.)
+
 </PARA></LISTITEM></VARLISTENTRY>
-</VARIABLELIST>
+<VARLISTENTRY><TERM><OPTION>selfmatch</></TERM><LISTITEM><PARA>
 
+Given address literal <EMPHASIS>without</> wrapping square brackets,
+this ``database'' decodes the address, and checks if presented IP
+address is one used by the system at the moment.
 
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt -f file}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>ldap</></TERM><LISTITEM><PARA>
+
+FIXME! WRITEME!
+
+</PARA></LISTITEM></VARLISTENTRY>
+</VARIABLELIST>
+
 
-A file associated with the database, typically 
-the file containing the data, or the basename of DBM files or something 
-similarly relevant to the database access routine. 
+</PARA></LISTITEM></VARLISTENTRY>
+<VARLISTENTRY><TERM><OPTION>-f <REPLACEABLE>file</></></TERM><LISTITEM><PARA>
+A file associated with the database, typically the file containing the data,
+or the basename of DBM files or something similarly relevant to the database
+access routine. 
 
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt -e\#}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>-e <REPLACEABLE>#</></></TERM><LISTITEM><PARA>
 
 The default time-to-live on cached information. 
-When the information has been in the cache for this many seconds, it 
-is discarded. The default is 0. 
+When the information has been in the cache for this many seconds,
+it is discarded. The default is 0.
 
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt -s\#}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>-s <REPLACEABLE>#</></></TERM><LISTITEM><PARA>
 
 Sets the cache size to the specified number. 
 The default is usually 10, depending on the database type. 
 
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt -b}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>-b</></TERM><LISTITEM><PARA>
 
 If the key exists in the database, return the key 
-as the value. 
+as the value. (``Boolean relation'')
 
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt -i}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>-i</></TERM><LISTITEM><PARA>
 
 If the key exists, its value is a byte offset into 
 a file named by the subtype for this database. The value then becomes 
 the concatenation of the data on the lines following that offset which 
-start with whitespace. This is used for the aliases file. 
+start with whitespace.
+</PARA><PARA>
+
+This was used for the aliases file back in early 1990, and is usable
+only with <OPTION>ordered</>, and <OPTION>unordered</> database types.
+</PARA><PARA>
+
+(FIXME! IMPLEMENT?  To think of it, this makes eminently sense also
+ for <OPTION>dbm</>, and <OPTION>ndbm</> which have data size limitations.
+ But then, SleepyCat DB is recommended for internal databases anyway.)
 
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt -l}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>-l</></TERM><LISTITEM><PARA>
 
-Map all keys to lowercase before searching.
+Map all keys to ASCII lowercase before searching.
 
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt -m}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>-m</></TERM><LISTITEM><PARA>
+
+Check for file content modification before every access.
+Reopen the file when a change is detected.
+</PARA><PARA>
+
+This option is used when the <COMMAND>router</> should discover
+changes to a database underfoot so it need not be restarted to
+use new data.
+</PARA><PARA>
 
-Check for file content modification before every 
-access. Reopen the file when a change is detected. This option is 
-used when the {\em router} should discover changes to a database
-underfoot so it need not be restarted to use new data. This is 
-recommended on relations which use unordered, or ordered datasets 
-(aliases, routes, ...), and especially if the system is configured 
-to use {\tt mmap(2)} facility. Updating such databases should 
-preferably use {\tt mv} command to move a new version of the 
-database in place of the old one. 
+This is recommended on relations which use unordered, or ordered
+datasets (aliases, routes, ...), and especially if the system is
+configured to use <FUNCTION>mmap(2)</> facility.
+Updating such databases should preferably use <COMMAND>mv</> command
+to move a new version of the database in place of the old one.
 
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt -n}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>-n</></TERM><LISTITEM><PARA>
 
-If the key exists in the database and the value is 
-null or list, return the key as value. Otherwise return the value 
-retrieved, if any. 
+If the key exists in the database and the value is null or list,
+return the key as value.
+Otherwise return the value retrieved, if any. 
 
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt -u}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>-u</></TERM><LISTITEM><PARA>
 
-Map all keys to uppercase before searching. 
+Map all keys to ASCII uppercase before searching. 
 
 </PARA></LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>{\tt -d driver}</TERM><LISTITEM><PARA>
+<VARLISTENTRY><TERM><OPTION>-d <REPLACEABLE>[pathalias|pathalias.nodot|longestmatch]</></></TERM><LISTITEM><PARA>
 
-Specifies a search driver that allows
-searching for structured keys using special knowledge. The 
-argument to this option must be a known driver. Currently the 
-only known driver is {\tt pathalias} which will search a
-pathalias format database for an entry matching a domain name 
-using the pathalias rules.
+Specifies a search driver that allows searching for structured keys using
+special knowledge.
+The argument to this option must be a known driver.
+</PARA><PARA>
+FIXME! WRITEME! WRITE MORE!
+
+</PARA></LISTITEM></VARLISTENTRY>
+<VARLISTENTRY><TERM><OPTION>-%</></TERM><LISTITEM><PARA>
+We shall do positional parameter substitutions (``%0'' thru ``%9'')
+on database lookup result data. [XREF??]
+
+</PARA><PARA>
+The <COMMAND>zmailer newdb</> configuration file
+<FILENAME>$<VARNAME>MAILVAR</>/dbases.conf</> uses presense of
+``%'' to signal this aspect of relation wrapper generation.
+ [XREF??]
+
+</PARA></LISTITEM></VARLISTENTRY>
+<VARLISTENTRY><TERM><OPTION>-:</></TERM><LISTITEM><PARA>
+Actually this is <EMPHASIS>ignored</> if present, the
+<COMMAND>zmailer newdb</> configuration file
+<FILENAME>$<VARNAME>MAILVAR</>/dbases.conf</> uses presense of
+``:'' to signal certain aspects of relation wrapper generation.
+ [XREF??]
 
 </PARA></LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
Index: zmailer/doc/manual/zref-scheduler.sgml
diff -u zmailer/doc/manual/zref-scheduler.sgml:1.11 zmailer/doc/manual/zref-scheduler.sgml:1.13
--- zmailer/doc/manual/zref-scheduler.sgml:1.11	Wed Feb 21 18:20:26 2001
+++ zmailer/doc/manual/zref-scheduler.sgml	Thu Mar  8 00:31:29 2001
@@ -3,6 +3,17 @@
 <CHAPTER ID="ZREF-SCHEDULER"><?dbhtml filename="zref-scheduler.html">
 <TITLE><COMMAND>Scheduler</> Reference</TITLE>
 
+<PARA><SCREEN>
+... deeper details of internal protocols and algorithms
+ - Configuration Language Syntax Details (?)
+ - Resource Management
+ - What and how  scheduler.auth  can be tuned
+   - Security issues
+ - Diagnostics reporting, canned messages (forms/* files)
+ - (MAILQv1/)MAILQv2 protocol for MAILQv2 client writer
+ - Scheduler-TA interface
+</SCREEN></PARA>
+
 <PARA>
 The <COMMAND>scheduler</> daemon manages the delivery processing
 of messages in ZMailer.
@@ -220,12 +231,12 @@
 </LISTITEM></VARLISTENTRY>
 </VARIABLELIST>
 
+
+<SECT1 ID="zref-scheduler-scheduler.conf-language"><TITLE>Configuration Language</TITLE>
 
-<SECT1 ID="zref.schedulerconfig"><TITLE>Configuration Language</TITLE>
-<!--
 <SCREEN>
 \index{{\tt scheduler.conf} file}\index{scheduler, {\tt scheduler.conf}}
-</SCREEN> -->
+</SCREEN>
 
 <PARA>
 The <COMMAND>scheduler</> configuration file consists of a set of clauses. 
@@ -247,7 +258,7 @@
 </ITEMIZEDLIST>
 </PARA>
 
-<SECT2 ID="scheduler.param.entries"><TITLE>PARAM-entries</TITLE>
+<SECT2 ID="zref-scheduler-param-entries"><TITLE>PARAM-entries</TITLE>
 
 <PARA>
 There are three kinds of PARAM entries, all of them start at the column
@@ -275,7 +286,7 @@
 
 <PARA>
 The <EMPHASIS>PARAMauthfile</> defines Scheduler's MAILQv2 authentication
-file; more at <XREF LINKEND="zref.scheduler.auth.file">.
+file; more at <XREF LINKEND="zref-scheduler-scheduler.auth">.
 </PARA>
 
 <PARA>
@@ -297,7 +308,7 @@
 </SECT2>
 
 
-<SECT2 ID=zref-sch-group-clause-selection>
+<SECT2 ID=zref-scheduler-group-clause-selection>
 <TITLE>Group-Clause selection</TITLE>
 
 <PARA>
@@ -344,7 +355,7 @@
 
 </SECT2>
 
-<SECT2 ID=zref-sch-clause-components>
+<SECT2 ID=zref-scheduler-clause-components>
 <TITLE>Clause components</TITLE>
 
 <PARA>
@@ -406,7 +417,7 @@
 
 </SECT2>
 
-<SECT2 ID=zref-sch-vars-and-keywords>
+<SECT2 ID=zref-scheduler-vars-and-keywords>
 <TITLE>Variables and keywords</TITLE>
 
 <PARA>
@@ -487,7 +498,7 @@
 <VARLISTENTRY><TERM><OPTION>maxring=nn</> (0)</TERM>
 	      <TERM>(<OPTION>maxrings=nn</>)</TERM><LISTITEM><PARA>
 Recipients are groupped into
-  <LINK LINKEND="zref.sched.threads"><EMPHASIS>threads</></>, 
+  <LINK LINKEND="zadm-scheduler-threads"><EMPHASIS>threads</></>, 
 and similar threads are groupped into <EMPHASIS>thread-rings</>, where same 
 transport agent can be switched over from one recipient to another.
 This defines how many transport agents can be running at any time at the ring.
@@ -699,7 +710,7 @@
 </SECT2>
 </SECT1>
 
-<SECT1 ID=zref-sch-resource-management>
+<SECT1 ID=zref-scheduler-resource-management>
 <TITLE>Resource Management</TITLE>
 
 <PARA>
@@ -739,7 +750,7 @@
 
 </SECT1>
 
-<SECT1 ID="zref.scheduler.auth.file">
+<SECT1 ID="zref-scheduler-scheduler.auth">
 <TITLE><FILENAME>scheduler.auth</> file</TITLE>
 
 <PARA>
@@ -790,7 +801,7 @@
 </FIGURE>
 </SECT1>
 
-<SECT1 ID=zref-sch-mailq-cmd>
+<SECT1 ID=zref-scheduler-mailq-cmd>
 <TITLE><COMMAND>mailq</></TITLE>
 
 <PARA>FIXME! FIXME!</PARA>
@@ -907,11 +918,88 @@
 
 </SECT1>
 
-<SECT1 ID=zref-sch-security-issues>
-<TITLE>Security Issues</TITLE>
+<SECT1 ID=zref-scheduler-ta-interface>
+<TITLE>Transport Agent Interface Protocol</TITLE>
+
+<PARA>
+The transport agent interface follows a master-slave model,
+where the TA informs the scheduler that it is ready for the work,
+and then the scheduler sends it one job  description, and waits
+for diagnistics.
+Once the job is finished, the TA notifies the scheduler that it is
+ready for a new job.
+</PARA>
+
+<PARA>
+A short sample session looks like this:
+<SCREEN>
+<EMPHASIS>(start the transport agent)</>
+#hungry                <EMPHASIS>--&gt; (TA to scheduler)</>
+spoolid \t hostspec    <EMPHASIS>&lt;-- (scheduler to TA)</>
+diagnostics            <EMPHASIS>--&gt; (TA to scheduler)</>
+#hungry                <EMPHASIS>--&gt; (TA to scheduler)</>
+...</SCREEN></PARA>
 
+<PARA>
+Normal diagnostic output is of the form:
 <SCREEN>
-Text to be inserted here.
+  id / offset \t notarydata \t status message
 </SCREEN>
+where:
+<VARIABLELIST>
+<VARLISTENTRY><TERM>id</TERM><LISTITEM><PARA>
+is the inode number of the message file,
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM>offset</TERM><LISTITEM><PARA>
+is a byte offset within its control file where the address
+being  reported on  is kept,
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM>notarydata</TERM><LISTITEM><PARA>
+is a <EMPHASIS>Ctrl-A</> separated tuple is delivery-status-notification
+information for  the message, 
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM>status</TERM><LISTITEM><PARA>
+is one of:<EMPHASIS>ok, ok2, ok3, error, error2, deferred, retryat</>
+</PARA></LISTITEM></VARLISTENTRY>
+
+<VARLISTENTRY><TERM>message</TERM><LISTITEM><PARA>
+is descriptive text associated with the report.
+The text is terminated by a linefeed.
+</PARA></LISTITEM></VARLISTENTRY>
+</VARIABLELIST></PARA>
+
+<PARA>
+Any other format (as might be produced by subprocesses) is passed
+to standard output for logging in the scheduler log.
+The <EMPHASIS>retryat</> response will assume the first word of the text
+is a numeric parameter, either an incremental time in seconds if prefixed
+by ``+'', or otherwise an absolute time in seconds since UNIX epoch.
+</PARA>
+
+<PARA>
+The exit status is a code from
+<FILENAME CLASS="HEADERFILE">&lt;sysexits.h&gt;</>.
+</PARA>
+
+</SECT1>
+
+<SECT1 ID=zref-scheduler-forms-files>
+<TITLE>Canned (Error) Message Files</TITLE>
+
+<PARA>
+FIXME! TEXT TO BE INSERTED HERE.
+</PARA>
+</SECT1>
+
+
+<SECT1 ID=zref-scheduler-security-issues>
+<TITLE>Security Issues</TITLE>
+
+<PARA>
+FIXME! TEXT TO BE INSERTED HERE.
+</PARA>
 </SECT1>
 </CHAPTER>
Index: zmailer/doc/manual/zref-smtpserver.sgml
diff -u zmailer/doc/manual/zref-smtpserver.sgml:1.10 zmailer/doc/manual/zref-smtpserver.sgml:1.12
--- zmailer/doc/manual/zref-smtpserver.sgml:1.10	Wed Feb 21 18:20:26 2001
+++ zmailer/doc/manual/zref-smtpserver.sgml	Mon Feb 26 19:42:00 2001
@@ -476,7 +476,7 @@
 
 <FIGURE ID="fig.ref.smtpserver2">
 <TITLE>Full-featured <FILENAME>smtpserver.conf</> file example</TITLE>
-<SCREEN>
+<PROGRAMLISTING>
 #
 # {\rm{}smtpserver.conf - autogenerated edition}
 #
@@ -493,7 +493,7 @@
 PARAM expncmd
 PARAM vrfycmd
 
-PARAM help -------------------------------------------------------------
+PARAM help =============================================================
 PARAM help  This mail-server is at Yoyodyne Propulsion Inc.
 PARAM help  Our telephone number is: +1-234-567-8900, and
 PARAM help  telefax number is: +1-234-567-8999
@@ -502,7 +502,7 @@
 PARAM help  Questions regarding our email service should be sent via
 PARAM help  email to address  &lt;postmaster@OURDOMAIN&gt;
 PARAM help  Reports about abuse are to be sent to: &lt;abuse@OURDOMAIN&gt;
-PARAM help -------------------------------------------------------------
+PARAM help =============================================================
 
 # {\rm{}Uncomment following for not to strip incoming addresses of format:}
 # &lt;@aa,@bb:cc@dd&gt;  into non-source-routed base form: &lt;cc@dd&gt;
@@ -525,14 +525,14 @@
 # {\rm{}The syntax below is due to these patterns being SH-GLOB patterns,}
 # {\rm{}where brackets are special characters.}
 
-[*]                 999 ve
+\[*\]               999 ve
 
 # {\rm{}Per default demant strict syntactic adherence, including fully}
 # {\rm{}qualified addresses for  MAIL FROM, and RCPT TO.  To be lenient}
 # {\rm{}on that detail, remove the "R" from "veR" string below:}
 
 *                   999 veR
-</SCREEN>
+</PROGRAMLISTING>
 </FIGURE>
 </SECT2>
 </SECT1>
@@ -645,8 +645,8 @@
 </SCREEN>
 </SECT1>
 
-<SECT1 ID="zref-smtpserver-policy-filtering">
-<TITLE>Policy Filtering Language</TITLE>
+<SECT1 ID=zref-smtpserver-policy-relaying>
+<TITLE>Relaying Control Policy Language</TITLE>
 <!-- \index{smtp!policy filtering, reference} -->
 
 <SCREEN>
@@ -917,4 +917,96 @@
 </SCREEN>
 </SECT2>
 </SECT1>
+
+
+<SECT1 ID="zref-smtpserver-content-filter">
+<TITLE>Content Based Filtering</TITLE>
+<INDEXTERM ID=zref-smtps-content-filtering1><PRIMARY><FILENAME>smtpserver.conf</></><SECONDARY>input content filters, reference</></>
+<INDEXTERM ID=zref-smtps-content-filtering2><PRIMARY>SMTP input</><SECONDARY>content filtering, reference</></>
+
+<PARA>
+The ZMailer <COMMAND>smtpserver</> <EMPHASIS>can</> do also message content
+analysis with an external program at the end of
+ <EMPHASIS ROLE=STRONG>DATA-dot</>-phase, and
+ <EMPHASIS ROLE=STRONG>BDAT LAST</>-phase
+(that is, when the input message is complete, and final acknowledgement is
+expected by the email sender.)
+</PARA>
+
+<PARA>
+The program becomes active if PARAM entry ``contentfilter''  is set:
+
+<PROGRAMLISTING>
+<![CDATA[
+# External program for received message content analysis:
+#PARAM  contentfilter	$MAILBIN/smtp-contentfilter
+]]>
+</PROGRAMLISTING>
+</PARA>
+
+<PARA>
+The interface to the program is simple synchronous half-duplex one,
+smtpserver writes relative filepath of the message into programs stdin,
+ending it with a newline.
+The filter programs reply must begin with a signed integer, then whatever
+text is desired to give to the user.
+</PARA>
+
+<PARA>
+The <EMPHASIS>contentfilter</> program is started without parameters
+running userid of <LITERAL>daemon</> in directory
+<FILENAME CLASS=DIRECTORY>$<VARNAME>POSTOFFICE</>/</>.
+</PARA>
+
+<PARA>
+The program must silently wait for input, which is full path to the message
+spool file, analyze it, and reply with exactly one line matching rule of:
+ ``<LITERAL>%i </>''
+&mdash; begin with signed integer, then have one or more whitespace,
+then whatever filter writer liked to tell.
+</PARA>
+
+<PARA>
+General rule:
+<SCREEN>
+ -1 negatives are condemned into rejection
+  0 zero is ok! gladly accepted
+  1 positives are sent into the freezer
+</SCREEN>
+</PARA>
+
+<PARA>
+The program <EMPHASIS>may</> produce also the numeric SMTP reply codes
+in its response text:
+<SCREEN>
+ -1
+ -1 250 2.7.1 Glad to see some spam, immediately destroyed :)
+  0
+  0 250 2.6.0 Message OK!
+  1
+  1 550 5.7.1 That is spam, rejected!
+</SCREEN>
+</PARA>
+
+<PARA>
+If the message has no text, some defaults are supplied.
+If the message text starts with numbers, it is presumed
+that it contains both the SMTP reply code, and ENHANCEDSTATUSCODE
+before the text.  (If no ENHANCEDSTATUSCODE part is present,
+then some possibly senseless default is supplied.)
+</PARA>
+
+<PARA>
+Interface message text lines beginning with anything except signed integer
+are logged, and the communication channel from the smtpserver to the
+contentfilter program is closed.  Interface continues to scan things
+reported by the contentfilter program, and if no properly formatted line
+appears, default is to send the message into the freezer ("-1");
+<EMPHASIS>FIXME! FIXME! "-1" == Kill ??? (Copy&amp;paste from man-page,
+which may have a bug in it..)</>
+</PARA>
+
+</SECT1>
+
+
 </CHAPTER>
Index: zmailer/doc/manual/zref-transport-agents.sgml
diff -u zmailer/doc/manual/zref-transport-agents.sgml:1.7 zmailer/doc/manual/zref-transport-agents.sgml:1.9
--- zmailer/doc/manual/zref-transport-agents.sgml:1.7	Wed Feb 14 20:51:42 2001
+++ zmailer/doc/manual/zref-transport-agents.sgml	Mon Feb 26 19:42:00 2001
@@ -15,6 +15,14 @@
 <SECT1 ID=zref-ta-mailbox>
 <TITLE><COMMAND>mailbox</></TITLE>
 
+<PARA><SCREEN>
+- All options
+- Internal Logic
+- Tuning issues
+- Customizability
+- Logging ? (or move that to ADM?)
+</SCREEN></PARA>
+
 <PARA>
 The <COMMAND>mailbox</> is a ZMailer transport agent which is usually
 only run by the <COMMAND>scheduler</>(8) program to deliver mail to
@@ -350,6 +358,13 @@
 <SECT1 ID=zref-ta-hold>
 <TITLE><COMMAND>hold</></TITLE>
 
+<PARA><SCREEN>
+- All options
+- Internal Logic
+- Tuning issues
+- Logging ? (or move that to ADM?)
+</SCREEN></PARA>
+
 <PARA>
 <COMMAND>hold</> - zmailer deferred processing transport agent
 </PARA>
@@ -479,6 +494,13 @@
 <SECT1 ID=zref-ta-smtp>
 <TITLE><COMMAND>smtp</></TITLE>
 
+<PARA><SCREEN>
+- All options
+- Internal Logic at conversions
+- SMTP vs. LMTP
+- Tuning issues
+- Logging ? (or move that to ADM?)
+</SCREEN></PARA>
 
 <PARA>
 <COMMAND>smtp</> - zmailer SMTP client transport agent
@@ -677,6 +699,13 @@
 <SECT1 ID=zref-ta-sm>
 <TITLE><COMMAND>sm</> - zmailer Sendmail compatible transport agent</TITLE>
 
+<PARA><SCREEN>
+- ALL options, comparison against sendmail M-flags
+- Internal Logic (incl. conversions)
+- Tuning issues
+- Logging ? (or move that to ADM?)
+</SCREEN></PARA>
+
 <PARA>
 <COMMAND>sm</> is a ZMailer transport agent which is usually only run by
  the <COMMAND>scheduler(8)</>, to deliver messages by invoking a program
@@ -826,14 +855,37 @@
 <FIGURE ID="fig.ref.sample-sm-conf" PGWIDE="1" FLOAT="1">
 <TITLE>Sample <FILENAME>sm.conf</> file</TITLE>
 <SCREEN>
-#mailer flags program        argument list
-#&ddash;&ddash;&ddash; &ddash;&ddash;- &ddash;&ddash;&ddash;&ddash;&ddash;&ddash;&ddash; &ddash;&ddash;&ddash;&ddash;&ddash;&ddash;&ddash;&ddash;&ddash;&ddash;&ddash;&ddash;&ddash;&ddash;&ddash;&ddash;
-local   mS    sm/localm      localm -r $g $u
-prog    -     /bin/sh        sh -c $u
-tty     rs    /usr/local/to  to $u
-uucp    U     /usr/bin/uux   uux - -r -a$g -gC $h!rmail ($u)
-usenet  m     sm/usenet      usenet $u
-test    n     sm/test        test $u
+#
+# M          F =     P =                             A =
+# the following entries are in active use at this site:
+uucp        U   /usr/bin/uux          uux - -r -a$g -gC $h!rmail ($u)
+usenet      m   ${MAILBIN}/ta/usenet  usenet $u
+#
+bitbucket   -  @MAILBIN@/ta/bitbucket  bitbucket
+#
+#
+# bitnet stuff F=hu not set?
+#
+bsmtp3      snmSX /usr/local/funetnje/bmail bmail -b $h $g $u
+bsmtp3rfc   snmSX /usr/local/funetnje/bmail bmail -b $h $g $u
+bsmtp3nd    snmSX /usr/local/funetnje/bmail bmail -nd $h $g $u
+bsmtp3ndrfc snmSX /usr/local/funetnje/bmail bmail -nd $h $g $u
+defrt1      snS   /usr/local/funetnje/bmail bmail $g $u
+bitnet2     snS   /usr/local/funetnje/bmail bmail $g $u
+#
+# the following entries are included to illustrate other possibilities
+#
+#local  mS  /usr/lib/mail/localm            localm -r $g $u
+cyrus   Pn  /usr/cyrus/bin/deliver          deliver -e -m $h -- $u
+#           # CYRUS example from: Tom Samplonius &lt;tom@sdf.com>
+procm sSPfn @PROCMAIL@      procmail -a $h -d $u
+#           # Procmail example from: Ken Pizzini &lt;ken@spry.com>
+#
+#prog  -    /bin/sh                         sh -c $u
+#tty   rs   /usr/local/to                   to $u
+#ean   mn   /local/lib/ean/mailer           mailer -d $u
+#test  n    /local/lib/mail/bin/test        test $u
+#
 </SCREEN>
 </FIGURE>
 
@@ -963,6 +1015,14 @@
 <SECT1 ID=zref-ta-expirer>
 <TITLE><COMMAND>expirer</></TITLE>
 
+<PARA><SCREEN>
+- All options
+- Internal Logic
+- Tuning issues
+- Logging ? (or move that to ADM?)
+</SCREEN></PARA>
+
+
 <PARA>
 FIXME! FIMXE!  write me..
 (about the tool to kill out messages from the queue)
@@ -1005,7 +1065,7 @@
 
 </SECT2>
 
-<SECT2 ID=zref-ta-libta-fucntion-usage-examples>
+<SECT2 ID=zref-ta-libta-function-usage-examples>
 <TITLE>Function usage examples</TITLE>
 
 <PARA>
Index: zmailer/doc/manual/zref-utilities.sgml
diff -u zmailer/doc/manual/zref-utilities.sgml:1.12 zmailer/doc/manual/zref-utilities.sgml:1.14
--- zmailer/doc/manual/zref-utilities.sgml:1.12	Wed Feb 21 18:20:26 2001
+++ zmailer/doc/manual/zref-utilities.sgml	Mon Mar 12 11:12:34 2001
@@ -6,170 +6,368 @@
 Not all of them even become installed into your system in all situations.
 </PARA>
 
+<!-- ============================================================ -->
 
+
 <SECT1 ID="zref.util.zmailer">
 <TITLE><COMMAND>zmailer</> command script</TITLE>
 
 <PARA>
-FIXME! FIXME! TO BE WRITTEN!
-subsections for each function ??
+The <COMMAND>zmailer</> command script is a wrapper for driving various
+sub-utilities, and in some cases, honouring flags like ``freeze-state'',
+which administrator may set to keep system down over reboots while some
+maintenance acitivity is under way.
 </PARA>
 
-</SECT1>
+<PARA>
+Plain ``<COMMAND>zmailer</>'' command is synonymous
+to ``<COMMAND>zmailer start</>''.
+</PARA>
 
-<SECT1 ID="zref.util.vacation">
-<TITLE><COMMAND>vacation</></TITLE>
+<!-- ============================================================ -->
+
+<SECT2 ID="zref-zmailer-bootclean">
+<TITLE><COMMAND>zmailer bootclean</></>
 
 <PARA>
-<COMMAND>vacation</> automatically replies to incoming mail.
-The canned reply is contained in the file <FILENAME>~/.vacation.msg</>,
-that you should create in your home directory (or the file
-<USERINPUT>Msgfile</> specified by the <OPTION>-m</> option).
+This removes all internal process reference PID files
+from <FILENAME CLASS=DIRECTORY>$<VARNAME>POSTOFFICE</>/</> directory.
+</PARA><PARA>
+<EMPHASIS>Highly recommended for your system startup scripts before
+starting servers</EMPHASIS>
 </PARA>
+</SECT2>
+
+<!-- ============================================================ -->
+
+<SECT2 ID="zref-zmailer-start">
+<TITLE><COMMAND>zmailer start</></>
 
 <PARA>
-This file should include a header with at least
-a <QUOTE><LINK LINKEND="rfc822.subject">Subject:</></> line
-(it should not include a <QUOTE><LINK LINKEND="rfc822.to">To:</></> line
-&mdash; if you want, you may include
-<QUOTE><LINK LINKEND="rfc822.from">From:</></> line,
-especially if you use the <OPTION>-m</> option), for example.
+Without further parameters this starts the entire ZMailer system by
+starting subservers:
+<COMMAND>smtpserver</>, <COMMAND>router</>, and <COMMAND>scheduler</>.
 </PARA>
 
-<VARIABLELIST>
-<VARLISTENTRY><TERM>Usage:</><LISTITEM>
+<PARA>
+Giving parameter (one or more of subsystem names above) (re)starts
+just that (or those) subsystem(s).
+</PARA>
 
 <PARA>
-To start <COMMAND>vacation</>, run the command <USERINPUT>vacation start</>.
-It will create a <FILENAME>~/.vacation.msg</> file (if you don't already 
-have one) in your home directory containing the message you want to send 
-people who send you mail, and a <FILENAME>~/.forward</> file in your home 
-directory containing a line of the form:
-<SYNOPSIS>
-  "\name", "|/opt/mail/bin/vacation name"
-</SYNOPSIS>
+If the system is in ``frozen'' state, start fails.
+See ``<COMMAND>zmailer freeze</>'' below.
+</PARA>
 
-where name is your login name. Make sure these files and your home 
-directory are readable by everyone.
-Also make sure that no one else can write to them, and that no one can
-write to your home directory.
-Like this:
-<SYNOPSIS>
-  chmod og-w $HOME $HOME/.forward
-</SYNOPSIS>)
+</SECT2>
+
+
+<!-- ============================================================ -->
+
+<SECT2 ID="zref-zmailer-stop">
+<TITLE><COMMAND>zmailer stop</>, <COMMAND>zmailer kill</></>
+
+<PARA>
+Without further parameters, this terminates the main daemons of the ZMailer
+(<COMMAND>smtpserver</>, <COMMAND>router</>, and <COMMAND>scheduler</>)
+by sending <CONSTANT>SIGTERM</> to them.
 </PARA>
 
 <PARA>
-To stop vacation, run the command <COMMAND>vacation stop</>.
-It will move the <FILENAME>~/.forward</> file to <FILENAME>~/.vacforward</>,
-and the automatic replies will stop.
+Giving parameter (one or more of subsystem names above) stops
+just that (or those) subsystem(s).
 </PARA>
 
-<SYNOPSIS>
-vacation start vacation stop vacation -I vacation [ -tN ] [ -mMsgfile ] [ -d ] [user]
-</SYNOPSIS>
+</SECT2>
 
-</LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>Parameters:</TERM><LISTITEM>
+<!-- ============================================================ -->
 
-<!-- VARIABLELIST -->
-<SCREEN>
-\item[{\tt -I}, {\tt -i}] \mbox{}
+<SECT2 ID="zref-zmailer-nuke">
+<TITLE><COMMAND>zmailer nuke</></>
 
-initialize the {\tt .vacation.pag} 
-and {\tt .vacation.dir} files and start vacation.
+<PARA>
+Without further parameters, this kills the main daemons of the ZMailer.
+(<COMMAND>smtpserver</>, <COMMAND>router</>, and <COMMAND>scheduler</>)
+by sending <CONSTANT>SIGKILL</> to them.
+</PARA>
 
-If the {\tt -I} (or {\tt -i}) flag is not specified, vacation 
-tries to reply to the sender.
+<PARA>
+Giving parameter (one or more of subsystem names above) stops
+just that (or those) subsystem(s).
+</PARA>
 
-\item[{\tt -tN}] \mbox{}
+</SECT2>
 
-Change the interval between repeat replies to the same 
-sender. The default is one week. A trailing {\tt s}, {\tt m}, 
-{\tt h}, {\tt d}, or {\tt w} scales N to seconds, minutes, 
-hours, days, or weeks respectively.
 
-\item[{\tt -mMsgfile}] \mbox{}
+<!-- ============================================================ -->
 
-specifies the file in which the message to be 
-sent is kept. 
-The default is {\tt \$HOME/.vacation.msg}.
+<SECT2 ID="zref-zmailer-router">
+<TITLE><COMMAND>zmailer router</></>
 
-\item[{\tt -r}] \mbox{}
+<PARA>
+Synonym to ``<COMMAND>zmailer start router</>'', (re)starts
+the <COMMAND>router</> process(es).
+</PARA>
+</SECT2>
 
-interval defines interval in days when not to answer 
-again to the same sender. (Default is 1 day.)
 
-\item[{\tt -d}] \mbox{}
+<!-- ============================================================ -->
 
-disables the list of senders kept in the 
-{\tt .vacation.pag} and {\tt .vacation.dir} files.
+<SECT2 ID="zref-zmailer-scheduler">
+<TITLE><COMMAND>zmailer scheduler</></>
 
-\end{description}
-</SCREEN>
+<PARA>
+Synonym to ``<COMMAND>zmailer start router</>'', (re)starts
+the <COMMAND>scheduler</> process.
+</PARA>
+</SECT2>
 
-</LISTITEM></VARLISTENTRY>
-<VARLISTENTRY><TERM>Example:</TERM><LISTITEM>
+<!-- ============================================================ -->
 
-<SCREEN>
-  Subject: I am on vacation
+<SECT2 ID="zref-zmailer-smtpserver">
+<TITLE><COMMAND>zmailer smtp(server)</></>
 
-  I am on vacation until July 22. If you have something urgent, please 
-  contact Joe Jones (joe@blah.utoronto.ca). --john
-</SCREEN>
+<PARA>
+Synonym to ``<COMMAND>zmailer start router</>'', (re)starts
+the <COMMAND>smtpserver</> process.
+</PARA>
+</SECT2>
+
+<!-- ============================================================ -->
 
+<SECT2 ID="zref-zmailer-newdb">
+<TITLE><COMMAND>zmailer newdb</></>
+
 <PARA>
-No message is sent if the ``user'' specified in the vacation command
-(if nothing is specified, it uses your username) does not appear explicitly
-in the ``To:'' or ``Cc:'' lines of the message, which prevents messages from
-being sent back to mailing lists and causing loops.
+A complicated subsystem on its own merits used to re-generate
+<COMMAND>router</> configuration data for various database lookups.
 </PARA>
 
 <PARA>
-A list of senders is kept in the files <FILENAME>~/.vacation.pag</> and 
-<FILENAME>~/.vacation.dir</> in your home directory.
-These are dbm database files.
-(Note: not all database systems have two files, either may be missing.)
-The vacation message is in <FILENAME>~/.vacation.msg</> and the automatic
-reply is activated by the <FILENAME>~/.forward</> (and saved in
-<FILENAME>~/.vacforward</>)
-The default vacation message is stored in <FILENAME>/opt/mail/vacation.msg</>
+This runs utility called ``<COMMAND>newdbprocessor</>'' with its
+only argument of ``<FILENAME>$<VARNAME>MAILVAR</>/db/dbases.conf</>''.
 </PARA>
+</SECT2>
 
+<!-- ============================================================ -->
+
+<SECT2 ID="zref-zmailer-newaliases">
+<TITLE><COMMAND>zmailer newal(iases)</></>
+
 <PARA>
-On machines running ZMailer, the ``name'' argument to <COMMAND>vacation</>
-is optional, and the $USER environment variable is used to determine where
-to look for the message and the list of previous recipients.
+Re-generates ``<FILENAME>aliases</>'' database, wrapper of
+``<COMMAND>newaliases</>'', and superceded by <COMMAND>zmailer newdb</>.
 </PARA>
+</SECT2>
+
+<!-- ============================================================ -->
 
+<SECT2 ID="zref-zmailer-newfqdnaliases">
+<TITLE><COMMAND>zmailer newf(qdnaliases)</></>
+
 <PARA>
-The $SENDER} variable is checked first to determine the reply destination.
-It is normally set to the SMTP ``MAIL FROM:'' address or equivalent.
-This is an additional safeguard against sending replies to mailing lists,
-the PostMaster or the mailer daemon, since standards and common sense dictate
-that it never points back to an address that could cause a loop.
-The ``From '' line is used only as a last resort.
+Re-generates ``<FILENAME>fqdnaliases</>'' database, wrapper of
+``<COMMAND>newfqdnaliases</>'', and superceded by <COMMAND>zmailer newdb</>.
 </PARA>
-</LISTITEM></VARLISTENTRY>
-</VARIABLELIST>
+</SECT2>
+
+<!-- ============================================================ -->
+
+<SECT2 ID="zref-zmailer-new-route">
+<TITLE><COMMAND>zmailer new-route(s)</></>
+
+<PARA>
+Compiles ``<FILENAME>routes</>'' database, and superceded
+by <COMMAND>zmailer newdb</>.
+</PARA>
+</SECT2>
+
+<!-- ============================================================ -->
+
+<SECT2 ID="zref-zmailer-new-localnames">
+<TITLE><COMMAND>zmailer new-local(names)</></>
+
+<PARA>
+Compiles ``<FILENAME>localnames</>'' database, and superceded
+by <COMMAND>zmailer newdb</>.
+</PARA>
+</SECT2>
+
+<!-- ============================================================ -->
+
+<SECT2 ID="zref-zmailer-logsync">
+<TITLE><COMMAND>zmailer logsync</></>
+
+<PARA>
+A special command sending signals to subsystems needing them for
+reopening their possibly long-living logfile opens.
+</PARA><PARA>
+To be used <EMPHASIS>after</> other methods have rotated the logfiles
+to new names, but before anything further is done to them.
+</PARA>
+
+<PARA>
+These days only the <COMMAND>scheduler</> needs it, and if you have
+a choice, use this only after the ``scheduler'' logfile is rotated.
+</PARA>
+</SECT2>
+
+
+<!-- ============================================================ -->
+
+<SECT2 ID="zref-zmailer-logrotate">
+<TITLE><COMMAND>zmailer logrotate</></>
+
+<PARA>
+Runs ZMailer sub-utility ``rotate-logs.sh''.
+</PARA>
+</SECT2>
+
+<!-- ============================================================ -->
+
+<SECT2 ID="zref-zmailer-resubmit">
+<TITLE><COMMAND>zmailer resubmit</></>
+
+<PARA>
+Moves files from <FILENAME CLASS=DIRECTORY>$<VARNAME>POSTOFFICE</>/deferred/</>
+to main <COMMAND>router</> input directory
+(<FILENAME CLASS=DIRECTORY>$<VARNAME>POSTOFFICE</>/router/</>.)
+</PARA>
+</SECT2>
+
+<!-- ============================================================ -->
+
+<SECT2 ID="zref-zmailer-cleanup">
+<TITLE><COMMAND>zmailer cleanup</></>
+
+<PARA>
+Run this from your root crontab!
+</PARA>
+
+<PARA>
+This cleans from <FILENAME CLASS=DIRECTORY>$<VARNAME>POSTOFFICE</>/public/</>
+files that are older than 2 days (48 hours), and from 
+<FILENAME CLASS=DIRECTORY>$<VARNAME>POSTOFFICE</>/postman/</> files with
+names starting with a digit and aged over 7 days.
+</PARA>
+</SECT2>
+
+<!-- ============================================================ -->
+
+<SECT2 ID="zref-zmailer-freeze">
+<TITLE><COMMAND>zmailer freeze</></>
+
+<PARA>
+This sets a flag which is honoured by subsystem start functions:
+<SCREEN>
+<PROMPT># </><USERINPUT>/opt/mail/bin/zmailer freeze</>
+freeze 
+<PROMPT># </><USERINPUT>/opt/mail/bin/zmailer router</>
+router Sorry, ZMailer is frozen, won't start anything until thawed !
+* CHECK THAT FREEZE CONDITION ISN'T DUE TO E.G. MAINTENANCE *
+</SCREEN>
+</PARA>
+</SECT2>
+
+<!-- ============================================================ -->
+
+<SECT2 ID="zref-zmailer-thaw">
+<TITLE><COMMAND>zmailer thaw</>, <COMMAND>zmailer unfr(eeze)</></>
+
+<PARA>
+Thaws the previously frozen ZMailer system so that <COMMAND>zmailer start</>
+will be able to start subsystems.
+</PARA>
+</SECT2>
+</SECT1>
+
+<!-- ============================================================ -->
+
+<SECT1 ID="zref.util.newdbprocessor">
+<TITLE>The <COMMAND>newdbprocessor</> script</TITLE>
+
+<PARA>
+FIXME! WRITEME!
+(See <XREF LINKEND=zapp-filefmts-database-fmts-dbases.conf> for
+the configuration file)
+<SCREEN>
+- Input file syntax
+- Supported database types, and what is done to them
+- Additional notes ?
+</SCREEN>
+</PARA>
+
 </SECT1>
 
+<!-- ============================================================ -->
+
+<SECT1 ID="zref.util.newdb">
+<TITLE>The <COMMAND>newdb</> script</TITLE>
+
+<PARA>
+This is elementary wrapper script building binary databases with
+<COMMAND>makedb</> utility into a temporary file, and replacing
+the old files with the new ones in proper order for the 
+<COMMAND>router</>'s automatic source change detecting relation 
+parameter {\tt -m} to work correctly.
+</PARA>
+
+<SCREEN>
+{\bf Usage}
+
+\begin{verbatim}
+newdb [-u|-l][-a][-s][-t dbtype] /db/path/basename [input-file-name]
+\end{verbatim}
+
+This script uses system {\tt ZCONFIG} file to find out the desired
+database type, and derives the actual database file names from the 
+variable.
+
+Suffix selection rules are:
+
+\begin{verbatim}
+dbm     .pag and .dir
+ndbm    .pag and .dir
+gdbm    .gdbm
+btree   .db
+bhash   .dbh
+\end{verbatim}
+</SCREEN>
+
+</SECT1>
+
+<!-- ============================================================ -->
+
 <SECT1 ID="zref.util.makedb">
-<TITLE><COMMAND>makedb</></TITLE>
+<TITLE>The <COMMAND>makedb</> utility</TITLE>
 
 <PARA>
-The way the ZMailer uses DBM entries is by using strings with 
-their terminating <CONSTANT>NULL</> as keys, and as data..
-Thus the length is {\tt strlen(string)+1}, not {\tt strlen(string)} !
+This utility is used by the ZMailer system to compile source
+files to various binary databases.
+</PARA>
+
+
+<PARA>
+The way the ZMailer uses DBM entries is by using C-strings with 
+their terminating <CONSTANT>NUL</> included at keys, and at data..
+Thus the length is <FUNCTION>strlen(string)+1</>,
+not <FUNCTION>strlen(string)</> !
 </PARA>
 
 <SCREEN>
 WARNING: Policy data parsing does use unchecked buffers!
 
 \begin{verbatim}
-Usage: makedb [-a|-p] dbtype database.name [infilename|-]
+Usage: makedb [-apsvluA] dbtype database.name [infilename|-]
 \end{verbatim}
 
+-a: aliasinput
+-p: policyinput
+-A: append-mode
+-l: pre-lowercasify the key
+-u: pre-uppercasify the key
+-s: be silent
+-v: be verbose
 
 Dbtypes are: {\tt ndbm gdbm btree bhash}
 
@@ -205,8 +403,10 @@
 
 </SECT1>
 
+<!-- ============================================================ -->
+
 <SECT1 ID="zref.util.dblook">
-<TITLE><COMMAND>dblook</></TITLE>
+<TITLE>The <COMMAND>dblook</> utility</TITLE>
 
 <SCREEN>
 The way the ZMailer uses DBM entries is by using strings with 
@@ -248,20 +448,28 @@
 
 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \clearpage
-\subsection{{\tt policy-builder.sh}}
+</SCREEN>
+</SECT1>
+
+<!-- ============================================================ -->
 
-\begin{alltt}
+<SECT1 ID=zref.util.policy-builder.sh>
+<TITLE>The <COMMAND>policy-builder.sh</> script</TITLE>
+
+<SCREEN>
 #! /bin/sh
 #
 # Sample smtp-policy-db builder script.
 #
 # This merges following files from $MAILVAR/db/ directory:
 #       smtp-policy.src
-#       localnames              ('= _localnames')
-#       smtp-policy.relay       ('= _full_rights')
-#       smtp-policy.mx          ('relaytargets +')
-#       smtp-policy.spam        ('= _bulk_mail')
-#       smtp-policy.spam.manual ('= _bulk_mail')
+#       localnames               ('= _localnames')
+#       smtp-policy.relay.manual ('= _full_rights')
+#       smtp-policy.relay        ('= _full_rights')
+#       smtp-policy.mx.manual    ('= _relaytarget')
+#       smtp-policy.mx           ('= _relaytarget')
+#       smtp-policy.spam         ('= _bulk_mail')
+#       smtp-policy.spam.manual  ('= _bulk_mail')
 #
 # These all together are used to produce files:  smtp-policy.$DBEXT
 # The produced database retains the first instance of any given key.
@@ -276,59 +484,48 @@
 #done
 #shift `expr $OPTIND - 1`
 
-if [ "x$1" = "x-n" ]; then
-    FLAG=n
-    shift
-fi
-if [ "x$1" = "x?" ]; then
-    exit 2
-fi
-
-
 ZCONFIG=@ZMAILERCFGFILE@
 . $ZCONFIG
 
+DBDIR="$MAILVAR/db/"
+USAGE="Usage: $0 [-n] [-d dbdir]"
+
+while [ "$1" != "" ]; do
+    case "$1" in
+        -n)
+            FLAG=n
+            ;;
+        -d)
+            shift
+            DBDIR=$1
+            if [ ! -d $DBDIR ]; then
+                echo $USAGE
+                exit 1
+            fi
+            ;;
+        ?)
+            echo $USAGE
+            exit 0
+            ;;
+        *)
+            echo $USAGE
+            exit 2
+            ;;
+    esac
+    shift
+done
+
+
 umask 022
 
-cd $MAILVAR/db
+cd $DBDIR
 
 if [ ! -f smtp-policy.src ] ; then
-        echo "No $MAILVAR/db/smtp-policy.src input file"
+        echo "No $DBDIR/smtp-policy.src input file"
         exit 64 # EX_USAGE
 fi
 
-if [ f$FLAG != fn ]; then
-    if [ -x $MAILBIN/smtp-policy-retrieve.pl ] ; then
-        $MAILBIN/smtp-policy-retrieve.pl
-    else
-        if [ -x $MAILBIN/spamlist.py ] ; then
-            $MAILBIN/spamlist.py > smtp-policy.spam.new && \verb/\/
-                mv  smtp-policy.spam.new smtp-policy.spam
-        else
-            #
-            # Following IS NOT SAFE, if either produces errors, those
-            # go (usually) to the result file, and in the end the result
-            # OVERWRITES the "running"  smtp-policy.spam  file.
-            #
-            > smtp-policy.spam.new
-            lynx -source http://www.webeasy.com:8080/spam/spam_download_table \verb/\/
-                >> smtp-policy.spam.new
-            lynx -source http://www.sprocket.com/Security/SpamDomains | \verb/\/
-                awk '\{print $1\}' >> smtp-policy.spam.new
-            cat smtp-policy.spam.new | sed 's/^@//g' | tr "[A-Z]" "[a-z]" | \verb/\/
-                    sort | uniq > smtp-policy.spam.new2
-            if [ `grep -c cyberpromo smtp-policy.spam.new` -gt "0" ]; then
-                mv smtp-policy.spam smtp-policy.spam.old
-                mv smtp-policy.spam.new2 smtp-policy.spam
-                rm -f smtp-policy.spam.new
-            else
-                echo "Hmm....something went wrong while updating the spam policy."
-                echo "Please try again."
-                exit 1
-            fi
-        fi
-    fi
-fi
+# -- Former '-f' flag data (non)retrieval section removed
 
 # Fork off a subshell to do it all...
 (
@@ -336,23 +533,46 @@
   cat smtp-policy.src
 
   # Localnames
-  cat localnames | \verb/\/
-  awk '/^#/\{next;\} NF >= 1 \{printf "%s = _localnames\verb/\/n",$1;\}'
+  echo "# ----------"
+  echo "# localnames:"
+  cat localnames | \
+  awk '/^#/{next;} NF >= 1 {printf "%s = _localnames\n",$1;}'
 
   # smtp-policy.relay
-  # (Lists domains and networks that are allowed to use us as relay)
+  # (Lists NETWORKS (NO DOMAINS!) that are allowed to use us as relay)
+  # (well, actually it could also list e.g.: ".our.domain" if it would
+  #  be fine to allow relaying from anybody whose IP address reverses to
+  #  domain suffix ".our.domain")
+  if [ -f smtp-policy.relay.manual ] ; then
+    echo "# -------------------------"
+    echo "# smtp-policy.relay.manual:"
+    cat smtp-policy.relay.manual | \
+    awk '/^#/{next;}
+        {printf "%s = _full_rights\n",$0;next;}'
+  fi
   if [ -f smtp-policy.relay ] ; then
-    cat smtp-policy.relay | \verb/\/
-    awk '/^#/\{next;\}
-        \{printf "%s = _full_rights %s %s %s %s %s %s %s %s\verb/\/n",
-                    $1,$2,$3,$4,$5,$6,$7,$8,$9;next;\}'
+    echo "# ------------------"
+    echo "# smtp-policy.relay:"
+    cat smtp-policy.relay | \
+    awk '/^#/{next;}
+        {printf "%s = _full_rights\n",$0;next;}'
   fi
 
+  # smtp-policy.mx.manual
+  # (Lists domains that are allowed to use us as inbound MX relay for them)
+  if [ -f smtp-policy.mx.manual ] ; then
+    echo "# ----------------------"
+    echo "# smtp-policy.mx.manual:"
+    cat smtp-policy.mx.manual | \
+    awk '/^#/{next;} NF >= 1 {printf "%s = _relaytarget\n",$0;}'
+  fi
   # smtp-policy.mx
   # (Lists domains that are allowed to use us as inbound MX relay for them)
   if [ -f smtp-policy.mx ] ; then
-    cat smtp-policy.mx | \verb/\/
-    awk '/^#/\{next;\} NF >= 1 \{printf "%s relaytarget +\verb/\/n",$1;\}'
+    echo "# ---------------"
+    echo "# smtp-policy.mx:"
+    cat smtp-policy.mx | \
+    awk '/^#/{next;} NF >= 1 {printf "%s = _relaytarget\n",$0;}'
   fi
 
   # smtp-policy.spam
@@ -360,27 +580,33 @@
   # (We use file from "http://www.webeasy.com:8080/spam/spam_download_table"
   #  which is intended for QMAIL, and thus needs to be edited..)
   if [ -f smtp-policy.spam -o -f smtp-policy.spam.manual ] ; then
+    echo "# ---------------------------"
+    echo "# smtp-policy.spam{,.manual}:"
     ( if [ -f smtp-policy.spam ] ; then
         cat smtp-policy.spam
       fi
       if [ -f smtp-policy.spam.manual ] ; then
         cat smtp-policy.spam.manual
-      fi ) | tr "[A-Z]" "[a-z]" | sed 's/^@//g' | sort | uniq | \verb/\/
-    awk '/^\verb/\/[/\{ # an address block to reject
-            printf "%s rejectnet +\verb/\/n", $1;
+      fi ) | tr "[A-Z]" "[a-z]" | sed 's/^@//g' | sort | uniq | \
+    awk '/^\[/{ # an address block to reject
+            printf "%s  rejectnet +\n",$0;
             next;
-        \}
-        \{ # All other cases are usernames with their domains
-          printf "%s = _bulk_mail\verb/\/n", $1;
-        \}'
+        }
+        NF > 0 { # All other cases are usernames with their domains
+            printf "%s  = _bulk_mail\n",$0;
+        }'
   fi
 
 # --------- end of subshell
 ) > smtp-policy.dat
 
 umask 022 # Make sure the resulting db file(s) are readable by all
+
+# Build the actual binary policy database (-p), and if the input
+# has same key repeating, append latter data instances to the first
+# one (-A):
 
-$MAILBIN/makedb -p $DBTYPE smtp-policy-new smtp-policy.dat || exit $?
+$MAILBIN/makedb -A -p $DBTYPE smtp-policy-new smtp-policy.dat || exit $?
 
 case $DBTYPE in
 dbm)
@@ -400,11 +626,11 @@
 esac
 
 exit 0
-\end{alltt}
 </SCREEN>
-
 </SECT1>
 
+<!-- ============================================================ -->
+
 <SECT1 ID=zref.util.autoanswer>
 <TITLE><COMMAND>autoanswer</></TITLE>
 
@@ -539,38 +765,144 @@
 </SCREEN>
 </SECT1>
 
-<SECT1 ID="zref.util.newdb">
-<TITLE><COMMAND>newdb</></TITLE>
+<!-- ============================================================ -->
+
+<SECT1 ID="zref.util.vacation">
+<TITLE><COMMAND>vacation</></TITLE>
 
 <PARA>
-This is elementary wrapper script building binary databases with
-<COMMAND>makedb</> utility into a temporary file, and replacing
-the old files with the new ones in proper order for the 
-<COMMAND>router</>'s automatic source change detecting relation 
-parameter {\tt -m} to work correctly.
+<COMMAND>vacation</> automatically replies to incoming mail.
+The canned reply is contained in the file <FILENAME>~/.vacation.msg</>,
+that you should create in your home directory (or the file
+<USERINPUT>Msgfile</> specified by the <OPTION>-m</> option).
+</PARA>
+
+<PARA>
+This file should include a header with at least
+a <QUOTE><LINK LINKEND="rfc822.subject">Subject:</></> line
+(it should not include a <QUOTE><LINK LINKEND="rfc822.to">To:</></> line
+&mdash; if you want, you may include
+<QUOTE><LINK LINKEND="rfc822.from">From:</></> line,
+especially if you use the <OPTION>-m</> option), for example.
+</PARA>
+
+<VARIABLELIST>
+<VARLISTENTRY><TERM>Usage:</><LISTITEM>
+
+<PARA>
+To start <COMMAND>vacation</>, run the command <USERINPUT>vacation start</>.
+It will create a <FILENAME>~/.vacation.msg</> file (if you don't already 
+have one) in your home directory containing the message you want to send 
+people who send you mail, and a <FILENAME>~/.forward</> file in your home 
+directory containing a line of the form:
+<SYNOPSIS>
+  "\name", "|/opt/mail/bin/vacation name"
+</SYNOPSIS>
+
+where name is your login name. Make sure these files and your home 
+directory are readable by everyone.
+Also make sure that no one else can write to them, and that no one can
+write to your home directory.
+Like this:
+<SYNOPSIS>
+  chmod og-w $HOME $HOME/.forward
+</SYNOPSIS>)
+</PARA>
+
+<PARA>
+To stop vacation, run the command <COMMAND>vacation stop</>.
+It will move the <FILENAME>~/.forward</> file to <FILENAME>~/.vacforward</>,
+and the automatic replies will stop.
 </PARA>
 
+<SYNOPSIS>
+vacation start vacation stop vacation -I vacation [ -tN ] [ -mMsgfile ] [ -d ] [user]
+</SYNOPSIS>
+
+</LISTITEM></VARLISTENTRY>
+<VARLISTENTRY><TERM>Parameters:</TERM><LISTITEM>
+
+<!-- VARIABLELIST -->
 <SCREEN>
-{\bf Usage}
+\item[{\tt -I}, {\tt -i}] \mbox{}
 
-\begin{verbatim}
-newdb /db/path/name [-u|-l] [input-file-name]
-\end{verbatim}
+initialize the {\tt .vacation.pag} 
+and {\tt .vacation.dir} files and start vacation.
 
-This script uses system {\tt ZCONFIG} file to find out the desired
-database type, and derives the actual database file names from the 
-variable.
+If the {\tt -I} (or {\tt -i}) flag is not specified, vacation 
+tries to reply to the sender.
 
-Suffix selection rules are:
+\item[{\tt -tN}] \mbox{}
 
-\begin{verbatim}
-dbm     .pag and .dir
-ndbm    .pag and .dir
-gdbm    .gdbm
-btree   .db   
-\end{verbatim}
+Change the interval between repeat replies to the same 
+sender. The default is one week. A trailing {\tt s}, {\tt m}, 
+{\tt h}, {\tt d}, or {\tt w} scales N to seconds, minutes, 
+hours, days, or weeks respectively.
+
+\item[{\tt -mMsgfile}] \mbox{}
+
+specifies the file in which the message to be 
+sent is kept. 
+The default is {\tt \$HOME/.vacation.msg}.
+
+\item[{\tt -r}] \mbox{}
+
+interval defines interval in days when not to answer 
+again to the same sender. (Default is 1 day.)
+
+\item[{\tt -d}] \mbox{}
+
+disables the list of senders kept in the 
+{\tt .vacation.pag} and {\tt .vacation.dir} files.
+
+\end{description}
+</SCREEN>
+
+</LISTITEM></VARLISTENTRY>
+<VARLISTENTRY><TERM>Example:</TERM><LISTITEM>
+
+<SCREEN>
+  Subject: I am on vacation
+
+  I am on vacation until July 22. If you have something urgent, please 
+  contact Joe Jones (joe@blah.utoronto.ca). --john
 </SCREEN>
 
+<PARA>
+No message is sent if the ``user'' specified in the vacation command
+(if nothing is specified, it uses your username) does not appear explicitly
+in the ``To:'' or ``Cc:'' lines of the message, which prevents messages from
+being sent back to mailing lists and causing loops.
+</PARA>
+
+<PARA>
+A list of senders is kept in the files <FILENAME>~/.vacation.pag</> and 
+<FILENAME>~/.vacation.dir</> in your home directory.
+These are dbm database files.
+(Note: not all database systems have two files, either may be missing.)
+The vacation message is in <FILENAME>~/.vacation.msg</> and the automatic
+reply is activated by the <FILENAME>~/.forward</> (and saved in
+<FILENAME>~/.vacforward</>)
+The default vacation message is stored in <FILENAME>/opt/mail/vacation.msg</>
+</PARA>
+
+<PARA>
+On machines running ZMailer, the ``name'' argument to <COMMAND>vacation</>
+is optional, and the $USER environment variable is used to determine where
+to look for the message and the list of previous recipients.
+</PARA>
+
+<PARA>
+The $SENDER} variable is checked first to determine the reply destination.
+It is normally set to the SMTP ``MAIL FROM:'' address or equivalent.
+This is an additional safeguard against sending replies to mailing lists,
+the PostMaster or the mailer daemon, since standards and common sense dictate
+that it never points back to an address that could cause a loop.
+The ``From '' line is used only as a last resort.
+</PARA>
+</LISTITEM></VARLISTENTRY>
+</VARIABLELIST>
 </SECT1>
+
 
 </CHAPTER>
Index: zmailer/doc/manual/ztutorial.sgml
diff -u zmailer/doc/manual/ztutorial.sgml:1.10 zmailer/doc/manual/ztutorial.sgml:1.11
--- zmailer/doc/manual/ztutorial.sgml:1.10	Wed Feb 21 18:20:26 2001
+++ zmailer/doc/manual/ztutorial.sgml	Sat Feb 24 00:11:56 2001
@@ -369,59 +369,69 @@
 
 <PARA>
 ZMailer is a multi-process mailer, using two daemon processes to manipulate
-messages.  One of these processes is a router, and makes all decisions
-about what should happen to a message.  The other daemon is a message queue
-manager, used to schedule delivery of messages.  The Router uses a
-configuration file that closely follows Bourne shell script syntax and
-semantics, with minimal magic.  Message files are moved around in a series
-of directories, and the Scheduler and its Transport Agents run off of
-control files created by the Router.
+messages.  One of these processes is a <COMMAND>router</>, and makes all
+decisions about what should happen to a message.
+The other daemon is a message queue manager, <COMMAND>scheduler</>, used to
+schedule delivery of messages.
+The Router uses a configuration file that closely follows
+ <EMPHASIS>Bourne shell script</> syntax and semantics, with minimal magic.
+Message files are moved around in a series of directories, and
+the <COMMAND>Scheduler</> and its <EMPHASIS>Transport Agents</> run off of
+control files created by the <EMPHASIS>Router</>.
 </PARA>
 
 <PARA>
-The Router will process messages one at a time, as it finds them in a
-directory where User Agents submit their outgoing messages.  Envelope and
-Message Header information is all kept in the same message file along with
-the message body, and this file is never modified by any ZMailer program.
-After parsing the envelope and RFC822 header information, the Router
-validates the information extracted, and calls functions defined in the
-configuration file to decide exactly how to deliver the message and how to
-transform the embedded addresses.  The algorithms that do this are easily
-re-configurable, since the control flow and address manipulation is
-specified by familiar shell script statements.  When the Router is
-finished, it will produce a message control file for use by the delivery
-processing stage of ZMailer, and move the original message file to another
-location.
+The <COMMAND>Router</> will process messages one at a time, as it finds them
+in a directory where <EMPHASIS>User Agents</> submit their outgoing messages.
+<EMPHASIS>Message Envelope</> and <EMPHASIS>Message Header</> information is
+all kept in the same <EMPHASIS>message file</> along with
+the <EMPHASIS>message body</>, and this file is never modified by
+any ZMailer program.
+After parsing the envelope and RFC822 header information,
+the <COMMAND>Router</> validates the information extracted,
+and calls functions defined in the configuration file to decide
+exactly how to deliver the message and how to transform the embedded addresses.
+The algorithms that do this are easily re-configurable, since the control flow
+and address manipulation is specified by familiar shell script statements.
+When the <COMMAND>Router</> is finished, it will produce a message control
+file for use by the delivery processing stage of ZMailer, and move
+the original message file to another location.
 </PARA>
 
 <PARA>
-Once the Router has decided what to do with each of the addresses in a
-message, the Scheduler builds a summary of this information by reading the
-control file created by the Router.  This knowledge is merged with a data
-structure it maintains that stores which messages are supposed to be sent
-where, and how.  According to a pre-arranged agenda, the Scheduler will
-execute delivery programs to properly move the message envelope, header,
-and body, to the immediate destination.  These delivery programs are called
-Transport Agents, and communicate with the Scheduler using a simple
-protocol that tells them which messages to process and returns status
-reports to the Scheduler.  The Scheduler also manages status reports,
-taking appropriate action on delivery errors and when all delivery
+Once the <COMMAND>Router</> has decided what to do with each of
+the addresses in a message, the <COMMAND>Scheduler</> builds a summary
+of this information by reading the control file created by
+the <COMMAND>Router</>.
+This knowledge is merged with a data structure it maintains that stores
+which messages are supposed to be sent where, and how.
+According to a pre-arranged agenda, the <COMMAND>Scheduler</> will execute
+delivery programs to properly move the message envelope, header, and body,
+to the immediate destination.
+These delivery programs are called <EMPHASIS>Transport Agents</>, and
+communicate with the <COMMAND>Scheduler</> using a simple protocol that
+tells them which messages to process and returns status reports to
+the <COMMAND>Scheduler</>.  The <COMMAND>Scheduler</> also manages status
+reports, taking appropriate action on delivery errors and when all delivery
 instructions for a message have been processed.
 </PARA>
 
 <PARA>
-There are several standard Transport Agents included with the ZMailer
-distribution.  The collection currently includes a local delivery program,
-an SMTP client implementation, and a Transport Agent that can run
-Sendmail-compatible delivery programs.
+There are several standard <EMPHASIS>Transport Agents</> included with
+the ZMailer distribution.
+The collection currently includes a local delivery program, an SMTP client
+implementation, and a Transport Agent that can run Sendmail-M-line-compatible
+delivery programs.
 </PARA>
 
 <PARA>
-A separate utility allows querying the Scheduler for the state of its mail
-queues.  For existing Sendmail installations, a replacement program is
-included that simulates most of the Sendmail functionality in the ZMailer
-environment.  This allows ZMailer to replace a Sendmail installation
-without requiring changes in standard User Agents.
+A separate <COMMAND>mailq</> utility allows querying the <COMMAND>Scheduler</>
+for the state of its queues.
+For existing <APPLICATION>Sendmail</> installations, a replacement program
+is included that simulates most of the <APPLICATION>Sendmail</> functionality
+in the ZMailer environment.
+This allows ZMailer to replace a <COMMAND>Sendmail</> installation without
+requiring changes in standard <EMPHASIS>User Agents</>.
 </PARA>
 
 <FIGURE PGWIDE="1" FLOAT="1" ID=fig.ztut.zmdirs>
@@ -830,10 +840,6 @@
 </PARA></LISTITEM></VARLISTENTRY>
 
 </VARIABLELIST>
-
-<PARA>
-placeholder text
-</PARA>
 
 </SECT1>
 
Index: zmailer/doc/rfc/rfc2821.txt
diff -u /dev/null zmailer/doc/rfc/rfc2821.txt:1.1
--- /dev/null	Tue May  8 16:00:10 2001
+++ zmailer/doc/rfc/rfc2821.txt	Tue May  8 15:49:22 2001
@@ -0,0 +1,4427 @@
+
+
+
+
+
+
+Network Working Group                                 J. Klensin, Editor
+Request for Comments: 2821                             AT&T Laboratories
+Obsoletes: 821, 974, 1869                                     April 2001
+Updates: 1123
+Category: Standards Track
+
+
+                     Simple Mail Transfer Protocol
+
+Status of this Memo
+
+   This document specifies an Internet standards track protocol for the
+   Internet community, and requests discussion and suggestions for
+   improvements.  Please refer to the current edition of the "Internet
+   Official Protocol Standards" (STD 1) for the standardization state
+   and status of this protocol.  Distribution of this memo is unlimited.
+
+Copyright Notice
+
+   Copyright (C) The Internet Society (2001).  All Rights Reserved.
+
+Abstract
+
+   This document is a self-contained specification of the basic protocol
+   for the Internet electronic mail transport.  It consolidates, updates
+   and clarifies, but doesn't add new or change existing functionality
+   of the following:
+
+   -  the original SMTP (Simple Mail Transfer Protocol) specification of
+      RFC 821 [30],
+
+   -  domain name system requirements and implications for mail
+      transport from RFC 1035 [22] and RFC 974 [27],
+
+   -  the clarifications and applicability statements in RFC 1123 [2],
+      and
+
+   -  material drawn from the SMTP Extension mechanisms [19].
+
+   It obsoletes RFC 821, RFC 974, and updates RFC 1123 (replaces the
+   mail transport materials of RFC 1123).  However, RFC 821 specifies
+   some features that were not in significant use in the Internet by the
+   mid-1990s and (in appendices) some additional transport models.
+   Those sections are omitted here in the interest of clarity and
+   brevity; readers needing them should refer to RFC 821.
+
+
+
+
+
+
+Klensin                     Standards Track                     [Page 1]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   It also includes some additional material from RFC 1123 that required
+   amplification.  This material has been identified in multiple ways,
+   mostly by tracking flaming on various lists and newsgroups and
+   problems of unusual readings or interpretations that have appeared as
+   the SMTP extensions have been deployed.  Where this specification
+   moves beyond consolidation and actually differs from earlier
+   documents, it supersedes them technically as well as textually.
+
+   Although SMTP was designed as a mail transport and delivery protocol,
+   this specification also contains information that is important to its
+   use as a 'mail submission' protocol, as recommended for POP [3, 26]
+   and IMAP [6].  Additional submission issues are discussed in RFC 2476
+   [15].
+
+   Section 2.3 provides definitions of terms specific to this document.
+   Except when the historical terminology is necessary for clarity, this
+   document uses the current 'client' and 'server' terminology to
+   identify the sending and receiving SMTP processes, respectively.
+
+   A companion document [32] discusses message headers, message bodies
+   and formats and structures for them, and their relationship.
+
+Table of Contents
+
+   1. Introduction ..................................................  4
+   2. The SMTP Model ................................................  5
+   2.1 Basic Structure ..............................................  5
+   2.2 The Extension Model ..........................................  7
+   2.2.1 Background .................................................  7
+   2.2.2 Definition and Registration of Extensions ..................  8
+   2.3 Terminology ..................................................  9
+   2.3.1 Mail Objects ............................................... 10
+   2.3.2 Senders and Receivers ...................................... 10
+   2.3.3 Mail Agents and Message Stores ............................. 10
+   2.3.4 Host ....................................................... 11
+   2.3.5 Domain ..................................................... 11
+   2.3.6 Buffer and State Table ..................................... 11
+   2.3.7 Lines ...................................................... 12
+   2.3.8 Originator, Delivery, Relay, and Gateway Systems ........... 12
+   2.3.9 Message Content and Mail Data .............................. 13
+   2.3.10 Mailbox and Address ....................................... 13
+   2.3.11 Reply ..................................................... 13
+   2.4 General Syntax Principles and Transaction Model .............. 13
+   3. The SMTP Procedures: An Overview .............................. 15
+   3.1 Session Initiation ........................................... 15
+   3.2 Client Initiation ............................................ 16
+   3.3 Mail Transactions ............................................ 16
+   3.4 Forwarding for Address Correction or Updating ................ 19
+
+
+
+Klensin                     Standards Track                     [Page 2]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   3.5 Commands for Debugging Addresses ............................. 20
+   3.5.1 Overview ................................................... 20
+   3.5.2 VRFY Normal Response ....................................... 22
+   3.5.3 Meaning of VRFY or EXPN Success Response ................... 22
+   3.5.4 Semantics and Applications of EXPN ......................... 23
+   3.6 Domains ...................................................... 23
+   3.7 Relaying ..................................................... 24
+   3.8 Mail Gatewaying .............................................. 25
+   3.8.1 Header Fields in Gatewaying ................................ 26
+   3.8.2 Received Lines in Gatewaying ............................... 26
+   3.8.3 Addresses in Gatewaying .................................... 26
+   3.8.4 Other Header Fields in Gatewaying .......................... 27
+   3.8.5 Envelopes in Gatewaying .................................... 27
+   3.9 Terminating Sessions and Connections ......................... 27
+   3.10 Mailing Lists and Aliases ................................... 28
+   3.10.1 Alias ..................................................... 28
+   3.10.2 List ...................................................... 28
+   4. The SMTP Specifications ....................................... 29
+   4.1 SMTP Commands ................................................ 29
+   4.1.1 Command Semantics and Syntax ............................... 29
+   4.1.1.1  Extended HELLO (EHLO) or HELLO (HELO) ................... 29
+   4.1.1.2 MAIL (MAIL) .............................................. 31
+   4.1.1.3 RECIPIENT (RCPT) ......................................... 31
+   4.1.1.4 DATA (DATA) .............................................. 33
+   4.1.1.5 RESET (RSET) ............................................. 34
+   4.1.1.6 VERIFY (VRFY) ............................................ 35
+   4.1.1.7 EXPAND (EXPN) ............................................ 35
+   4.1.1.8 HELP (HELP) .............................................. 35
+   4.1.1.9 NOOP (NOOP) .............................................. 35
+   4.1.1.10 QUIT (QUIT) ............................................. 36
+   4.1.2 Command Argument Syntax .................................... 36
+   4.1.3 Address Literals ........................................... 38
+   4.1.4 Order of Commands .......................................... 39
+   4.1.5 Private-use Commands ....................................... 40
+   4.2  SMTP Replies ................................................ 40
+   4.2.1 Reply Code Severities and Theory ........................... 42
+   4.2.2 Reply Codes by Function Groups ............................. 44
+   4.2.3  Reply Codes in Numeric Order .............................. 45
+   4.2.4 Reply Code 502 ............................................. 46
+   4.2.5 Reply Codes After DATA and the Subsequent <CRLF>.<CRLF> .... 46
+   4.3 Sequencing of Commands and Replies ........................... 47
+   4.3.1 Sequencing Overview ........................................ 47
+   4.3.2 Command-Reply Sequences .................................... 48
+   4.4 Trace Information ............................................ 49
+   4.5 Additional Implementation Issues ............................. 53
+   4.5.1 Minimum Implementation ..................................... 53
+   4.5.2 Transparency ............................................... 53
+   4.5.3 Sizes and Timeouts ......................................... 54
+
+
+
+Klensin                     Standards Track                     [Page 3]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   4.5.3.1 Size limits and minimums ................................. 54
+   4.5.3.2 Timeouts ................................................. 56
+   4.5.4 Retry Strategies ........................................... 57
+   4.5.4.1 Sending Strategy ......................................... 58
+   4.5.4.2 Receiving Strategy ....................................... 59
+   4.5.5 Messages with a null reverse-path .......................... 59
+   5. Address Resolution and Mail Handling .......................... 60
+   6. Problem Detection and Handling ................................ 62
+   6.1 Reliable Delivery and Replies by Email ....................... 62
+   6.2 Loop Detection ............................................... 63
+   6.3 Compensating for Irregularities .............................. 63
+   7. Security Considerations ....................................... 64
+   7.1 Mail Security and Spoofing ................................... 64
+   7.2 "Blind" Copies ............................................... 65
+   7.3 VRFY, EXPN, and Security ..................................... 65
+   7.4 Information Disclosure in Announcements ...................... 66
+   7.5 Information Disclosure in Trace Fields ....................... 66
+   7.6 Information Disclosure in Message Forwarding ................. 67
+   7.7 Scope of Operation of SMTP Servers ........................... 67
+   8. IANA Considerations ........................................... 67
+   9. References .................................................... 68
+   10. Editor's Address ............................................. 70
+   11. Acknowledgments .............................................. 70
+   Appendices ....................................................... 71
+   A. TCP Transport Service ......................................... 71
+   B. Generating SMTP Commands from RFC 822 Headers ................. 71
+   C. Source Routes ................................................. 72
+   D. Scenarios ..................................................... 73
+   E. Other Gateway Issues .......................................... 76
+   F. Deprecated Features of RFC 821 ................................ 76
+   Full Copyright Statement ......................................... 79
+
+1. Introduction
+
+   The objective of the Simple Mail Transfer Protocol (SMTP) is to
+   transfer mail reliably and efficiently.
+
+   SMTP is independent of the particular transmission subsystem and
+   requires only a reliable ordered data stream channel.  While this
+   document specifically discusses transport over TCP, other transports
+   are possible.  Appendices to RFC 821 describe some of them.
+
+   An important feature of SMTP is its capability to transport mail
+   across networks, usually referred to as "SMTP mail relaying" (see
+   section 3.8).  A network consists of the mutually-TCP-accessible
+   hosts on the public Internet, the mutually-TCP-accessible hosts on a
+   firewall-isolated TCP/IP Intranet, or hosts in some other LAN or WAN
+   environment utilizing a non-TCP transport-level protocol.  Using
+
+
+
+Klensin                     Standards Track                     [Page 4]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   SMTP, a process can transfer mail to another process on the same
+   network or to some other network via a relay or gateway process
+   accessible to both networks.
+
+   In this way, a mail message may pass through a number of intermediate
+   relay or gateway hosts on its path from sender to ultimate recipient.
+   The Mail eXchanger mechanisms of the domain name system [22, 27] (and
+   section 5 of this document) are used to identify the appropriate
+   next-hop destination for a message being transported.
+
+2. The SMTP Model
+
+2.1 Basic Structure
+
+   The SMTP design can be pictured as:
+
+               +----------+                +----------+
+   +------+    |          |                |          |
+   | User |<-->|          |      SMTP      |          |
+   +------+    |  Client- |Commands/Replies| Server-  |
+   +------+    |   SMTP   |<-------------->|    SMTP  |    +------+
+   | File |<-->|          |    and Mail    |          |<-->| File |
+   |System|    |          |                |          |    |System|
+   +------+    +----------+                +----------+    +------+
+                SMTP client                SMTP server
+
+   When an SMTP client has a message to transmit, it establishes a two-
+   way transmission channel to an SMTP server.  The responsibility of an
+   SMTP client is to transfer mail messages to one or more SMTP servers,
+   or report its failure to do so.
+
+   The means by which a mail message is presented to an SMTP client, and
+   how that client determines the domain name(s) to which mail messages
+   are to be transferred is a local matter, and is not addressed by this
+   document.  In some cases, the domain name(s) transferred to, or
+   determined by, an SMTP client will identify the final destination(s)
+   of the mail message.  In other cases, common with SMTP clients
+   associated with implementations of the POP [3, 26] or IMAP [6]
+   protocols, or when the SMTP client is inside an isolated transport
+   service environment, the domain name determined will identify an
+   intermediate destination through which all mail messages are to be
+   relayed.  SMTP clients that transfer all traffic, regardless of the
+   target domain names associated with the individual messages, or that
+   do not maintain queues for retrying message transmissions that
+   initially cannot be completed, may otherwise conform to this
+   specification but are not considered fully-capable.  Fully-capable
+   SMTP implementations, including the relays used by these less capable
+
+
+
+
+Klensin                     Standards Track                     [Page 5]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   ones, and their destinations, are expected to support all of the
+   queuing, retrying, and alternate address functions discussed in this
+   specification.
+
+   The means by which an SMTP client, once it has determined a target
+   domain name, determines the identity of an SMTP server to which a
+   copy of a message is to be transferred, and then performs that
+   transfer, is covered by this document.  To effect a mail transfer to
+   an SMTP server, an SMTP client establishes a two-way transmission
+   channel to that SMTP server.  An SMTP client determines the address
+   of an appropriate host running an SMTP server by resolving a
+   destination domain name to either an intermediate Mail eXchanger host
+   or a final target host.
+
+   An SMTP server may be either the ultimate destination or an
+   intermediate "relay" (that is, it may assume the role of an SMTP
+   client after receiving the message) or "gateway" (that is, it may
+   transport the message further using some protocol other than SMTP).
+   SMTP commands are generated by the SMTP client and sent to the SMTP
+   server.  SMTP replies are sent from the SMTP server to the SMTP
+   client in response to the commands.
+
+   In other words, message transfer can occur in a single connection
+   between the original SMTP-sender and the final SMTP-recipient, or can
+   occur in a series of hops through intermediary systems.  In either
+   case, a formal handoff of responsibility for the message occurs: the
+   protocol requires that a server accept responsibility for either
+   delivering a message or properly reporting the failure to do so.
+
+   Once the transmission channel is established and initial handshaking
+   completed, the SMTP client normally initiates a mail transaction.
+   Such a transaction consists of a series of commands to specify the
+   originator and destination of the mail and transmission of the
+   message content (including any headers or other structure) itself.
+   When the same message is sent to multiple recipients, this protocol
+   encourages the transmission of only one copy of the data for all
+   recipients at the same destination (or intermediate relay) host.
+
+   The server responds to each command with a reply; replies may
+   indicate that the command was accepted, that additional commands are
+   expected, or that a temporary or permanent error condition exists.
+   Commands specifying the sender or recipients may include server-
+   permitted SMTP service extension requests as discussed in section
+   2.2.  The dialog is purposely lock-step, one-at-a-time, although this
+   can be modified by mutually-agreed extension requests such as command
+   pipelining [13].
+
+
+
+
+
+Klensin                     Standards Track                     [Page 6]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   Once a given mail message has been transmitted, the client may either
+   request that the connection be shut down or may initiate other mail
+   transactions.  In addition, an SMTP client may use a connection to an
+   SMTP server for ancillary services such as verification of email
+   addresses or retrieval of mailing list subscriber addresses.
+
+   As suggested above, this protocol provides mechanisms for the
+   transmission of mail.  This transmission normally occurs directly
+   from the sending user's host to the receiving user's host when the
+   two hosts are connected to the same transport service.  When they are
+   not connected to the same transport service, transmission occurs via
+   one or more relay SMTP servers.  An intermediate host that acts as
+   either an SMTP relay or as a gateway into some other transmission
+   environment is usually selected through the use of the domain name
+   service (DNS) Mail eXchanger mechanism.
+
+   Usually, intermediate hosts are determined via the DNS MX record, not
+   by explicit "source" routing (see section 5 and appendices C and
+   F.2).
+
+2.2 The Extension Model
+
+2.2.1 Background
+
+   In an effort that started in 1990, approximately a decade after RFC
+   821 was completed, the protocol was modified with a "service
+   extensions" model that permits the client and server to agree to
+   utilize shared functionality beyond the original SMTP requirements.
+   The SMTP extension mechanism defines a means whereby an extended SMTP
+   client and server may recognize each other, and the server can inform
+   the client as to the service extensions that it supports.
+
+   Contemporary SMTP implementations MUST support the basic extension
+   mechanisms.  For instance, servers MUST support the EHLO command even
+   if they do not implement any specific extensions and clients SHOULD
+   preferentially utilize EHLO rather than HELO.  (However, for
+   compatibility with older conforming implementations, SMTP clients and
+   servers MUST support the original HELO mechanisms as a fallback.)
+   Unless the different characteristics of HELO must be identified for
+   interoperability purposes, this document discusses only EHLO.
+
+   SMTP is widely deployed and high-quality implementations have proven
+   to be very robust.  However, the Internet community now considers
+   some services to be important that were not anticipated when the
+   protocol was first designed.  If support for those services is to be
+   added, it must be done in a way that permits older implementations to
+   continue working acceptably.  The extension framework consists of:
+
+
+
+
+Klensin                     Standards Track                     [Page 7]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   -  The SMTP command EHLO, superseding the earlier HELO,
+
+   -  a registry of SMTP service extensions,
+
+   -  additional parameters to the SMTP MAIL and RCPT commands, and
+
+   -  optional replacements for commands defined in this protocol, such
+      as for DATA in non-ASCII transmissions [33].
+
+   SMTP's strength comes primarily from its simplicity.  Experience with
+   many protocols has shown that protocols with few options tend towards
+   ubiquity, whereas protocols with many options tend towards obscurity.
+
+   Each and every extension, regardless of its benefits, must be
+   carefully scrutinized with respect to its implementation, deployment,
+   and interoperability costs.  In many cases, the cost of extending the
+   SMTP service will likely outweigh the benefit.
+
+2.2.2 Definition and Registration of Extensions
+
+   The IANA maintains a registry of SMTP service extensions.  A
+   corresponding EHLO keyword value is associated with each extension.
+   Each service extension registered with the IANA must be defined in a
+   formal standards-track or IESG-approved experimental protocol
+   document.  The definition must include:
+
+   -  the textual name of the SMTP service extension;
+
+   -  the EHLO keyword value associated with the extension;
+
+   -  the syntax and possible values of parameters associated with the
+      EHLO keyword value;
+
+   -  any additional SMTP verbs associated with the extension
+      (additional verbs will usually be, but are not required to be, the
+      same as the EHLO keyword value);
+
+   -  any new parameters the extension associates with the MAIL or RCPT
+      verbs;
+
+   -  a description of how support for the extension affects the
+      behavior of a server and client SMTP; and,
+
+   -  the increment by which the extension is increasing the maximum
+      length of the commands MAIL and/or RCPT, over that specified in
+      this standard.
+
+
+
+
+
+Klensin                     Standards Track                     [Page 8]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   In addition, any EHLO keyword value starting with an upper or lower
+   case "X" refers to a local SMTP service extension used exclusively
+   through bilateral agreement.  Keywords beginning with "X" MUST NOT be
+   used in a registered service extension.  Conversely, keyword values
+   presented in the EHLO response that do not begin with "X" MUST
+   correspond to a standard, standards-track, or IESG-approved
+   experimental SMTP service extension registered with IANA.  A
+   conforming server MUST NOT offer non-"X"-prefixed keyword values that
+   are not described in a registered extension.
+
+   Additional verbs and parameter names are bound by the same rules as
+   EHLO keywords; specifically, verbs beginning with "X" are local
+   extensions that may not be registered or standardized.  Conversely,
+   verbs not beginning with "X" must always be registered.
+
+2.3 Terminology
+
+   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
+   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
+   document are to be interpreted as described below.
+
+   1. MUST   This word, or the terms "REQUIRED" or "SHALL", mean that
+      the definition is an absolute requirement of the specification.
+
+   2. MUST NOT   This phrase, or the phrase "SHALL NOT", mean that the
+      definition is an absolute prohibition of the specification.
+
+   3. SHOULD   This word, or the adjective "RECOMMENDED", mean that
+      there may exist valid reasons in particular circumstances to
+      ignore a particular item, but the full implications must be
+      understood and carefully weighed before choosing a different
+      course.
+
+   4. SHOULD NOT   This phrase, or the phrase "NOT RECOMMENDED" mean
+      that there may exist valid reasons in particular circumstances
+      when the particular behavior is acceptable or even useful, but the
+      full implications should be understood and the case carefully
+      weighed before implementing any behavior described with this
+      label.
+
+   5. MAY   This word, or the adjective "OPTIONAL", mean that an item is
+      truly optional.  One vendor may choose to include the item because
+      a particular marketplace requires it or because the vendor feels
+      that it enhances the product while another vendor may omit the
+      same item.  An implementation which does not include a particular
+      option MUST be prepared to interoperate with another
+      implementation which does include the option, though perhaps with
+      reduced functionality.  In the same vein an implementation which
+
+
+
+Klensin                     Standards Track                     [Page 9]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+      does include a particular option MUST be prepared to interoperate
+      with another implementation which does not include the option
+      (except, of course, for the feature the option provides.)
+
+2.3.1 Mail Objects
+
+   SMTP transports a mail object.  A mail object contains an envelope
+   and content.
+
+   The SMTP envelope is sent as a series of SMTP protocol units
+   (described in section 3).  It consists of an originator address (to
+   which error reports should be directed); one or more recipient
+   addresses; and optional protocol extension material.  Historically,
+   variations on the recipient address specification command (RCPT TO)
+   could be used to specify alternate delivery modes, such as immediate
+   display; those variations have now been deprecated (see appendix F,
+   section F.6).
+
+   The SMTP content is sent in the SMTP DATA protocol unit and has two
+   parts:  the headers and the body.  If the content conforms to other
+   contemporary standards, the headers form a collection of field/value
+   pairs structured as in the message format specification [32]; the
+   body, if structured, is defined according to MIME [12].  The content
+   is textual in nature, expressed using the US-ASCII repertoire [1].
+   Although SMTP extensions (such as "8BITMIME" [20]) may relax this
+   restriction for the content body, the content headers are always
+   encoded using the US-ASCII repertoire.  A MIME extension [23] defines
+   an algorithm for representing header values outside the US-ASCII
+   repertoire, while still encoding them using the US-ASCII repertoire.
+
+2.3.2 Senders and Receivers
+
+   In RFC 821, the two hosts participating in an SMTP transaction were
+   described as the "SMTP-sender" and "SMTP-receiver".  This document
+   has been changed to reflect current industry terminology and hence
+   refers to them as the "SMTP client" (or sometimes just "the client")
+   and "SMTP server" (or just "the server"), respectively.  Since a
+   given host may act both as server and client in a relay situation,
+   "receiver" and "sender" terminology is still used where needed for
+   clarity.
+
+2.3.3 Mail Agents and Message Stores
+
+   Additional mail system terminology became common after RFC 821 was
+   published and, where convenient, is used in this specification.  In
+   particular, SMTP servers and clients provide a mail transport service
+   and therefore act as "Mail Transfer Agents" (MTAs).  "Mail User
+   Agents" (MUAs or UAs) are normally thought of as the sources and
+
+
+
+Klensin                     Standards Track                    [Page 10]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   targets of mail.  At the source, an MUA might collect mail to be
+   transmitted from a user and hand it off to an MTA; the final
+   ("delivery") MTA would be thought of as handing the mail off to an
+   MUA (or at least transferring responsibility to it, e.g., by
+   depositing the message in a "message store").  However, while these
+   terms are used with at least the appearance of great precision in
+   other environments, the implied boundaries between MUAs and MTAs
+   often do not accurately match common, and conforming, practices with
+   Internet mail.  Hence, the reader should be cautious about inferring
+   the strong relationships and responsibilities that might be implied
+   if these terms were used elsewhere.
+
+2.3.4 Host
+
+   For the purposes of this specification, a host is a computer system
+   attached to the Internet (or, in some cases, to a private TCP/IP
+   network) and supporting the SMTP protocol.  Hosts are known by names
+   (see "domain"); identifying them by numerical address is discouraged.
+
+2.3.5 Domain
+
+   A domain (or domain name) consists of one or more dot-separated
+   components.  These components ("labels" in DNS terminology [22]) are
+   restricted for SMTP purposes to consist of a sequence of letters,
+   digits, and hyphens drawn from the ASCII character set [1].  Domain
+   names are used as names of hosts and of other entities in the domain
+   name hierarchy.  For example, a domain may refer to an alias (label
+   of a CNAME RR) or the label of Mail eXchanger records to be used to
+   deliver mail instead of representing a host name.  See [22] and
+   section 5 of this specification.
+
+   The domain name, as described in this document and in [22], is the
+   entire, fully-qualified name (often referred to as an "FQDN").  A
+   domain name that is not in FQDN form is no more than a local alias.
+   Local aliases MUST NOT appear in any SMTP transaction.
+
+2.3.6 Buffer and State Table
+
+   SMTP sessions are stateful, with both parties carefully maintaining a
+   common view of the current state.  In this document we model this
+   state by a virtual "buffer" and a "state table" on the server which
+   may be used by the client to, for example, "clear the buffer" or
+   "reset the state table," causing the information in the buffer to be
+   discarded and the state to be returned to some previous state.
+
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 11]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+2.3.7 Lines
+
+   SMTP commands and, unless altered by a service extension, message
+   data, are transmitted in "lines".  Lines consist of zero or more data
+   characters terminated by the sequence ASCII character "CR" (hex value
+   0D) followed immediately by ASCII character "LF" (hex value 0A).
+   This termination sequence is denoted as <CRLF> in this document.
+   Conforming implementations MUST NOT recognize or generate any other
+   character or character sequence as a line terminator.  Limits MAY be
+   imposed on line lengths by servers (see section 4.5.3).
+
+   In addition, the appearance of "bare" "CR" or "LF" characters in text
+   (i.e., either without the other) has a long history of causing
+   problems in mail implementations and applications that use the mail
+   system as a tool.  SMTP client implementations MUST NOT transmit
+   these characters except when they are intended as line terminators
+   and then MUST, as indicated above, transmit them only as a <CRLF>
+   sequence.
+
+2.3.8 Originator, Delivery, Relay, and Gateway Systems
+
+   This specification makes a distinction among four types of SMTP
+   systems, based on the role those systems play in transmitting
+   electronic mail.  An "originating" system (sometimes called an SMTP
+   originator) introduces mail into the Internet or, more generally,
+   into a transport service environment.  A "delivery" SMTP system is
+   one that receives mail from a transport service environment and
+   passes it to a mail user agent or deposits it in a message store
+   which a mail user agent is expected to subsequently access.  A
+   "relay" SMTP system (usually referred to just as a "relay") receives
+   mail from an SMTP client and transmits it, without modification to
+   the message data other than adding trace information, to another SMTP
+   server for further relaying or for delivery.
+
+   A "gateway" SMTP system (usually referred to just as a "gateway")
+   receives mail from a client system in one transport environment and
+   transmits it to a server system in another transport environment.
+   Differences in protocols or message semantics between the transport
+   environments on either side of a gateway may require that the gateway
+   system perform transformations to the message that are not permitted
+   to SMTP relay systems.  For the purposes of this specification,
+   firewalls that rewrite addresses should be considered as gateways,
+   even if SMTP is used on both sides of them (see [11]).
+
+
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 12]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+2.3.9 Message Content and Mail Data
+
+   The terms "message content" and "mail data" are used interchangeably
+   in this document to describe the material transmitted after the DATA
+   command is accepted and before the end of data indication is
+   transmitted.  Message content includes message headers and the
+   possibly-structured message body.  The MIME specification [12]
+   provides the standard mechanisms for structured message bodies.
+
+2.3.10 Mailbox and Address
+
+   As used in this specification, an "address" is a character string
+   that identifies a user to whom mail will be sent or a location into
+   which mail will be deposited.  The term "mailbox" refers to that
+   depository.  The two terms are typically used interchangeably unless
+   the distinction between the location in which mail is placed (the
+   mailbox) and a reference to it (the address) is important.  An
+   address normally consists of user and domain specifications.  The
+   standard mailbox naming convention is defined to be "local-
+   part@domain": contemporary usage permits a much broader set of
+   applications than simple "user names".  Consequently, and due to a
+   long history of problems when intermediate hosts have attempted to
+   optimize transport by modifying them, the local-part MUST be
+   interpreted and assigned semantics only by the host specified in the
+   domain part of the address.
+
+2.3.11 Reply
+
+   An SMTP reply is an acknowledgment (positive or negative) sent from
+   receiver to sender via the transmission channel in response to a
+   command.  The general form of a reply is a numeric completion code
+   (indicating failure or success) usually followed by a text string.
+   The codes are for use by programs and the text is usually intended
+   for human users.  Recent work [34] has specified further structuring
+   of the reply strings, including the use of supplemental and more
+   specific completion codes.
+
+2.4 General Syntax Principles and Transaction Model
+
+   SMTP commands and replies have a rigid syntax.  All commands begin
+   with a command verb.  All Replies begin with a three digit numeric
+   code.  In some commands and replies, arguments MUST follow the verb
+   or reply code.  Some commands do not accept arguments (after the
+   verb), and some reply codes are followed, sometimes optionally, by
+   free form text.  In both cases, where text appears, it is separated
+   from the verb or reply code by a space character.  Complete
+   definitions of commands and replies appear in section 4.
+
+
+
+
+Klensin                     Standards Track                    [Page 13]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   Verbs and argument values (e.g., "TO:" or "to:" in the RCPT command
+   and extension name keywords) are not case sensitive, with the sole
+   exception in this specification of a mailbox local-part (SMTP
+   Extensions may explicitly specify case-sensitive elements).  That is,
+   a command verb, an argument value other than a mailbox local-part,
+   and free form text MAY be encoded in upper case, lower case, or any
+   mixture of upper and lower case with no impact on its meaning.  This
+   is NOT true of a mailbox local-part.  The local-part of a mailbox
+   MUST BE treated as case sensitive.  Therefore, SMTP implementations
+   MUST take care to preserve the case of mailbox local-parts.  Mailbox
+   domains are not case sensitive.  In particular, for some hosts the
+   user "smith" is different from the user "Smith".  However, exploiting
+   the case sensitivity of mailbox local-parts impedes interoperability
+   and is discouraged.
+
+   A few SMTP servers, in violation of this specification (and RFC 821)
+   require that command verbs be encoded by clients in upper case.
+   Implementations MAY wish to employ this encoding to accommodate those
+   servers.
+
+   The argument field consists of a variable length character string
+   ending with the end of the line, i.e., with the character sequence
+   <CRLF>.  The receiver will take no action until this sequence is
+   received.
+
+   The syntax for each command is shown with the discussion of that
+   command.  Common elements and parameters are shown in section 4.1.2.
+
+   Commands and replies are composed of characters from the ASCII
+   character set [1].  When the transport service provides an 8-bit byte
+   (octet) transmission channel, each 7-bit character is transmitted
+   right justified in an octet with the high order bit cleared to zero.
+   More specifically, the unextended SMTP service provides seven bit
+   transport only.  An originating SMTP client which has not
+   successfully negotiated an appropriate extension with a particular
+   server MUST NOT transmit messages with information in the high-order
+   bit of octets.  If such messages are transmitted in violation of this
+   rule, receiving SMTP servers MAY clear the high-order bit or reject
+   the message as invalid.  In general, a relay SMTP SHOULD assume that
+   the message content it has received is valid and, assuming that the
+   envelope permits doing so, relay it without inspecting that content.
+   Of course, if the content is mislabeled and the data path cannot
+   accept the actual content, this may result in ultimate delivery of a
+   severely garbled message to the recipient.  Delivery SMTP systems MAY
+   reject ("bounce") such messages rather than deliver them.  No sending
+   SMTP system is permitted to send envelope commands in any character
+
+
+
+
+
+Klensin                     Standards Track                    [Page 14]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   set other than US-ASCII; receiving systems SHOULD reject such
+   commands, normally using "500 syntax error - invalid character"
+   replies.
+
+   Eight-bit message content transmission MAY be requested of the server
+   by a client using extended SMTP facilities, notably the "8BITMIME"
+   extension [20].  8BITMIME SHOULD be supported by SMTP servers.
+   However, it MUST not be construed as authorization to transmit
+   unrestricted eight bit material.  8BITMIME MUST NOT be requested by
+   senders for material with the high bit on that is not in MIME format
+   with an appropriate content-transfer encoding; servers MAY reject
+   such messages.
+
+   The metalinguistic notation used in this document corresponds to the
+   "Augmented BNF" used in other Internet mail system documents.  The
+   reader who is not familiar with that syntax should consult the ABNF
+   specification [8].  Metalanguage terms used in running text are
+   surrounded by pointed brackets (e.g., <CRLF>) for clarity.
+
+3. The SMTP Procedures: An Overview
+
+   This section contains descriptions of the procedures used in SMTP:
+   session initiation, the mail transaction, forwarding mail, verifying
+   mailbox names and expanding mailing lists, and the opening and
+   closing exchanges.  Comments on relaying, a note on mail domains, and
+   a discussion of changing roles are included at the end of this
+   section.  Several complete scenarios are presented in appendix D.
+
+3.1 Session Initiation
+
+   An SMTP session is initiated when a client opens a connection to a
+   server and the server responds with an opening message.
+
+   SMTP server implementations MAY include identification of their
+   software and version information in the connection greeting reply
+   after the 220 code, a practice that permits more efficient isolation
+   and repair of any problems.  Implementations MAY make provision for
+   SMTP servers to disable the software and version announcement where
+   it causes security concerns.  While some systems also identify their
+   contact point for mail problems, this is not a substitute for
+   maintaining the required "postmaster" address (see section 4.5.1).
+
+   The SMTP protocol allows a server to formally reject a transaction
+   while still allowing the initial connection as follows: a 554
+   response MAY be given in the initial connection opening message
+   instead of the 220.  A server taking this approach MUST still wait
+   for the client to send a QUIT (see section 4.1.1.10) before closing
+   the connection and SHOULD respond to any intervening commands with
+
+
+
+Klensin                     Standards Track                    [Page 15]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   "503 bad sequence of commands".  Since an attempt to make an SMTP
+   connection to such a system is probably in error, a server returning
+   a 554 response on connection opening SHOULD provide enough
+   information in the reply text to facilitate debugging of the sending
+   system.
+
+3.2 Client Initiation
+
+   Once the server has sent the welcoming message and the client has
+   received it, the client normally sends the EHLO command to the
+   server, indicating the client's identity.  In addition to opening the
+   session, use of EHLO indicates that the client is able to process
+   service extensions and requests that the server provide a list of the
+   extensions it supports.  Older SMTP systems which are unable to
+   support service extensions and contemporary clients which do not
+   require service extensions in the mail session being initiated, MAY
+   use HELO instead of EHLO.  Servers MUST NOT return the extended
+   EHLO-style response to a HELO command.  For a particular connection
+   attempt, if the server returns a "command not recognized" response to
+   EHLO, the client SHOULD be able to fall back and send HELO.
+
+   In the EHLO command the host sending the command identifies itself;
+   the command may be interpreted as saying "Hello, I am <domain>" (and,
+   in the case of EHLO, "and I support service extension requests").
+
+3.3 Mail Transactions
+
+   There are three steps to SMTP mail transactions.  The transaction
+   starts with a MAIL command which gives the sender identification.
+   (In general, the MAIL command may be sent only when no mail
+   transaction is in progress; see section 4.1.4.)  A series of one or
+   more RCPT commands follows giving the receiver information.  Then a
+   DATA command initiates transfer of the mail data and is terminated by
+   the "end of mail" data indicator, which also confirms the
+   transaction.
+
+   The first step in the procedure is the MAIL command.
+
+      MAIL FROM:<reverse-path> [SP <mail-parameters> ] <CRLF>
+
+   This command tells the SMTP-receiver that a new mail transaction is
+   starting and to reset all its state tables and buffers, including any
+   recipients or mail data.  The <reverse-path> portion of the first or
+   only argument contains the source mailbox (between "<" and ">"
+   brackets), which can be used to report errors (see section 4.2 for a
+   discussion of error reporting).  If accepted, the SMTP server returns
+   a 250 OK reply.  If the mailbox specification is not acceptable for
+   some reason, the server MUST return a reply indicating whether the
+
+
+
+Klensin                     Standards Track                    [Page 16]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   failure is permanent (i.e., will occur again if the client tries to
+   send the same address again) or temporary (i.e., the address might be
+   accepted if the client tries again later).  Despite the apparent
+   scope of this requirement, there are circumstances in which the
+   acceptability of the reverse-path may not be determined until one or
+   more forward-paths (in RCPT commands) can be examined.  In those
+   cases, the server MAY reasonably accept the reverse-path (with a 250
+   reply) and then report problems after the forward-paths are received
+   and examined.  Normally, failures produce 550 or 553 replies.
+
+   Historically, the <reverse-path> can contain more than just a
+   mailbox, however, contemporary systems SHOULD NOT use source routing
+   (see appendix C).
+
+   The optional <mail-parameters> are associated with negotiated SMTP
+   service extensions (see section 2.2).
+
+   The second step in the procedure is the RCPT command.
+
+      RCPT TO:<forward-path> [ SP <rcpt-parameters> ] <CRLF>
+
+   The first or only argument to this command includes a forward-path
+   (normally a mailbox and domain, always surrounded by "<" and ">"
+   brackets) identifying one recipient.  If accepted, the SMTP server
+   returns a 250 OK reply and stores the forward-path.  If the recipient
+   is known not to be a deliverable address, the SMTP server returns a
+   550 reply, typically with a string such as "no such user - " and the
+   mailbox name (other circumstances and reply codes are possible).
+   This step of the procedure can be repeated any number of times.
+
+   The <forward-path> can contain more than just a mailbox.
+   Historically, the <forward-path> can be a source routing list of
+   hosts and the destination mailbox, however, contemporary SMTP clients
+   SHOULD NOT utilize source routes (see appendix C).  Servers MUST be
+   prepared to encounter a list of source routes in the forward path,
+   but SHOULD ignore the routes or MAY decline to support the relaying
+   they imply.  Similarly, servers MAY decline to accept mail that is
+   destined for other hosts or systems.  These restrictions make a
+   server useless as a relay for clients that do not support full SMTP
+   functionality.  Consequently, restricted-capability clients MUST NOT
+   assume that any SMTP server on the Internet can be used as their mail
+   processing (relaying) site.  If a RCPT command appears without a
+   previous MAIL command, the server MUST return a 503 "Bad sequence of
+   commands" response.  The optional <rcpt-parameters> are associated
+   with negotiated SMTP service extensions (see section 2.2).
+
+   The third step in the procedure is the DATA command (or some
+   alternative specified in a service extension).
+
+
+
+Klensin                     Standards Track                    [Page 17]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+      DATA <CRLF>
+
+   If accepted, the SMTP server returns a 354 Intermediate reply and
+   considers all succeeding lines up to but not including the end of
+   mail data indicator to be the message text.  When the end of text is
+   successfully received and stored the SMTP-receiver sends a 250 OK
+   reply.
+
+   Since the mail data is sent on the transmission channel, the end of
+   mail data must be indicated so that the command and reply dialog can
+   be resumed.  SMTP indicates the end of the mail data by sending a
+   line containing only a "." (period or full stop).  A transparency
+   procedure is used to prevent this from interfering with the user's
+   text (see section 4.5.2).
+
+   The end of mail data indicator also confirms the mail transaction and
+   tells the SMTP server to now process the stored recipients and mail
+   data.  If accepted, the SMTP server returns a 250 OK reply.  The DATA
+   command can fail at only two points in the protocol exchange:
+
+   -  If there was no MAIL, or no RCPT, command, or all such commands
+      were rejected, the server MAY return a "command out of sequence"
+      (503) or "no valid recipients" (554) reply in response to the DATA
+      command.  If one of those replies (or any other 5yz reply) is
+      received, the client MUST NOT send the message data; more
+      generally, message data MUST NOT be sent unless a 354 reply is
+      received.
+
+   -  If the verb is initially accepted and the 354 reply issued, the
+      DATA command should fail only if the mail transaction was
+      incomplete (for example, no recipients), or if resources were
+      unavailable (including, of course, the server unexpectedly
+      becoming unavailable), or if the server determines that the
+      message should be rejected for policy or other reasons.
+
+   However, in practice, some servers do not perform recipient
+   verification until after the message text is received.  These servers
+   SHOULD treat a failure for one or more recipients as a "subsequent
+   failure" and return a mail message as discussed in section 6.  Using
+   a "550 mailbox not found" (or equivalent) reply code after the data
+   are accepted makes it difficult or impossible for the client to
+   determine which recipients failed.
+
+   When RFC 822 format [7, 32] is being used, the mail data include the
+   memo header items such as Date, Subject, To, Cc, From.  Server SMTP
+   systems SHOULD NOT reject messages based on perceived defects in the
+   RFC 822 or MIME [12] message header or message body.  In particular,
+
+
+
+
+Klensin                     Standards Track                    [Page 18]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   they MUST NOT reject messages in which the numbers of Resent-fields
+   do not match or Resent-to appears without Resent-from and/or Resent-
+   date.
+
+   Mail transaction commands MUST be used in the order discussed above.
+
+3.4 Forwarding for Address Correction or Updating
+
+   Forwarding support is most often required to consolidate and simplify
+   addresses within, or relative to, some enterprise and less frequently
+   to establish addresses to link a person's prior address with current
+   one.  Silent forwarding of messages (without server notification to
+   the sender), for security or non-disclosure purposes, is common in
+   the contemporary Internet.
+
+   In both the enterprise and the "new address" cases, information
+   hiding (and sometimes security) considerations argue against exposure
+   of the "final" address through the SMTP protocol as a side-effect of
+   the forwarding activity.  This may be especially important when the
+   final address may not even be reachable by the sender.  Consequently,
+   the "forwarding" mechanisms described in section 3.2 of RFC 821, and
+   especially the 251 (corrected destination) and 551 reply codes from
+   RCPT must be evaluated carefully by implementers and, when they are
+   available, by those configuring systems.
+
+   In particular:
+
+   *  Servers MAY forward messages when they are aware of an address
+      change.  When they do so, they MAY either provide address-updating
+      information with a 251 code, or may forward "silently" and return
+      a 250 code.  But, if a 251 code is used, they MUST NOT assume that
+      the client will actually update address information or even return
+      that information to the user.
+
+   Alternately,
+
+   *  Servers MAY reject or bounce messages when they are not
+      deliverable when addressed.  When they do so, they MAY either
+      provide address-updating information with a 551 code, or may
+      reject the message as undeliverable with a 550 code and no
+      address-specific information.  But, if a 551 code is used, they
+      MUST NOT assume that the client will actually update address
+      information or even return that information to the user.
+
+   SMTP server implementations that support the 251 and/or 551 reply
+   codes are strongly encouraged to provide configuration mechanisms so
+   that sites which conclude that they would undesirably disclose
+   information can disable or restrict their use.
+
+
+
+Klensin                     Standards Track                    [Page 19]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+3.5 Commands for Debugging Addresses
+
+3.5.1 Overview
+
+   SMTP provides commands to verify a user name or obtain the content of
+   a mailing list.  This is done with the VRFY and EXPN commands, which
+   have character string arguments.  Implementations SHOULD support VRFY
+   and EXPN (however, see section 3.5.2 and 7.3).
+
+   For the VRFY command, the string is a user name or a user name and
+   domain (see below).  If a normal (i.e., 250) response is returned,
+   the response MAY include the full name of the user and MUST include
+   the mailbox of the user.  It MUST be in either of the following
+   forms:
+
+      User Name <local-part@domain>
+      local-part@domain
+
+   When a name that is the argument to VRFY could identify more than one
+   mailbox, the server MAY either note the ambiguity or identify the
+   alternatives.  In other words, any of the following are legitimate
+   response to VRFY:
+
+      553 User ambiguous
+
+   or
+
+      553- Ambiguous;  Possibilities are
+      553-Joe Smith <jsmith@foo.com>
+      553-Harry Smith <hsmith@foo.com>
+      553 Melvin Smith <dweep@foo.com>
+
+   or
+
+      553-Ambiguous;  Possibilities
+      553- <jsmith@foo.com>
+      553- <hsmith@foo.com>
+      553 <dweep@foo.com>
+
+   Under normal circumstances, a client receiving a 553 reply would be
+   expected to expose the result to the user.  Use of exactly the forms
+   given, and the "user ambiguous" or "ambiguous" keywords, possibly
+   supplemented by extended reply codes such as those described in [34],
+   will facilitate automated translation into other languages as needed.
+   Of course, a client that was highly automated or that was operating
+   in another language than English, might choose to try to translate
+   the response, to return some other indication to the user than the
+
+
+
+
+Klensin                     Standards Track                    [Page 20]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   literal text of the reply, or to take some automated action such as
+   consulting a directory service for additional information before
+   reporting to the user.
+
+   For the EXPN command, the string identifies a mailing list, and the
+   successful (i.e., 250) multiline response MAY include the full name
+   of the users and MUST give the mailboxes on the mailing list.
+
+   In some hosts the distinction between a mailing list and an alias for
+   a single mailbox is a bit fuzzy, since a common data structure may
+   hold both types of entries, and it is possible to have mailing lists
+   containing only one mailbox.  If a request is made to apply VRFY to a
+   mailing list, a positive response MAY be given if a message so
+   addressed would be delivered to everyone on the list, otherwise an
+   error SHOULD be reported (e.g., "550 That is a mailing list, not a
+   user" or "252 Unable to verify members of mailing list").  If a
+   request is made to expand a user name, the server MAY return a
+   positive response consisting of a list containing one name, or an
+   error MAY be reported (e.g., "550 That is a user name, not a mailing
+   list").
+
+   In the case of a successful multiline reply (normal for EXPN) exactly
+   one mailbox is to be specified on each line of the reply.  The case
+   of an ambiguous request is discussed above.
+
+   "User name" is a fuzzy term and has been used deliberately.  An
+   implementation of the VRFY or EXPN commands MUST include at least
+   recognition of local mailboxes as "user names".  However, since
+   current Internet practice often results in a single host handling
+   mail for multiple domains, hosts, especially hosts that provide this
+   functionality, SHOULD accept the "local-part@domain" form as a "user
+   name"; hosts MAY also choose to recognize other strings as "user
+   names".
+
+   The case of expanding a mailbox list requires a multiline reply, such
+   as:
+
+      C: EXPN Example-People
+      S: 250-Jon Postel <Postel@isi.edu>
+      S: 250-Fred Fonebone <Fonebone@physics.foo-u.edu>
+      S: 250 Sam Q. Smith <SQSmith@specific.generic.com>
+
+   or
+
+      C: EXPN Executive-Washroom-List
+      S: 550 Access Denied to You.
+
+
+
+
+
+Klensin                     Standards Track                    [Page 21]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   The character string arguments of the VRFY and EXPN commands cannot
+   be further restricted due to the variety of implementations of the
+   user name and mailbox list concepts.  On some systems it may be
+   appropriate for the argument of the EXPN command to be a file name
+   for a file containing a mailing list, but again there are a variety
+   of file naming conventions in the Internet.  Similarly, historical
+   variations in what is returned by these commands are such that the
+   response SHOULD be interpreted very carefully, if at all, and SHOULD
+   generally only be used for diagnostic purposes.
+
+3.5.2 VRFY Normal Response
+
+   When normal (2yz or 551) responses are returned from a VRFY or EXPN
+   request, the reply normally includes the mailbox name, i.e.,
+   "<local-part@domain>", where "domain" is a fully qualified domain
+   name, MUST appear in the syntax.  In circumstances exceptional enough
+   to justify violating the intent of this specification, free-form text
+   MAY be returned.  In order to facilitate parsing by both computers
+   and people, addresses SHOULD appear in pointed brackets.  When
+   addresses, rather than free-form debugging information, are returned,
+   EXPN and VRFY MUST return only valid domain addresses that are usable
+   in SMTP RCPT commands.  Consequently, if an address implies delivery
+   to a program or other system, the mailbox name used to reach that
+   target MUST be given.  Paths (explicit source routes) MUST NOT be
+   returned by VRFY or EXPN.
+
+   Server implementations SHOULD support both VRFY and EXPN.  For
+   security reasons, implementations MAY provide local installations a
+   way to disable either or both of these commands through configuration
+   options or the equivalent.  When these commands are supported, they
+   are not required to work across relays when relaying is supported.
+   Since they were both optional in RFC 821, they MUST be listed as
+   service extensions in an EHLO response, if they are supported.
+
+3.5.3 Meaning of VRFY or EXPN Success Response
+
+   A server MUST NOT return a 250 code in response to a VRFY or EXPN
+   command unless it has actually verified the address.  In particular,
+   a server MUST NOT return 250 if all it has done is to verify that the
+   syntax given is valid.  In that case, 502 (Command not implemented)
+   or 500 (Syntax error, command unrecognized) SHOULD be returned.  As
+   stated elsewhere, implementation (in the sense of actually validating
+   addresses and returning information) of VRFY and EXPN are strongly
+   recommended.  Hence, implementations that return 500 or 502 for VRFY
+   are not in full compliance with this specification.
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 22]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   There may be circumstances where an address appears to be valid but
+   cannot reasonably be verified in real time, particularly when a
+   server is acting as a mail exchanger for another server or domain.
+   "Apparent validity" in this case would normally involve at least
+   syntax checking and might involve verification that any domains
+   specified were ones to which the host expected to be able to relay
+   mail.  In these situations, reply code 252 SHOULD be returned.  These
+   cases parallel the discussion of RCPT verification discussed in
+   section 2.1.  Similarly, the discussion in section 3.4 applies to the
+   use of reply codes 251 and 551 with VRFY (and EXPN) to indicate
+   addresses that are recognized but that would be forwarded or bounced
+   were mail received for them.  Implementations generally SHOULD be
+   more aggressive about address verification in the case of VRFY than
+   in the case of RCPT, even if it takes a little longer to do so.
+
+3.5.4 Semantics and Applications of EXPN
+
+   EXPN is often very useful in debugging and understanding problems
+   with mailing lists and multiple-target-address aliases.  Some systems
+   have attempted to use source expansion of mailing lists as a means of
+   eliminating duplicates.  The propagation of aliasing systems with
+   mail on the Internet, for hosts (typically with MX and CNAME DNS
+   records), for mailboxes (various types of local host aliases), and in
+   various proxying arrangements, has made it nearly impossible for
+   these strategies to work consistently, and mail systems SHOULD NOT
+   attempt them.
+
+3.6 Domains
+
+   Only resolvable, fully-qualified, domain names (FQDNs) are permitted
+   when domain names are used in SMTP.  In other words, names that can
+   be resolved to MX RRs or A RRs (as discussed in section 5) are
+   permitted, as are CNAME RRs whose targets can be resolved, in turn,
+   to MX or A RRs.  Local nicknames or unqualified names MUST NOT be
+   used.  There are two exceptions to the rule requiring FQDNs:
+
+   -  The domain name given in the EHLO command MUST BE either a primary
+      host name (a domain name that resolves to an A RR) or, if the host
+      has no name, an address literal as described in section 4.1.1.1.
+
+   -  The reserved mailbox name "postmaster" may be used in a RCPT
+      command without domain qualification (see section 4.1.1.3) and
+      MUST be accepted if so used.
+
+
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 23]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+3.7 Relaying
+
+   In general, the availability of Mail eXchanger records in the domain
+   name system [22, 27] makes the use of explicit source routes in the
+   Internet mail system unnecessary.  Many historical problems with
+   their interpretation have made their use undesirable.  SMTP clients
+   SHOULD NOT generate explicit source routes except under unusual
+   circumstances.  SMTP servers MAY decline to act as mail relays or to
+   accept addresses that specify source routes.  When route information
+   is encountered, SMTP servers are also permitted to ignore the route
+   information and simply send to the final destination specified as the
+   last element in the route and SHOULD do so.  There has been an
+   invalid practice of using names that do not appear in the DNS as
+   destination names, with the senders counting on the intermediate
+   hosts specified in source routing to resolve any problems.  If source
+   routes are stripped, this practice will cause failures.  This is one
+   of several reasons why SMTP clients MUST NOT generate invalid source
+   routes or depend on serial resolution of names.
+
+   When source routes are not used, the process described in RFC 821 for
+   constructing a reverse-path from the forward-path is not applicable
+   and the reverse-path at the time of delivery will simply be the
+   address that appeared in the MAIL command.
+
+   A relay SMTP server is usually the target of a DNS MX record that
+   designates it, rather than the final delivery system.  The relay
+   server may accept or reject the task of relaying the mail in the same
+   way it accepts or rejects mail for a local user.  If it accepts the
+   task, it then becomes an SMTP client, establishes a transmission
+   channel to the next SMTP server specified in the DNS (according to
+   the rules in section 5), and sends it the mail.  If it declines to
+   relay mail to a particular address for policy reasons, a 550 response
+   SHOULD be returned.
+
+   Many mail-sending clients exist, especially in conjunction with
+   facilities that receive mail via POP3 or IMAP, that have limited
+   capability to support some of the requirements of this specification,
+   such as the ability to queue messages for subsequent delivery
+   attempts.  For these clients, it is common practice to make private
+   arrangements to send all messages to a single server for processing
+   and subsequent distribution.  SMTP, as specified here, is not ideally
+   suited for this role, and work is underway on standardized mail
+   submission protocols that might eventually supercede the current
+   practices.  In any event, because these arrangements are private and
+   fall outside the scope of this specification, they are not described
+   here.
+
+
+
+
+
+Klensin                     Standards Track                    [Page 24]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   It is important to note that MX records can point to SMTP servers
+   which act as gateways into other environments, not just SMTP relays
+   and final delivery systems; see sections 3.8 and 5.
+
+   If an SMTP server has accepted the task of relaying the mail and
+   later finds that the destination is incorrect or that the mail cannot
+   be delivered for some other reason, then it MUST construct an
+   "undeliverable mail" notification message and send it to the
+   originator of the undeliverable mail (as indicated by the reverse-
+   path).  Formats specified for non-delivery reports by other standards
+   (see, for example, [24, 25]) SHOULD be used if possible.
+
+   This notification message must be from the SMTP server at the relay
+   host or the host that first determines that delivery cannot be
+   accomplished.  Of course, SMTP servers MUST NOT send notification
+   messages about problems transporting notification messages.  One way
+   to prevent loops in error reporting is to specify a null reverse-path
+   in the MAIL command of a notification message.  When such a message
+   is transmitted the reverse-path MUST be set to null (see section
+   4.5.5 for additional discussion).  A MAIL command with a null
+   reverse-path appears as follows:
+
+      MAIL FROM:<>
+
+   As discussed in section 2.4.1, a relay SMTP has no need to inspect or
+   act upon the headers or body of the message data and MUST NOT do so
+   except to add its own "Received:" header (section 4.4) and,
+   optionally, to attempt to detect looping in the mail system (see
+   section 6.2).
+
+3.8 Mail Gatewaying
+
+   While the relay function discussed above operates within the Internet
+   SMTP transport service environment, MX records or various forms of
+   explicit routing may require that an intermediate SMTP server perform
+   a translation function between one transport service and another.  As
+   discussed in section 2.3.8, when such a system is at the boundary
+   between two transport service environments, we refer to it as a
+   "gateway" or "gateway SMTP".
+
+   Gatewaying mail between different mail environments, such as
+   different mail formats and protocols, is complex and does not easily
+   yield to standardization.  However, some general requirements may be
+   given for a gateway between the Internet and another mail
+   environment.
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 25]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+3.8.1 Header Fields in Gatewaying
+
+   Header fields MAY be rewritten when necessary as messages are
+   gatewayed across mail environment boundaries.  This may involve
+   inspecting the message body or interpreting the local-part of the
+   destination address in spite of the prohibitions in section 2.4.1.
+
+   Other mail systems gatewayed to the Internet often use a subset of
+   RFC 822 headers or provide similar functionality with a different
+   syntax, but some of these mail systems do not have an equivalent to
+   the SMTP envelope.  Therefore, when a message leaves the Internet
+   environment, it may be necessary to fold the SMTP envelope
+   information into the message header.  A possible solution would be to
+   create new header fields to carry the envelope information (e.g.,
+   "X-SMTP-MAIL:"  and "X-SMTP-RCPT:"); however, this would require
+   changes in mail programs in foreign environments and might risk
+   disclosure of private information (see section 7.2).
+
+3.8.2 Received Lines in Gatewaying
+
+   When forwarding a message into or out of the Internet environment, a
+   gateway MUST prepend a Received: line, but it MUST NOT alter in any
+   way a Received: line that is already in the header.
+
+   "Received:" fields of messages originating from other environments
+   may not conform exactly to this specification.  However, the most
+   important use of Received: lines is for debugging mail faults, and
+   this debugging can be severely hampered by well-meaning gateways that
+   try to "fix" a Received: line.  As another consequence of trace
+   fields arising in non-SMTP environments, receiving systems MUST NOT
+   reject mail based on the format of a trace field and SHOULD be
+   extremely robust in the light of unexpected information or formats in
+   those fields.
+
+   The gateway SHOULD indicate the environment and protocol in the "via"
+   clauses of Received field(s) that it supplies.
+
+3.8.3 Addresses in Gatewaying
+
+   From the Internet side, the gateway SHOULD accept all valid address
+   formats in SMTP commands and in RFC 822 headers, and all valid RFC
+   822 messages.  Addresses and headers generated by gateways MUST
+   conform to applicable Internet standards (including this one and RFC
+   822).  Gateways are, of course, subject to the same rules for
+   handling source routes as those described for other SMTP systems in
+   section 3.3.
+
+
+
+
+
+Klensin                     Standards Track                    [Page 26]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+3.8.4 Other Header Fields in Gatewaying
+
+   The gateway MUST ensure that all header fields of a message that it
+   forwards into the Internet mail environment meet the requirements for
+   Internet mail.  In particular, all addresses in "From:", "To:",
+   "Cc:", etc., fields MUST be transformed (if necessary) to satisfy RFC
+   822 syntax, MUST reference only fully-qualified domain names, and
+   MUST be effective and useful for sending replies.  The translation
+   algorithm used to convert mail from the Internet protocols to another
+   environment's protocol SHOULD ensure that error messages from the
+   foreign mail environment are delivered to the return path from the
+   SMTP envelope, not to the sender listed in the "From:" field (or
+   other fields) of the RFC 822 message.
+
+3.8.5 Envelopes in Gatewaying
+
+   Similarly, when forwarding a message from another environment into
+   the Internet, the gateway SHOULD set the envelope return path in
+   accordance with an error message return address, if supplied by the
+   foreign environment.  If the foreign environment has no equivalent
+   concept, the gateway must select and use a best approximation, with
+   the message originator's address as the default of last resort.
+
+3.9 Terminating Sessions and Connections
+
+   An SMTP connection is terminated when the client sends a QUIT
+   command.  The server responds with a positive reply code, after which
+   it closes the connection.
+
+   An SMTP server MUST NOT intentionally close the connection except:
+
+   -  After receiving a QUIT command and responding with a 221 reply.
+
+   -  After detecting the need to shut down the SMTP service and
+      returning a 421 response code.  This response code can be issued
+      after the server receives any command or, if necessary,
+      asynchronously from command receipt (on the assumption that the
+      client will receive it after the next command is issued).
+
+   In particular, a server that closes connections in response to
+   commands that are not understood is in violation of this
+   specification.  Servers are expected to be tolerant of unknown
+   commands, issuing a 500 reply and awaiting further instructions from
+   the client.
+
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 27]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   An SMTP server which is forcibly shut down via external means SHOULD
+   attempt to send a line containing a 421 response code to the SMTP
+   client before exiting.  The SMTP client will normally read the 421
+   response code after sending its next command.
+
+   SMTP clients that experience a connection close, reset, or other
+   communications failure due to circumstances not under their control
+   (in violation of the intent of this specification but sometimes
+   unavoidable) SHOULD, to maintain the robustness of the mail system,
+   treat the mail transaction as if a 451 response had been received and
+   act accordingly.
+
+3.10 Mailing Lists and Aliases
+
+   An SMTP-capable host SHOULD support both the alias and the list
+   models of address expansion for multiple delivery.  When a message is
+   delivered or forwarded to each address of an expanded list form, the
+   return address in the envelope ("MAIL FROM:") MUST be changed to be
+   the address of a person or other entity who administers the list.
+   However, in this case, the message header [32] MUST be left
+   unchanged; in particular, the "From" field of the message header is
+   unaffected.
+
+   An important mail facility is a mechanism for multi-destination
+   delivery of a single message, by transforming (or "expanding" or
+   "exploding") a pseudo-mailbox address into a list of destination
+   mailbox addresses.  When a message is sent to such a pseudo-mailbox
+   (sometimes called an "exploder"), copies are forwarded or
+   redistributed to each mailbox in the expanded list.  Servers SHOULD
+   simply utilize the addresses on the list; application of heuristics
+   or other matching rules to eliminate some addresses, such as that of
+   the originator, is strongly discouraged.  We classify such a pseudo-
+   mailbox as an "alias" or a "list", depending upon the expansion
+   rules.
+
+3.10.1 Alias
+
+   To expand an alias, the recipient mailer simply replaces the pseudo-
+   mailbox address in the envelope with each of the expanded addresses
+   in turn; the rest of the envelope and the message body are left
+   unchanged.  The message is then delivered or forwarded to each
+   expanded address.
+
+3.10.2 List
+
+   A mailing list may be said to operate by "redistribution" rather than
+   by "forwarding".  To expand a list, the recipient mailer replaces the
+   pseudo-mailbox address in the envelope with all of the expanded
+
+
+
+Klensin                     Standards Track                    [Page 28]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   addresses.  The return address in the envelope is changed so that all
+   error messages generated by the final deliveries will be returned to
+   a list administrator, not to the message originator, who generally
+   has no control over the contents of the list and will typically find
+   error messages annoying.
+
+4. The SMTP Specifications
+
+4.1 SMTP Commands
+
+4.1.1 Command Semantics and Syntax
+
+   The SMTP commands define the mail transfer or the mail system
+   function requested by the user.  SMTP commands are character strings
+   terminated by <CRLF>.  The commands themselves are alphabetic
+   characters terminated by <SP> if parameters follow and <CRLF>
+   otherwise.  (In the interest of improved interoperability, SMTP
+   receivers are encouraged to tolerate trailing white space before the
+   terminating <CRLF>.)  The syntax of the local part of a mailbox must
+   conform to receiver site conventions and the syntax specified in
+   section 4.1.2.  The SMTP commands are discussed below.  The SMTP
+   replies are discussed in section 4.2.
+
+   A mail transaction involves several data objects which are
+   communicated as arguments to different commands.  The reverse-path is
+   the argument of the MAIL command, the forward-path is the argument of
+   the RCPT command, and the mail data is the argument of the DATA
+   command.  These arguments or data objects must be transmitted and
+   held pending the confirmation communicated by the end of mail data
+   indication which finalizes the transaction.  The model for this is
+   that distinct buffers are provided to hold the types of data objects,
+   that is, there is a reverse-path buffer, a forward-path buffer, and a
+   mail data buffer.  Specific commands cause information to be appended
+   to a specific buffer, or cause one or more buffers to be cleared.
+
+   Several commands (RSET, DATA, QUIT) are specified as not permitting
+   parameters.  In the absence of specific extensions offered by the
+   server and accepted by the client, clients MUST NOT send such
+   parameters and servers SHOULD reject commands containing them as
+   having invalid syntax.
+
+4.1.1.1  Extended HELLO (EHLO) or HELLO (HELO)
+
+   These commands are used to identify the SMTP client to the SMTP
+   server.  The argument field contains the fully-qualified domain name
+   of the SMTP client if one is available.  In situations in which the
+   SMTP client system does not have a meaningful domain name (e.g., when
+   its address is dynamically allocated and no reverse mapping record is
+
+
+
+Klensin                     Standards Track                    [Page 29]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   available), the client SHOULD send an address literal (see section
+   4.1.3), optionally followed by information that will help to identify
+   the client system.  y The SMTP server identifies itself to the SMTP
+   client in the connection greeting reply and in the response to this
+   command.
+
+   A client SMTP SHOULD start an SMTP session by issuing the EHLO
+   command.  If the SMTP server supports the SMTP service extensions it
+   will give a successful response, a failure response, or an error
+   response.  If the SMTP server, in violation of this specification,
+   does not support any SMTP service extensions it will generate an
+   error response.  Older client SMTP systems MAY, as discussed above,
+   use HELO (as specified in RFC 821) instead of EHLO, and servers MUST
+   support the HELO command and reply properly to it.  In any event, a
+   client MUST issue HELO or EHLO before starting a mail transaction.
+
+   These commands, and a "250 OK" reply to one of them, confirm that
+   both the SMTP client and the SMTP server are in the initial state,
+   that is, there is no transaction in progress and all state tables and
+   buffers are cleared.
+
+   Syntax:
+
+      ehlo            = "EHLO" SP Domain CRLF
+      helo            = "HELO" SP Domain CRLF
+
+   Normally, the response to EHLO will be a multiline reply.  Each line
+   of the response contains a keyword and, optionally, one or more
+   parameters.  Following the normal syntax for multiline replies, these
+   keyworks follow the code (250) and a hyphen for all but the last
+   line, and the code and a space for the last line.  The syntax for a
+   positive response, using the ABNF notation and terminal symbols of
+   [8], is:
+
+      ehlo-ok-rsp  =    ( "250"    domain [ SP ehlo-greet ] CRLF )
+                   / (    "250-"   domain [ SP ehlo-greet ] CRLF
+                       *( "250-"   ehlo-line                CRLF )
+                          "250"    SP ehlo-line             CRLF  )
+
+      ehlo-greet   = 1*(%d0-9 / %d11-12 / %d14-127)
+                   ; string of any characters other than CR or LF
+
+      ehlo-line    = ehlo-keyword *( SP ehlo-param )
+
+      ehlo-keyword = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-")
+                   ; additional syntax of ehlo-params depends on
+                   ; ehlo-keyword
+
+
+
+
+Klensin                     Standards Track                    [Page 30]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+      ehlo-param   = 1*(%d33-127)
+                   ; any CHAR excluding <SP> and all
+                   ; control characters (US-ASCII 0-31 inclusive)
+
+   Although EHLO keywords may be specified in upper, lower, or mixed
+   case, they MUST always be recognized and processed in a case-
+   insensitive manner.  This is simply an extension of practices
+   specified in RFC 821 and section 2.4.1.
+
+4.1.1.2 MAIL (MAIL)
+
+   This command is used to initiate a mail transaction in which the mail
+   data is delivered to an SMTP server which may, in turn, deliver it to
+   one or more mailboxes or pass it on to another system (possibly using
+   SMTP).  The argument field contains a reverse-path and may contain
+   optional parameters.  In general, the MAIL command may be sent only
+   when no mail transaction is in progress, see section 4.1.4.
+
+   The reverse-path consists of the sender mailbox.  Historically, that
+   mailbox might optionally have been preceded by a list of hosts, but
+   that behavior is now deprecated (see appendix C).  In some types of
+   reporting messages for which a reply is likely to cause a mail loop
+   (for example, mail delivery and nondelivery notifications), the
+   reverse-path may be null (see section 3.7).
+
+   This command clears the reverse-path buffer, the forward-path buffer,
+   and the mail data buffer; and inserts the reverse-path information
+   from this command into the reverse-path buffer.
+
+   If service extensions were negotiated, the MAIL command may also
+   carry parameters associated with a particular service extension.
+
+   Syntax:
+
+      "MAIL FROM:" ("<>" / Reverse-Path)
+                       [SP Mail-parameters] CRLF
+
+4.1.1.3 RECIPIENT (RCPT)
+
+   This command is used to identify an individual recipient of the mail
+   data; multiple recipients are specified by multiple use of this
+   command.  The argument field contains a forward-path and may contain
+   optional parameters.
+
+   The forward-path normally consists of the required destination
+   mailbox.  Sending systems SHOULD not generate the optional list of
+   hosts known as a source route.  Receiving systems MUST recognize
+
+
+
+
+Klensin                     Standards Track                    [Page 31]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   source route syntax but SHOULD strip off the source route
+   specification and utilize the domain name associated with the mailbox
+   as if the source route had not been provided.
+
+   Similarly, relay hosts SHOULD strip or ignore source routes, and
+   names MUST NOT be copied into the reverse-path.  When mail reaches
+   its ultimate destination (the forward-path contains only a
+   destination mailbox), the SMTP server inserts it into the destination
+   mailbox in accordance with its host mail conventions.
+
+   For example, mail received at relay host xyz.com with envelope
+   commands
+
+      MAIL FROM:<userx@y.foo.org>
+      RCPT TO:<@hosta.int,@jkl.org:userc@d.bar.org>
+
+   will normally be sent directly on to host d.bar.org with envelope
+   commands
+
+      MAIL FROM:<userx@y.foo.org>
+      RCPT TO:<userc@d.bar.org>
+
+   As provided in appendix C, xyz.com MAY also choose to relay the
+   message to hosta.int, using the envelope commands
+
+      MAIL FROM:<userx@y.foo.org>
+      RCPT TO:<@hosta.int,@jkl.org:userc@d.bar.org>
+
+   or to jkl.org, using the envelope commands
+
+      MAIL FROM:<userx@y.foo.org>
+      RCPT TO:<@jkl.org:userc@d.bar.org>
+
+   Of course, since hosts are not required to relay mail at all, xyz.com
+   may also reject the message entirely when the RCPT command is
+   received, using a 550 code (since this is a "policy reason").
+
+   If service extensions were negotiated, the RCPT command may also
+   carry parameters associated with a particular service extension
+   offered by the server.  The client MUST NOT transmit parameters other
+   than those associated with a service extension offered by the server
+   in its EHLO response.
+
+Syntax:
+   "RCPT TO:" ("<Postmaster@" domain ">" / "<Postmaster>" / Forward-Path)
+                    [SP Rcpt-parameters] CRLF
+
+
+
+
+
+Klensin                     Standards Track                    [Page 32]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+4.1.1.4 DATA (DATA)
+
+   The receiver normally sends a 354 response to DATA, and then treats
+   the lines (strings ending in <CRLF> sequences, as described in
+   section 2.3.7) following the command as mail data from the sender.
+   This command causes the mail data to be appended to the mail data
+   buffer.  The mail data may contain any of the 128 ASCII character
+   codes, although experience has indicated that use of control
+   characters other than SP, HT, CR, and LF may cause problems and
+   SHOULD be avoided when possible.
+
+   The mail data is terminated by a line containing only a period, that
+   is, the character sequence "<CRLF>.<CRLF>" (see section 4.5.2).  This
+   is the end of mail data indication.  Note that the first <CRLF> of
+   this terminating sequence is also the <CRLF> that ends the final line
+   of the data (message text) or, if there was no data, ends the DATA
+   command itself.  An extra <CRLF> MUST NOT be added, as that would
+   cause an empty line to be added to the message.  The only exception
+   to this rule would arise if the message body were passed to the
+   originating SMTP-sender with a final "line" that did not end in
+   <CRLF>; in that case, the originating SMTP system MUST either reject
+   the message as invalid or add <CRLF> in order to have the receiving
+   SMTP server recognize the "end of data" condition.
+
+   The custom of accepting lines ending only in <LF>, as a concession to
+   non-conforming behavior on the part of some UNIX systems, has proven
+   to cause more interoperability problems than it solves, and SMTP
+   server systems MUST NOT do this, even in the name of improved
+   robustness.  In particular, the sequence "<LF>.<LF>" (bare line
+   feeds, without carriage returns) MUST NOT be treated as equivalent to
+   <CRLF>.<CRLF> as the end of mail data indication.
+
+   Receipt of the end of mail data indication requires the server to
+   process the stored mail transaction information.  This processing
+   consumes the information in the reverse-path buffer, the forward-path
+   buffer, and the mail data buffer, and on the completion of this
+   command these buffers are cleared.  If the processing is successful,
+   the receiver MUST send an OK reply.  If the processing fails the
+   receiver MUST send a failure reply.  The SMTP model does not allow
+   for partial failures at this point: either the message is accepted by
+   the server for delivery and a positive response is returned or it is
+   not accepted and a failure reply is returned.  In sending a positive
+   completion reply to the end of data indication, the receiver takes
+   full responsibility for the message (see section 6.1).  Errors that
+   are diagnosed subsequently MUST be reported in a mail message, as
+   discussed in section 4.4.
+
+
+
+
+
+Klensin                     Standards Track                    [Page 33]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   When the SMTP server accepts a message either for relaying or for
+   final delivery, it inserts a trace record (also referred to
+   interchangeably as a "time stamp line" or "Received" line) at the top
+   of the mail data.  This trace record indicates the identity of the
+   host that sent the message, the identity of the host that received
+   the message (and is inserting this time stamp), and the date and time
+   the message was received.  Relayed messages will have multiple time
+   stamp lines.  Details for formation of these lines, including their
+   syntax, is specified in section 4.4.
+
+   Additional discussion about the operation of the DATA command appears
+   in section 3.3.
+
+   Syntax:
+      "DATA" CRLF
+
+4.1.1.5 RESET (RSET)
+
+   This command specifies that the current mail transaction will be
+   aborted.  Any stored sender, recipients, and mail data MUST be
+   discarded, and all buffers and state tables cleared.  The receiver
+   MUST send a "250 OK" reply to a RSET command with no arguments.  A
+   reset command may be issued by the client at any time.  It is
+   effectively equivalent to a NOOP (i.e., if has no effect) if issued
+   immediately after EHLO, before EHLO is issued in the session, after
+   an end-of-data indicator has been sent and acknowledged, or
+   immediately before a QUIT.  An SMTP server MUST NOT close the
+   connection as the result of receiving a RSET; that action is reserved
+   for QUIT (see section 4.1.1.10).
+
+   Since EHLO implies some additional processing and response by the
+   server, RSET will normally be more efficient than reissuing that
+   command, even though the formal semantics are the same.
+
+   There are circumstances, contrary to the intent of this
+   specification, in which an SMTP server may receive an indication that
+   the underlying TCP connection has been closed or reset.  To preserve
+   the robustness of the mail system, SMTP servers SHOULD be prepared
+   for this condition and SHOULD treat it as if a QUIT had been received
+   before the connection disappeared.
+
+   Syntax:
+      "RSET" CRLF
+
+
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 34]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+4.1.1.6 VERIFY (VRFY)
+
+   This command asks the receiver to confirm that the argument
+   identifies a user or mailbox.  If it is a user name, information is
+   returned as specified in section 3.5.
+
+   This command has no effect on the reverse-path buffer, the forward-
+   path buffer, or the mail data buffer.
+
+   Syntax:
+      "VRFY" SP String CRLF
+
+4.1.1.7 EXPAND (EXPN)
+
+   This command asks the receiver to confirm that the argument
+   identifies a mailing list, and if so, to return the membership of
+   that list.  If the command is successful, a reply is returned
+   containing information as described in section 3.5.  This reply will
+   have multiple lines except in the trivial case of a one-member list.
+
+   This command has no effect on the reverse-path buffer, the forward-
+   path buffer, or the mail data buffer and may be issued at any time.
+
+   Syntax:
+      "EXPN" SP String CRLF
+
+4.1.1.8 HELP (HELP)
+
+   This command causes the server to send helpful information to the
+   client.  The command MAY take an argument (e.g., any command name)
+   and return more specific information as a response.
+
+   This command has no effect on the reverse-path buffer, the forward-
+   path buffer, or the mail data buffer and may be issued at any time.
+
+   SMTP servers SHOULD support HELP without arguments and MAY support it
+   with arguments.
+
+   Syntax:
+      "HELP" [ SP String ] CRLF
+
+4.1.1.9 NOOP (NOOP)
+
+   This command does not affect any parameters or previously entered
+   commands.  It specifies no action other than that the receiver send
+   an OK reply.
+
+
+
+
+
+Klensin                     Standards Track                    [Page 35]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   This command has no effect on the reverse-path buffer, the forward-
+   path buffer, or the mail data buffer and may be issued at any time.
+   If a parameter string is specified, servers SHOULD ignore it.
+
+   Syntax:
+      "NOOP" [ SP String ] CRLF
+
+4.1.1.10 QUIT (QUIT)
+
+   This command specifies that the receiver MUST send an OK reply, and
+   then close the transmission channel.
+
+   The receiver MUST NOT intentionally close the transmission channel
+   until it receives and replies to a QUIT command (even if there was an
+   error).  The sender MUST NOT intentionally close the transmission
+   channel until it sends a QUIT command and SHOULD wait until it
+   receives the reply (even if there was an error response to a previous
+   command).  If the connection is closed prematurely due to violations
+   of the above or system or network failure, the server MUST cancel any
+   pending transaction, but not undo any previously completed
+   transaction, and generally MUST act as if the command or transaction
+   in progress had received a temporary error (i.e., a 4yz response).
+
+   The QUIT command may be issued at any time.
+
+   Syntax:
+      "QUIT" CRLF
+
+4.1.2 Command Argument Syntax
+
+   The syntax of the argument fields of the above commands (using the
+   syntax specified in [8] where applicable) is given below.  Some of
+   the productions given below are used only in conjunction with source
+   routes as described in appendix C.  Terminals not defined in this
+   document, such as ALPHA, DIGIT, SP, CR, LF, CRLF, are as defined in
+   the "core" syntax [8 (section 6)] or in the message format syntax
+   [32].
+
+      Reverse-path = Path
+      Forward-path = Path
+      Path = "<" [ A-d-l ":" ] Mailbox ">"
+      A-d-l = At-domain *( "," A-d-l )
+            ; Note that this form, the so-called "source route",
+            ; MUST BE accepted, SHOULD NOT be generated, and SHOULD be
+            ; ignored.
+      At-domain = "@" domain
+      Mail-parameters = esmtp-param *(SP esmtp-param)
+      Rcpt-parameters = esmtp-param *(SP esmtp-param)
+
+
+
+Klensin                     Standards Track                    [Page 36]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+      esmtp-param     = esmtp-keyword ["=" esmtp-value]
+      esmtp-keyword   = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-")
+      esmtp-value     = 1*(%d33-60 / %d62-127)
+            ; any CHAR excluding "=", SP, and control characters
+      Keyword  = Ldh-str
+      Argument = Atom
+      Domain = (sub-domain 1*("." sub-domain)) / address-literal
+      sub-domain = Let-dig [Ldh-str]
+
+      address-literal = "[" IPv4-address-literal /
+                            IPv6-address-literal /
+                            General-address-literal "]"
+            ; See section 4.1.3
+
+      Mailbox = Local-part "@" Domain
+
+      Local-part = Dot-string / Quoted-string
+            ; MAY be case-sensitive
+
+      Dot-string = Atom *("." Atom)
+
+      Atom = 1*atext
+
+      Quoted-string = DQUOTE *qcontent DQUOTE
+
+      String = Atom / Quoted-string
+
+   While the above definition for Local-part is relatively permissive,
+   for maximum interoperability, a host that expects to receive mail
+   SHOULD avoid defining mailboxes where the Local-part requires (or
+   uses) the Quoted-string form or where the Local-part is case-
+   sensitive.  For any purposes that require generating or comparing
+   Local-parts (e.g., to specific mailbox names), all quoted forms MUST
+   be treated as equivalent and the sending system SHOULD transmit the
+   form that uses the minimum quoting possible.
+
+   Systems MUST NOT define mailboxes in such a way as to require the use
+   in SMTP of non-ASCII characters (octets with the high order bit set
+   to one) or ASCII "control characters" (decimal value 0-31 and 127).
+   These characters MUST NOT be used in MAIL or RCPT commands or other
+   commands that require mailbox names.
+
+   Note that the backslash, "\", is a quote character, which is used to
+   indicate that the next character is to be used literally (instead of
+   its normal interpretation).  For example, "Joe\,Smith" indicates a
+   single nine character user field with the comma being the fourth
+   character of the field.
+
+
+
+
+Klensin                     Standards Track                    [Page 37]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   To promote interoperability and consistent with long-standing
+   guidance about conservative use of the DNS in naming and applications
+   (e.g., see section 2.3.1 of the base DNS document, RFC1035 [22]),
+   characters outside the set of alphas, digits, and hyphen MUST NOT
+   appear in domain name labels for SMTP clients or servers.  In
+   particular, the underscore character is not permitted.  SMTP servers
+   that receive a command in which invalid character codes have been
+   employed, and for which there are no other reasons for rejection,
+   MUST reject that command with a 501 response.
+
+4.1.3 Address Literals
+
+   Sometimes a host is not known to the domain name system and
+   communication (and, in particular, communication to report and repair
+   the error) is blocked.  To bypass this barrier a special literal form
+   of the address is allowed as an alternative to a domain name.  For
+   IPv4 addresses, this form uses four small decimal integers separated
+   by dots and enclosed by brackets such as [123.255.37.2], which
+   indicates an (IPv4) Internet Address in sequence-of-octets form.  For
+   IPv6 and other forms of addressing that might eventually be
+   standardized, the form consists of a standardized "tag" that
+   identifies the address syntax, a colon, and the address itself, in a
+   format specified as part of the IPv6 standards [17].
+
+   Specifically:
+
+      IPv4-address-literal = Snum 3("." Snum)
+      IPv6-address-literal = "IPv6:" IPv6-addr
+      General-address-literal = Standardized-tag ":" 1*dcontent
+      Standardized-tag = Ldh-str
+            ; MUST be specified in a standards-track RFC
+            ; and registered with IANA
+
+      Snum = 1*3DIGIT  ; representing a decimal integer
+            ; value in the range 0 through 255
+      Let-dig = ALPHA / DIGIT
+      Ldh-str = *( ALPHA / DIGIT / "-" ) Let-dig
+
+      IPv6-addr = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp
+      IPv6-hex  = 1*4HEXDIG
+      IPv6-full = IPv6-hex 7(":" IPv6-hex)
+      IPv6-comp = [IPv6-hex *5(":" IPv6-hex)] "::" [IPv6-hex *5(":"
+                 IPv6-hex)]
+            ; The "::" represents at least 2 16-bit groups of zeros
+            ; No more than 6 groups in addition to the "::" may be
+            ; present
+      IPv6v4-full = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal
+      IPv6v4-comp = [IPv6-hex *3(":" IPv6-hex)] "::"
+
+
+
+Klensin                     Standards Track                    [Page 38]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+                   [IPv6-hex *3(":" IPv6-hex) ":"] IPv4-address-literal
+            ; The "::" represents at least 2 16-bit groups of zeros
+            ; No more than 4 groups in addition to the "::" and
+            ; IPv4-address-literal may be present
+
+4.1.4 Order of Commands
+
+   There are restrictions on the order in which these commands may be
+   used.
+
+   A session that will contain mail transactions MUST first be
+   initialized by the use of the EHLO command.  An SMTP server SHOULD
+   accept commands for non-mail transactions (e.g., VRFY or EXPN)
+   without this initialization.
+
+   An EHLO command MAY be issued by a client later in the session.  If
+   it is issued after the session begins, the SMTP server MUST clear all
+   buffers and reset the state exactly as if a RSET command had been
+   issued.  In other words, the sequence of RSET followed immediately by
+   EHLO is redundant, but not harmful other than in the performance cost
+   of executing unnecessary commands.
+
+   If the EHLO command is not acceptable to the SMTP server, 501, 500,
+   or 502 failure replies MUST be returned as appropriate.  The SMTP
+   server MUST stay in the same state after transmitting these replies
+   that it was in before the EHLO was received.
+
+   The SMTP client MUST, if possible, ensure that the domain parameter
+   to the EHLO command is a valid principal host name (not a CNAME or MX
+   name) for its host.  If this is not possible (e.g., when the client's
+   address is dynamically assigned and the client does not have an
+   obvious name), an address literal SHOULD be substituted for the
+   domain name and supplemental information provided that will assist in
+   identifying the client.
+
+   An SMTP server MAY verify that the domain name parameter in the EHLO
+   command actually corresponds to the IP address of the client.
+   However, the server MUST NOT refuse to accept a message for this
+   reason if the verification fails: the information about verification
+   failure is for logging and tracing only.
+
+   The NOOP, HELP, EXPN, VRFY, and RSET commands can be used at any time
+   during a session, or without previously initializing a session.  SMTP
+   servers SHOULD process these normally (that is, not return a 503
+   code) even if no EHLO command has yet been received; clients SHOULD
+   open a session with EHLO before sending these commands.
+
+
+
+
+
+Klensin                     Standards Track                    [Page 39]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   If these rules are followed, the example in RFC 821 that shows "550
+   access denied to you" in response to an EXPN command is incorrect
+   unless an EHLO command precedes the EXPN or the denial of access is
+   based on the client's IP address or other authentication or
+   authorization-determining mechanisms.
+
+   The MAIL command (or the obsolete SEND, SOML, or SAML commands)
+   begins a mail transaction.  Once started, a mail transaction consists
+   of a transaction beginning command, one or more RCPT commands, and a
+   DATA command, in that order.  A mail transaction may be aborted by
+   the RSET (or a new EHLO) command.  There may be zero or more
+   transactions in a session.  MAIL (or SEND, SOML, or SAML) MUST NOT be
+   sent if a mail transaction is already open, i.e., it should be sent
+   only if no mail transaction had been started in the session, or it
+   the previous one successfully concluded with a successful DATA
+   command, or if the previous one was aborted with a RSET.
+
+   If the transaction beginning command argument is not acceptable, a
+   501 failure reply MUST be returned and the SMTP server MUST stay in
+   the same state.  If the commands in a transaction are out of order to
+   the degree that they cannot be processed by the server, a 503 failure
+   reply MUST be returned and the SMTP server MUST stay in the same
+   state.
+
+   The last command in a session MUST be the QUIT command.  The QUIT
+   command cannot be used at any other time in a session, but SHOULD be
+   used by the client SMTP to request connection closure, even when no
+   session opening command was sent and accepted.
+
+4.1.5 Private-use Commands
+
+   As specified in section 2.2.2, commands starting in "X" may be used
+   by bilateral agreement between the client (sending) and server
+   (receiving) SMTP agents.  An SMTP server that does not recognize such
+   a command is expected to reply with "500 Command not recognized".  An
+   extended SMTP server MAY list the feature names associated with these
+   private commands in the response to the EHLO command.
+
+   Commands sent or accepted by SMTP systems that do not start with "X"
+   MUST conform to the requirements of section 2.2.2.
+
+4.2 SMTP Replies
+
+   Replies to SMTP commands serve to ensure the synchronization of
+   requests and actions in the process of mail transfer and to guarantee
+   that the SMTP client always knows the state of the SMTP server.
+   Every command MUST generate exactly one reply.
+
+
+
+
+Klensin                     Standards Track                    [Page 40]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   The details of the command-reply sequence are described in section
+   4.3.
+
+   An SMTP reply consists of a three digit number (transmitted as three
+   numeric characters) followed by some text unless specified otherwise
+   in this document.  The number is for use by automata to determine
+   what state to enter next; the text is for the human user.  The three
+   digits contain enough encoded information that the SMTP client need
+   not examine the text and may either discard it or pass it on to the
+   user, as appropriate.  Exceptions are as noted elsewhere in this
+   document.  In particular, the 220, 221, 251, 421, and 551 reply codes
+   are associated with message text that must be parsed and interpreted
+   by machines.  In the general case, the text may be receiver dependent
+   and context dependent, so there are likely to be varying texts for
+   each reply code.  A discussion of the theory of reply codes is given
+   in section 4.2.1.  Formally, a reply is defined to be the sequence: a
+   three-digit code, <SP>, one line of text, and <CRLF>, or a multiline
+   reply (as defined in section 4.2.1).  Since, in violation of this
+   specification, the text is sometimes not sent, clients which do not
+   receive it SHOULD be prepared to process the code alone (with or
+   without a trailing space character).  Only the EHLO, EXPN, and HELP
+   commands are expected to result in multiline replies in normal
+   circumstances, however, multiline replies are allowed for any
+   command.
+
+   In ABNF, server responses are:
+
+      Greeting = "220 " Domain [ SP text ] CRLF
+      Reply-line = Reply-code [ SP text ] CRLF
+
+   where "Greeting" appears only in the 220 response that announces that
+   the server is opening its part of the connection.
+
+   An SMTP server SHOULD send only the reply codes listed in this
+   document.  An SMTP server SHOULD use the text shown in the examples
+   whenever appropriate.
+
+   An SMTP client MUST determine its actions only by the reply code, not
+   by the text (except for the "change of address" 251 and 551 and, if
+   necessary, 220, 221, and 421 replies); in the general case, any text,
+   including no text at all (although senders SHOULD NOT send bare
+   codes), MUST be acceptable.  The space (blank) following the reply
+   code is considered part of the text.  Whenever possible, a receiver-
+   SMTP SHOULD test the first digit (severity indication) of the reply
+   code.
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 41]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   The list of codes that appears below MUST NOT be construed as
+   permanent.  While the addition of new codes should be a rare and
+   significant activity, with supplemental information in the textual
+   part of the response being preferred, new codes may be added as the
+   result of new Standards or Standards-track specifications.
+   Consequently, a sender-SMTP MUST be prepared to handle codes not
+   specified in this document and MUST do so by interpreting the first
+   digit only.
+
+4.2.1 Reply Code Severities and Theory
+
+   The three digits of the reply each have a special significance.  The
+   first digit denotes whether the response is good, bad or incomplete.
+   An unsophisticated SMTP client, or one that receives an unexpected
+   code, will be able to determine its next action (proceed as planned,
+   redo, retrench, etc.) by examining this first digit.  An SMTP client
+   that wants to know approximately what kind of error occurred (e.g.,
+   mail system error, command syntax error) may examine the second
+   digit.  The third digit and any supplemental information that may be
+   present is reserved for the finest gradation of information.
+
+   There are five values for the first digit of the reply code:
+
+   1yz   Positive Preliminary reply
+      The command has been accepted, but the requested action is being
+      held in abeyance, pending confirmation of the information in this
+      reply.  The SMTP client should send another command specifying
+      whether to continue or abort the action.  Note: unextended SMTP
+      does not have any commands that allow this type of reply, and so
+      does not have continue or abort commands.
+
+   2yz   Positive Completion reply
+      The requested action has been successfully completed.  A new
+      request may be initiated.
+
+   3yz   Positive Intermediate reply
+      The command has been accepted, but the requested action is being
+      held in abeyance, pending receipt of further information.  The
+      SMTP client should send another command specifying this
+      information.  This reply is used in command sequence groups (i.e.,
+      in DATA).
+
+   4yz   Transient Negative Completion reply
+      The command was not accepted, and the requested action did not
+      occur.  However, the error condition is temporary and the action
+      may be requested again.  The sender should return to the beginning
+      of the command sequence (if any).  It is difficult to assign a
+      meaning to "transient" when two different sites (receiver- and
+
+
+
+Klensin                     Standards Track                    [Page 42]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+      sender-SMTP agents) must agree on the interpretation.  Each reply
+      in this category might have a different time value, but the SMTP
+      client is encouraged to try again.  A rule of thumb to determine
+      whether a reply fits into the 4yz or the 5yz category (see below)
+      is that replies are 4yz if they can be successful if repeated
+      without any change in command form or in properties of the sender
+      or receiver (that is, the command is repeated identically and the
+      receiver does not put up a new implementation.)
+
+   5yz   Permanent Negative Completion reply
+      The command was not accepted and the requested action did not
+      occur.  The SMTP client is discouraged from repeating the exact
+      request (in the same sequence).  Even some "permanent" error
+      conditions can be corrected, so the human user may want to direct
+      the SMTP client to reinitiate the command sequence by direct
+      action at some point in the future (e.g., after the spelling has
+      been changed, or the user has altered the account status).
+
+   The second digit encodes responses in specific categories:
+
+   x0z   Syntax: These replies refer to syntax errors, syntactically
+      correct commands that do not fit any functional category, and
+      unimplemented or superfluous commands.
+
+   x1z   Information:  These are replies to requests for information,
+      such as status or help.
+
+   x2z   Connections: These are replies referring to the transmission
+      channel.
+
+   x3z   Unspecified.
+
+   x4z   Unspecified.
+
+   x5z   Mail system: These replies indicate the status of the receiver
+      mail system vis-a-vis the requested transfer or other mail system
+      action.
+
+   The third digit gives a finer gradation of meaning in each category
+   specified by the second digit.  The list of replies illustrates this.
+   Each reply text is recommended rather than mandatory, and may even
+   change according to the command with which it is associated.  On the
+   other hand, the reply codes must strictly follow the specifications
+   in this section.  Receiver implementations should not invent new
+   codes for slightly different situations from the ones described here,
+   but rather adapt codes already defined.
+
+
+
+
+
+Klensin                     Standards Track                    [Page 43]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   For example, a command such as NOOP, whose successful execution does
+   not offer the SMTP client any new information, will return a 250
+   reply.  The reply is 502 when the command requests an unimplemented
+   non-site-specific action.  A refinement of that is the 504 reply for
+   a command that is implemented, but that requests an unimplemented
+   parameter.
+
+   The reply text may be longer than a single line; in these cases the
+   complete text must be marked so the SMTP client knows when it can
+   stop reading the reply.  This requires a special format to indicate a
+   multiple line reply.
+
+   The format for multiline replies requires that every line, except the
+   last, begin with the reply code, followed immediately by a hyphen,
+   "-" (also known as minus), followed by text.  The last line will
+   begin with the reply code, followed immediately by <SP>, optionally
+   some text, and <CRLF>.  As noted above, servers SHOULD send the <SP>
+   if subsequent text is not sent, but clients MUST be prepared for it
+   to be omitted.
+
+   For example:
+
+      123-First line
+      123-Second line
+      123-234 text beginning with numbers
+      123 The last line
+
+   In many cases the SMTP client then simply needs to search for a line
+   beginning with the reply code followed by <SP> or <CRLF> and ignore
+   all preceding lines.  In a few cases, there is important data for the
+   client in the reply "text".  The client will be able to identify
+   these cases from the current context.
+
+4.2.2 Reply Codes by Function Groups
+
+      500 Syntax error, command unrecognized
+         (This may include errors such as command line too long)
+      501 Syntax error in parameters or arguments
+      502 Command not implemented  (see section 4.2.4)
+      503 Bad sequence of commands
+      504 Command parameter not implemented
+
+      211 System status, or system help reply
+      214 Help message
+         (Information on how to use the receiver or the meaning of a
+         particular non-standard command; this reply is useful only
+         to the human user)
+
+
+
+
+Klensin                     Standards Track                    [Page 44]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+      220 <domain> Service ready
+      221 <domain> Service closing transmission channel
+      421 <domain> Service not available, closing transmission channel
+         (This may be a reply to any command if the service knows it
+         must shut down)
+
+      250 Requested mail action okay, completed
+      251 User not local; will forward to <forward-path>
+         (See section 3.4)
+      252 Cannot VRFY user, but will accept message and attempt
+          delivery
+         (See section 3.5.3)
+      450 Requested mail action not taken: mailbox unavailable
+         (e.g., mailbox busy)
+      550 Requested action not taken: mailbox unavailable
+         (e.g., mailbox not found, no access, or command rejected
+         for policy reasons)
+      451 Requested action aborted: error in processing
+      551 User not local; please try <forward-path>
+         (See section 3.4)
+      452 Requested action not taken: insufficient system storage
+      552 Requested mail action aborted: exceeded storage allocation
+      553 Requested action not taken: mailbox name not allowed
+         (e.g., mailbox syntax incorrect)
+      354 Start mail input; end with <CRLF>.<CRLF>
+      554 Transaction failed (Or, in the case of a connection-opening
+          response, "No SMTP service here")
+
+4.2.3  Reply Codes in Numeric Order
+
+      211 System status, or system help reply
+      214 Help message
+         (Information on how to use the receiver or the meaning of a
+         particular non-standard command; this reply is useful only
+         to the human user)
+      220 <domain> Service ready
+      221 <domain> Service closing transmission channel
+      250 Requested mail action okay, completed
+      251 User not local; will forward to <forward-path>
+         (See section 3.4)
+      252 Cannot VRFY user, but will accept message and attempt
+         delivery
+         (See section 3.5.3)
+
+      354 Start mail input; end with <CRLF>.<CRLF>
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 45]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+      421 <domain> Service not available, closing transmission channel
+         (This may be a reply to any command if the service knows it
+         must shut down)
+      450 Requested mail action not taken: mailbox unavailable
+         (e.g., mailbox busy)
+      451 Requested action aborted: local error in processing
+      452 Requested action not taken: insufficient system storage
+      500 Syntax error, command unrecognized
+         (This may include errors such as command line too long)
+      501 Syntax error in parameters or arguments
+      502 Command not implemented (see section 4.2.4)
+      503 Bad sequence of commands
+      504 Command parameter not implemented
+      550 Requested action not taken: mailbox unavailable
+         (e.g., mailbox not found, no access, or command rejected
+         for policy reasons)
+      551 User not local; please try <forward-path>
+         (See section 3.4)
+      552 Requested mail action aborted: exceeded storage allocation
+      553 Requested action not taken: mailbox name not allowed
+         (e.g., mailbox syntax incorrect)
+      554 Transaction failed  (Or, in the case of a connection-opening
+          response, "No SMTP service here")
+
+4.2.4 Reply Code 502
+
+   Questions have been raised as to when reply code 502 (Command not
+   implemented) SHOULD be returned in preference to other codes.  502
+   SHOULD be used when the command is actually recognized by the SMTP
+   server, but not implemented.  If the command is not recognized, code
+   500 SHOULD be returned.  Extended SMTP systems MUST NOT list
+   capabilities in response to EHLO for which they will return 502 (or
+   500) replies.
+
+4.2.5 Reply Codes After DATA and the Subsequent <CRLF>.<CRLF>
+
+   When an SMTP server returns a positive completion status (2yz code)
+   after the DATA command is completed with <CRLF>.<CRLF>, it accepts
+   responsibility for:
+
+   -  delivering the message (if the recipient mailbox exists), or
+
+   -  if attempts to deliver the message fail due to transient
+      conditions, retrying delivery some reasonable number of times at
+      intervals as specified in section 4.5.4.
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 46]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   -  if attempts to deliver the message fail due to permanent
+      conditions, or if repeated attempts to deliver the message fail
+      due to transient conditions, returning appropriate notification to
+      the sender of the original message (using the address in the SMTP
+      MAIL command).
+
+   When an SMTP server returns a permanent error status (5yz) code after
+   the DATA command is completed with <CRLF>.<CRLF>, it MUST NOT make
+   any subsequent attempt to deliver that message.  The SMTP client
+   retains responsibility for delivery of that message and may either
+   return it to the user or requeue it for a subsequent attempt (see
+   section 4.5.4.1).
+
+   The user who originated the message SHOULD be able to interpret the
+   return of a transient failure status (by mail message or otherwise)
+   as a non-delivery indication, just as a permanent failure would be
+   interpreted.  I.e., if the client SMTP successfully handles these
+   conditions, the user will not receive such a reply.
+
+   When an SMTP server returns a permanent error status (5yz) code after
+   the DATA command is completely with <CRLF>.<CRLF>, it MUST NOT make
+   any subsequent attempt to deliver the message.  As with temporary
+   error status codes, the SMTP client retains responsibility for the
+   message, but SHOULD not again attempt delivery to the same server
+   without user review and intervention of the message.
+
+4.3 Sequencing of Commands and Replies
+
+4.3.1 Sequencing Overview
+
+   The communication between the sender and receiver is an alternating
+   dialogue, controlled by the sender.  As such, the sender issues a
+   command and the receiver responds with a reply.  Unless other
+   arrangements are negotiated through service extensions, the sender
+   MUST wait for this response before sending further commands.
+
+   One important reply is the connection greeting.  Normally, a receiver
+   will send a 220 "Service ready" reply when the connection is
+   completed.  The sender SHOULD wait for this greeting message before
+   sending any commands.
+
+   Note: all the greeting-type replies have the official name (the
+   fully-qualified primary domain name) of the server host as the first
+   word following the reply code.  Sometimes the host will have no
+   meaningful name.  See 4.1.3 for a discussion of alternatives in these
+   situations.
+
+
+
+
+
+Klensin                     Standards Track                    [Page 47]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   For example,
+
+      220 ISIF.USC.EDU Service ready
+   or
+      220 mail.foo.com SuperSMTP v 6.1.2 Service ready
+   or
+      220 [10.0.0.1] Clueless host service ready
+
+   The table below lists alternative success and failure replies for
+   each command.  These SHOULD be strictly adhered to: a receiver may
+   substitute text in the replies, but the meaning and action implied by
+   the code numbers and by the specific command reply sequence cannot be
+   altered.
+
+4.3.2 Command-Reply Sequences
+
+   Each command is listed with its usual possible replies.  The prefixes
+   used before the possible replies are "I" for intermediate, "S" for
+   success, and "E" for error.  Since some servers may generate other
+   replies under special circumstances, and to allow for future
+   extension, SMTP clients SHOULD, when possible, interpret only the
+   first digit of the reply and MUST be prepared to deal with
+   unrecognized reply codes by interpreting the first digit only.
+   Unless extended using the mechanisms described in section 2.2, SMTP
+   servers MUST NOT transmit reply codes to an SMTP client that are
+   other than three digits or that do not start in a digit between 2 and
+   5 inclusive.
+
+   These sequencing rules and, in principle, the codes themselves, can
+   be extended or modified by SMTP extensions offered by the server and
+   accepted (requested) by the client.
+
+   In addition to the codes listed below, any SMTP command can return
+   any of the following codes if the corresponding unusual circumstances
+   are encountered:
+
+   500  For the "command line too long" case or if the command name was
+      not recognized.  Note that producing a "command not recognized"
+      error in response to the required subset of these commands is a
+      violation of this specification.
+
+   501  Syntax error in command or arguments.  In order to provide for
+      future extensions, commands that are specified in this document as
+      not accepting arguments (DATA, RSET, QUIT) SHOULD return a 501
+      message if arguments are supplied in the absence of EHLO-
+      advertised extensions.
+
+   421  Service shutting down and closing transmission channel
+
+
+
+Klensin                     Standards Track                    [Page 48]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   Specific sequences are:
+
+   CONNECTION ESTABLISHMENT
+      S: 220
+      E: 554
+   EHLO or HELO
+      S: 250
+      E: 504, 550
+   MAIL
+      S: 250
+      E: 552, 451, 452, 550, 553, 503
+   RCPT
+      S: 250, 251 (but see section 3.4 for discussion of 251 and 551)
+      E: 550, 551, 552, 553, 450, 451, 452, 503, 550
+   DATA
+      I: 354 -> data -> S: 250
+                        E: 552, 554, 451, 452
+      E: 451, 554, 503
+   RSET
+      S: 250
+   VRFY
+      S: 250, 251, 252
+      E: 550, 551, 553, 502, 504
+   EXPN
+      S: 250, 252
+      E: 550, 500, 502, 504
+   HELP
+      S: 211, 214
+      E: 502, 504
+   NOOP
+      S: 250
+   QUIT
+      S: 221
+
+4.4 Trace Information
+
+   When an SMTP server receives a message for delivery or further
+   processing, it MUST insert trace ("time stamp" or "Received")
+   information at the beginning of the message content, as discussed in
+   section 4.1.1.4.
+
+   This line MUST be structured as follows:
+
+   -  The FROM field, which MUST be supplied in an SMTP environment,
+      SHOULD contain both (1) the name of the source host as presented
+      in the EHLO command and (2) an address literal containing the IP
+      address of the source, determined from the TCP connection.
+
+
+
+
+Klensin                     Standards Track                    [Page 49]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   -  The ID field MAY contain an "@" as suggested in RFC 822, but this
+      is not required.
+
+   -  The FOR field MAY contain a list of <path> entries when multiple
+      RCPT commands have been given.  This may raise some security
+      issues and is usually not desirable; see section 7.2.
+
+   An Internet mail program MUST NOT change a Received: line that was
+   previously added to the message header.  SMTP servers MUST prepend
+   Received lines to messages; they MUST NOT change the order of
+   existing lines or insert Received lines in any other location.
+
+   As the Internet grows, comparability of Received fields is important
+   for detecting problems, especially slow relays.  SMTP servers that
+   create Received fields SHOULD use explicit offsets in the dates
+   (e.g., -0800), rather than time zone names of any type.  Local time
+   (with an offset) is preferred to UT when feasible.  This formulation
+   allows slightly more information about local circumstances to be
+   specified.  If UT is needed, the receiver need merely do some simple
+   arithmetic to convert the values.  Use of UT loses information about
+   the time zone-location of the server.  If it is desired to supply a
+   time zone name, it SHOULD be included in a comment.
+
+   When the delivery SMTP server makes the "final delivery" of a
+   message, it inserts a return-path line at the beginning of the mail
+   data.  This use of return-path is required; mail systems MUST support
+   it.  The return-path line preserves the information in the <reverse-
+   path> from the MAIL command.  Here, final delivery means the message
+   has left the SMTP environment.  Normally, this would mean it had been
+   delivered to the destination user or an associated mail drop, but in
+   some cases it may be further processed and transmitted by another
+   mail system.
+
+   It is possible for the mailbox in the return path to be different
+   from the actual sender's mailbox, for example, if error responses are
+   to be delivered to a special error handling mailbox rather than to
+   the message sender.  When mailing lists are involved, this
+   arrangement is common and useful as a means of directing errors to
+   the list maintainer rather than the message originator.
+
+   The text above implies that the final mail data will begin with a
+   return path line, followed by one or more time stamp lines.  These
+   lines will be followed by the mail data headers and body [32].
+
+   It is sometimes difficult for an SMTP server to determine whether or
+   not it is making final delivery since forwarding or other operations
+   may occur after the message is accepted for delivery.  Consequently,
+
+
+
+
+Klensin                     Standards Track                    [Page 50]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   any further (forwarding, gateway, or relay) systems MAY remove the
+   return path and rebuild the MAIL command as needed to ensure that
+   exactly one such line appears in a delivered message.
+
+   A message-originating SMTP system SHOULD NOT send a message that
+   already contains a Return-path header.  SMTP servers performing a
+   relay function MUST NOT inspect the message data, and especially not
+   to the extent needed to determine if Return-path headers are present.
+   SMTP servers making final delivery MAY remove Return-path headers
+   before adding their own.
+
+   The primary purpose of the Return-path is to designate the address to
+   which messages indicating non-delivery or other mail system failures
+   are to be sent.  For this to be unambiguous, exactly one return path
+   SHOULD be present when the message is delivered.  Systems using RFC
+   822 syntax with non-SMTP transports SHOULD designate an unambiguous
+   address, associated with the transport envelope, to which error
+   reports (e.g., non-delivery messages) should be sent.
+
+   Historical note: Text in RFC 822 that appears to contradict the use
+   of the Return-path header (or the envelope reverse path address from
+   the MAIL command) as the destination for error messages is not
+   applicable on the Internet.  The reverse path address (as copied into
+   the Return-path) MUST be used as the target of any mail containing
+   delivery error messages.
+
+   In particular:
+
+   -  a gateway from SMTP->elsewhere SHOULD insert a return-path header,
+      unless it is known that the "elsewhere" transport also uses
+      Internet domain addresses and maintains the envelope sender
+      address separately.
+
+   -  a gateway from elsewhere->SMTP SHOULD delete any return-path
+      header present in the message, and either copy that information to
+      the SMTP envelope or combine it with information present in the
+      envelope of the other transport system to construct the reverse
+      path argument to the MAIL command in the SMTP envelope.
+
+   The server must give special treatment to cases in which the
+   processing following the end of mail data indication is only
+   partially successful.  This could happen if, after accepting several
+   recipients and the mail data, the SMTP server finds that the mail
+   data could be successfully delivered to some, but not all, of the
+   recipients.  In such cases, the response to the DATA command MUST be
+   an OK reply.  However, the SMTP server MUST compose and send an
+   "undeliverable mail" notification message to the originator of the
+   message.
+
+
+
+Klensin                     Standards Track                    [Page 51]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   A single notification listing all of the failed recipients or
+   separate notification messages MUST be sent for each failed
+   recipient.  For economy of processing by the sender, the former is
+   preferred when possible.  All undeliverable mail notification
+   messages are sent using the MAIL command (even if they result from
+   processing the obsolete SEND, SOML, or SAML commands) and use a null
+   return path as discussed in section 3.7.
+
+   The time stamp line and the return path line are formally defined as
+   follows:
+
+Return-path-line = "Return-Path:" FWS Reverse-path <CRLF>
+
+Time-stamp-line = "Received:" FWS Stamp <CRLF>
+
+Stamp = From-domain By-domain Opt-info ";"  FWS date-time
+
+      ; where "date-time" is as defined in [32]
+      ; but the "obs-" forms, especially two-digit
+      ; years, are prohibited in SMTP and MUST NOT be used.
+
+From-domain = "FROM" FWS Extended-Domain CFWS
+
+By-domain = "BY" FWS Extended-Domain CFWS
+
+Extended-Domain = Domain /
+           ( Domain FWS "(" TCP-info ")" ) /
+           ( Address-literal FWS "(" TCP-info ")" )
+
+TCP-info = Address-literal / ( Domain FWS Address-literal )
+      ; Information derived by server from TCP connection
+      ; not client EHLO.
+
+Opt-info = [Via] [With] [ID] [For]
+
+Via = "VIA" FWS Link CFWS
+
+With = "WITH" FWS Protocol CFWS
+
+ID = "ID" FWS String / msg-id CFWS
+
+For = "FOR" FWS 1*( Path / Mailbox ) CFWS
+
+Link = "TCP" / Addtl-Link
+Addtl-Link = Atom
+      ; Additional standard names for links are registered with the
+         ; Internet Assigned Numbers Authority (IANA).  "Via" is
+         ; primarily of value with non-Internet transports.  SMTP
+
+
+
+Klensin                     Standards Track                    [Page 52]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+         ; servers SHOULD NOT use unregistered names.
+Protocol = "ESMTP" / "SMTP" / Attdl-Protocol
+Attdl-Protocol = Atom
+      ; Additional standard names for protocols are registered with the
+         ; Internet Assigned Numbers Authority (IANA).  SMTP servers
+         ; SHOULD NOT use unregistered names.
+
+4.5 Additional Implementation Issues
+
+4.5.1 Minimum Implementation
+
+   In order to make SMTP workable, the following minimum implementation
+   is required for all receivers.  The following commands MUST be
+   supported to conform to this specification:
+
+      EHLO
+      HELO
+      MAIL
+      RCPT
+      DATA
+      RSET
+      NOOP
+      QUIT
+      VRFY
+
+   Any system that includes an SMTP server supporting mail relaying or
+   delivery MUST support the reserved mailbox "postmaster" as a case-
+   insensitive local name.  This postmaster address is not strictly
+   necessary if the server always returns 554 on connection opening (as
+   described in section 3.1).  The requirement to accept mail for
+   postmaster implies that RCPT commands which specify a mailbox for
+   postmaster at any of the domains for which the SMTP server provides
+   mail service, as well as the special case of "RCPT TO:<Postmaster>"
+   (with no domain specification), MUST be supported.
+
+   SMTP systems are expected to make every reasonable effort to accept
+   mail directed to Postmaster from any other system on the Internet.
+   In extreme cases --such as to contain a denial of service attack or
+   other breach of security-- an SMTP server may block mail directed to
+   Postmaster.  However, such arrangements SHOULD be narrowly tailored
+   so as to avoid blocking messages which are not part of such attacks.
+
+4.5.2 Transparency
+
+   Without some provision for data transparency, the character sequence
+   "<CRLF>.<CRLF>" ends the mail text and cannot be sent by the user.
+   In general, users are not aware of such "forbidden" sequences.  To
+
+
+
+
+Klensin                     Standards Track                    [Page 53]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   allow all user composed text to be transmitted transparently, the
+   following procedures are used:
+
+   -  Before sending a line of mail text, the SMTP client checks the
+      first character of the line.  If it is a period, one additional
+      period is inserted at the beginning of the line.
+
+   -  When a line of mail text is received by the SMTP server, it checks
+      the line.  If the line is composed of a single period, it is
+      treated as the end of mail indicator.  If the first character is a
+      period and there are other characters on the line, the first
+      character is deleted.
+
+   The mail data may contain any of the 128 ASCII characters.  All
+   characters are to be delivered to the recipient's mailbox, including
+   spaces, vertical and horizontal tabs, and other control characters.
+   If the transmission channel provides an 8-bit byte (octet) data
+   stream, the 7-bit ASCII codes are transmitted right justified in the
+   octets, with the high order bits cleared to zero.  See 3.7 for
+   special treatment of these conditions in SMTP systems serving a relay
+   function.
+
+   In some systems it may be necessary to transform the data as it is
+   received and stored.  This may be necessary for hosts that use a
+   different character set than ASCII as their local character set, that
+   store data in records rather than strings, or which use special
+   character sequences as delimiters inside mailboxes.  If such
+   transformations are necessary, they MUST be reversible, especially if
+   they are applied to mail being relayed.
+
+4.5.3 Sizes and Timeouts
+
+4.5.3.1 Size limits and minimums
+
+   There are several objects that have required minimum/maximum sizes.
+   Every implementation MUST be able to receive objects of at least
+   these sizes.  Objects larger than these sizes SHOULD be avoided when
+   possible.  However, some Internet mail constructs such as encoded
+   X.400 addresses [16] will often require larger objects: clients MAY
+   attempt to transmit these, but MUST be prepared for a server to
+   reject them if they cannot be handled by it.  To the maximum extent
+   possible, implementation techniques which impose no limits on the
+   length of these objects should be used.
+
+   local-part
+      The maximum total length of a user name or other local-part is 64
+      characters.
+
+
+
+
+Klensin                     Standards Track                    [Page 54]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   domain
+      The maximum total length of a domain name or number is 255
+      characters.
+
+   path
+      The maximum total length of a reverse-path or forward-path is 256
+      characters (including the punctuation and element separators).
+
+   command line
+      The maximum total length of a command line including the command
+      word and the <CRLF> is 512 characters.  SMTP extensions may be
+      used to increase this limit.
+
+   reply line
+      The maximum total length of a reply line including the reply code
+      and the <CRLF> is 512 characters.  More information may be
+      conveyed through multiple-line replies.
+
+   text line
+      The maximum total length of a text line including the <CRLF> is
+      1000 characters (not counting the leading dot duplicated for
+      transparency).  This number may be increased by the use of SMTP
+      Service Extensions.
+
+   message content
+      The maximum total length of a message content (including any
+      message headers as well as the message body) MUST BE at least 64K
+      octets.  Since the introduction of Internet standards for
+      multimedia mail [12], message lengths on the Internet have grown
+      dramatically, and message size restrictions should be avoided if
+      at all possible.  SMTP server systems that must impose
+      restrictions SHOULD implement the "SIZE" service extension [18],
+      and SMTP client systems that will send large messages SHOULD
+      utilize it when possible.
+
+   recipients buffer
+      The minimum total number of recipients that must be buffered is
+      100 recipients.  Rejection of messages (for excessive recipients)
+      with fewer than 100 RCPT commands is a violation of this
+      specification.  The general principle that relaying SMTP servers
+      MUST NOT, and delivery SMTP servers SHOULD NOT, perform validation
+      tests on message headers suggests that rejecting a message based
+      on the total number of recipients shown in header fields is to be
+      discouraged.  A server which imposes a limit on the number of
+      recipients MUST behave in an orderly fashion,  such as to reject
+      additional addresses over its limit rather than silently
+      discarding addresses previously accepted.  A client that needs to
+
+
+
+
+Klensin                     Standards Track                    [Page 55]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+      deliver a message containing over 100 RCPT commands SHOULD be
+      prepared to transmit in 100-recipient "chunks" if the server
+      declines to accept more than 100 recipients in a single message.
+
+   Errors due to exceeding these limits may be reported by using the
+   reply codes.  Some examples of reply codes are:
+
+      500 Line too long.
+   or
+      501 Path too long
+   or
+      452 Too many recipients  (see below)
+   or
+      552 Too much mail data.
+
+   RFC 821 [30] incorrectly listed the error where an SMTP server
+   exhausts its implementation limit on the number of RCPT commands
+   ("too many recipients") as having reply code 552.  The correct reply
+   code for this condition is 452.  Clients SHOULD treat a 552 code in
+   this case as a temporary, rather than permanent, failure so the logic
+   below works.
+
+   When a conforming SMTP server encounters this condition, it has at
+   least 100 successful RCPT commands in its recipients buffer.  If the
+   server is able to accept the message, then at least these 100
+   addresses will be removed from the SMTP client's queue.  When the
+   client attempts retransmission of those addresses which received 452
+   responses, at least 100 of these will be able to fit in the SMTP
+   server's recipients buffer.  Each retransmission attempt which is
+   able to deliver anything will be able to dispose of at least 100 of
+   these recipients.
+
+   If an SMTP server has an implementation limit on the number of RCPT
+   commands and this limit is exhausted, it MUST use a response code of
+   452 (but the client SHOULD also be prepared for a 552, as noted
+   above).  If the server has a configured site-policy limitation on the
+   number of RCPT commands, it MAY instead use a 5XX response code.
+   This would be most appropriate if the policy limitation was intended
+   to apply if the total recipient count for a particular message body
+   were enforced even if that message body was sent in multiple mail
+   transactions.
+
+4.5.3.2 Timeouts
+
+   An SMTP client MUST provide a timeout mechanism.  It MUST use per-
+   command timeouts rather than somehow trying to time the entire mail
+   transaction.  Timeouts SHOULD be easily reconfigurable, preferably
+   without recompiling the SMTP code.  To implement this, a timer is set
+
+
+
+Klensin                     Standards Track                    [Page 56]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   for each SMTP command and for each buffer of the data transfer.  The
+   latter means that the overall timeout is inherently proportional to
+   the size of the message.
+
+   Based on extensive experience with busy mail-relay hosts, the minimum
+   per-command timeout values SHOULD be as follows:
+
+   Initial 220 Message: 5 minutes
+      An SMTP client process needs to distinguish between a failed TCP
+      connection and a delay in receiving the initial 220 greeting
+      message.  Many SMTP servers accept a TCP connection but delay
+      delivery of the 220 message until their system load permits more
+      mail to be processed.
+
+   MAIL Command: 5 minutes
+
+   RCPT Command: 5 minutes
+      A longer timeout is required if processing of mailing lists and
+      aliases is not deferred until after the message was accepted.
+
+   DATA Initiation: 2 minutes
+      This is while awaiting the "354 Start Input" reply to a DATA
+      command.
+
+   Data Block: 3 minutes
+      This is while awaiting the completion of each TCP SEND call
+      transmitting a chunk of data.
+
+   DATA Termination: 10 minutes.
+      This is while awaiting the "250 OK" reply.  When the receiver gets
+      the final period terminating the message data, it typically
+      performs processing to deliver the message to a user mailbox.  A
+      spurious timeout at this point would be very wasteful and would
+      typically result in delivery of multiple copies of the message,
+      since it has been successfully sent and the server has accepted
+      responsibility for delivery.  See section 6.1 for additional
+      discussion.
+
+   An SMTP server SHOULD have a timeout of at least 5 minutes while it
+   is awaiting the next command from the sender.
+
+4.5.4 Retry Strategies
+
+   The common structure of a host SMTP implementation includes user
+   mailboxes, one or more areas for queuing messages in transit, and one
+   or more daemon processes for sending and receiving mail.  The exact
+   structure will vary depending on the needs of the users on the host
+
+
+
+
+Klensin                     Standards Track                    [Page 57]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   and the number and size of mailing lists supported by the host.  We
+   describe several optimizations that have proved helpful, particularly
+   for mailers supporting high traffic levels.
+
+   Any queuing strategy MUST include timeouts on all activities on a
+   per-command basis.  A queuing strategy MUST NOT send error messages
+   in response to error messages under any circumstances.
+
+4.5.4.1 Sending Strategy
+
+   The general model for an SMTP client is one or more processes that
+   periodically attempt to transmit outgoing mail.  In a typical system,
+   the program that composes a message has some method for requesting
+   immediate attention for a new piece of outgoing mail, while mail that
+   cannot be transmitted immediately MUST be queued and periodically
+   retried by the sender.  A mail queue entry will include not only the
+   message itself but also the envelope information.
+
+   The sender MUST delay retrying a particular destination after one
+   attempt has failed.  In general, the retry interval SHOULD be at
+   least 30 minutes; however, more sophisticated and variable strategies
+   will be beneficial when the SMTP client can determine the reason for
+   non-delivery.
+
+   Retries continue until the message is transmitted or the sender gives
+   up; the give-up time generally needs to be at least 4-5 days.  The
+   parameters to the retry algorithm MUST be configurable.
+
+   A client SHOULD keep a list of hosts it cannot reach and
+   corresponding connection timeouts, rather than just retrying queued
+   mail items.
+
+   Experience suggests that failures are typically transient (the target
+   system or its connection has crashed), favoring a policy of two
+   connection attempts in the first hour the message is in the queue,
+   and then backing off to one every two or three hours.
+
+   The SMTP client can shorten the queuing delay in cooperation with the
+   SMTP server.  For example, if mail is received from a particular
+   address, it is likely that mail queued for that host can now be sent.
+   Application of this principle may, in many cases, eliminate the
+   requirement for an explicit "send queues now" function such as ETRN
+   [9].
+
+   The strategy may be further modified as a result of multiple
+   addresses per host (see below) to optimize delivery time vs. resource
+   usage.
+
+
+
+
+Klensin                     Standards Track                    [Page 58]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   An SMTP client may have a large queue of messages for each
+   unavailable destination host.  If all of these messages were retried
+   in every retry cycle, there would be excessive Internet overhead and
+   the sending system would be blocked for a long period.  Note that an
+   SMTP client can generally determine that a delivery attempt has
+   failed only after a timeout of several minutes and even a one-minute
+   timeout per connection will result in a very large delay if retries
+   are repeated for dozens, or even hundreds, of queued messages to the
+   same host.
+
+   At the same time, SMTP clients SHOULD use great care in caching
+   negative responses from servers.  In an extreme case, if EHLO is
+   issued multiple times during the same SMTP connection, different
+   answers may be returned by the server.  More significantly, 5yz
+   responses to the MAIL command MUST NOT be cached.
+
+   When a mail message is to be delivered to multiple recipients, and
+   the SMTP server to which a copy of the message is to be sent is the
+   same for multiple recipients, then only one copy of the message
+   SHOULD be transmitted.  That is, the SMTP client SHOULD use the
+   command sequence:  MAIL, RCPT, RCPT,... RCPT, DATA instead of the
+   sequence: MAIL, RCPT, DATA, ..., MAIL, RCPT, DATA.  However, if there
+   are very many addresses, a limit on the number of RCPT commands per
+   MAIL command MAY be imposed.  Implementation of this efficiency
+   feature is strongly encouraged.
+
+   Similarly, to achieve timely delivery, the SMTP client MAY support
+   multiple concurrent outgoing mail transactions.  However, some limit
+   may be appropriate to protect the host from devoting all its
+   resources to mail.
+
+4.5.4.2 Receiving Strategy
+
+   The SMTP server SHOULD attempt to keep a pending listen on the SMTP
+   port at all times.  This requires the support of multiple incoming
+   TCP connections for SMTP.  Some limit MAY be imposed but servers that
+   cannot handle more than one SMTP transaction at a time are not in
+   conformance with the intent of this specification.
+
+   As discussed above, when the SMTP server receives mail from a
+   particular host address, it could activate its own SMTP queuing
+   mechanisms to retry any mail pending for that host address.
+
+4.5.5   Messages with a null reverse-path
+
+   There are several types of notification messages which are required
+   by existing and proposed standards to be sent with a null reverse
+   path, namely non-delivery notifications as discussed in section 3.7,
+
+
+
+Klensin                     Standards Track                    [Page 59]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   other kinds of Delivery Status Notifications (DSNs) [24], and also
+   Message Disposition Notifications (MDNs) [10].  All of these kinds of
+   messages are notifications about a previous message, and they are
+   sent to the reverse-path of the previous mail message.  (If the
+   delivery of such a notification message fails, that usually indicates
+   a problem with the mail system of the host to which the notification
+   message is addressed.  For this reason, at some hosts the MTA is set
+   up to forward such failed notification messages to someone who is
+   able to fix problems with the mail system, e.g., via the postmaster
+   alias.)
+
+   All other types of messages (i.e., any message which is not required
+   by a standards-track RFC to have a null reverse-path) SHOULD be sent
+   with with a valid, non-null reverse-path.
+
+   Implementors of automated email processors should be careful to make
+   sure that the various kinds of messages with null reverse-path are
+   handled correctly, in particular such systems SHOULD NOT reply to
+   messages with null reverse-path.
+
+5. Address Resolution and Mail Handling
+
+   Once an SMTP client lexically identifies a domain to which mail will
+   be delivered for processing (as described in sections 3.6 and 3.7), a
+   DNS lookup MUST be performed to resolve the domain name [22].  The
+   names are expected to be fully-qualified domain names (FQDNs):
+   mechanisms for inferring FQDNs from partial names or local aliases
+   are outside of this specification and, due to a history of problems,
+   are generally discouraged.  The lookup first attempts to locate an MX
+   record associated with the name.  If a CNAME record is found instead,
+   the resulting name is processed as if it were the initial name.  If
+   no MX records are found, but an A RR is found, the A RR is treated as
+   if it was associated with an implicit MX RR, with a preference of 0,
+   pointing to that host.  If one or more MX RRs are found for a given
+   name, SMTP systems MUST NOT utilize any A RRs associated with that
+   name unless they are located using the MX RRs; the "implicit MX" rule
+   above applies only if there are no MX records present.  If MX records
+   are present, but none of them are usable, this situation MUST be
+   reported as an error.
+
+   When the lookup succeeds, the mapping can result in a list of
+   alternative delivery addresses rather than a single address, because
+   of multiple MX records, multihoming, or both.  To provide reliable
+   mail transmission, the SMTP client MUST be able to try (and retry)
+   each of the relevant addresses in this list in order, until a
+   delivery attempt succeeds.  However, there MAY also be a configurable
+   limit on the number of alternate addresses that can be tried.  In any
+   case, the SMTP client SHOULD try at least two addresses.
+
+
+
+Klensin                     Standards Track                    [Page 60]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   Two types of information is used to rank the host addresses: multiple
+   MX records, and multihomed hosts.
+
+   Multiple MX records contain a preference indication that MUST be used
+   in sorting (see below).  Lower numbers are more preferred than higher
+   ones.  If there are multiple destinations with the same preference
+   and there is no clear reason to favor one (e.g., by recognition of an
+   easily-reached address), then the sender-SMTP MUST randomize them to
+   spread the load across multiple mail exchangers for a specific
+   organization.
+
+   The destination host (perhaps taken from the preferred MX record) may
+   be multihomed, in which case the domain name resolver will return a
+   list of alternative IP addresses.  It is the responsibility of the
+   domain name resolver interface to have ordered this list by
+   decreasing preference if necessary, and SMTP MUST try them in the
+   order presented.
+
+   Although the capability to try multiple alternative addresses is
+   required, specific installations may want to limit or disable the use
+   of alternative addresses.  The question of whether a sender should
+   attempt retries using the different addresses of a multihomed host
+   has been controversial.  The main argument for using the multiple
+   addresses is that it maximizes the probability of timely delivery,
+   and indeed sometimes the probability of any delivery; the counter-
+   argument is that it may result in unnecessary resource use.  Note
+   that resource use is also strongly determined by the sending strategy
+   discussed in section 4.5.4.1.
+
+   If an SMTP server receives a message with a destination for which it
+   is a designated Mail eXchanger, it MAY relay the message (potentially
+   after having rewritten the MAIL FROM and/or RCPT TO addresses), make
+   final delivery of the message, or hand it off using some mechanism
+   outside the SMTP-provided transport environment.  Of course, neither
+   of the latter require that the list of MX records be examined
+   further.
+
+   If it determines that it should relay the message without rewriting
+   the address, it MUST sort the MX records to determine candidates for
+   delivery.  The records are first ordered by preference, with the
+   lowest-numbered records being most preferred.  The relay host MUST
+   then inspect the list for any of the names or addresses by which it
+   might be known in mail transactions.  If a matching record is found,
+   all records at that preference level and higher-numbered ones MUST be
+   discarded from consideration.  If there are no records left at that
+   point, it is an error condition, and the message MUST be returned as
+   undeliverable.  If records do remain, they SHOULD be tried, best
+   preference first, as described above.
+
+
+
+Klensin                     Standards Track                    [Page 61]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+6. Problem Detection and Handling
+
+6.1 Reliable Delivery and Replies by Email
+
+   When the receiver-SMTP accepts a piece of mail (by sending a "250 OK"
+   message in response to DATA), it is accepting responsibility for
+   delivering or relaying the message.  It must take this responsibility
+   seriously.  It MUST NOT lose the message for frivolous reasons, such
+   as because the host later crashes or because of a predictable
+   resource shortage.
+
+   If there is a delivery failure after acceptance of a message, the
+   receiver-SMTP MUST formulate and mail a notification message.  This
+   notification MUST be sent using a null ("<>") reverse path in the
+   envelope.  The recipient of this notification MUST be the address
+   from the envelope return path (or the Return-Path: line).  However,
+   if this address is null ("<>"), the receiver-SMTP MUST NOT send a
+   notification.  Obviously, nothing in this section can or should
+   prohibit local decisions (i.e., as part of the same system
+   environment as the receiver-SMTP) to log or otherwise transmit
+   information about null address events locally if that is desired.  If
+   the address is an explicit source route, it MUST be stripped down to
+   its final hop.
+
+   For example, suppose that an error notification must be sent for a
+   message that arrived with:
+
+      MAIL FROM:<@a,@b:user@d>
+
+   The notification message MUST be sent using:
+
+      RCPT TO:<user@d>
+
+   Some delivery failures after the message is accepted by SMTP will be
+   unavoidable.  For example, it may be impossible for the receiving
+   SMTP server to validate all the delivery addresses in RCPT command(s)
+   due to a "soft" domain system error, because the target is a mailing
+   list (see earlier discussion of RCPT), or because the server is
+   acting as a relay and has no immediate access to the delivering
+   system.
+
+   To avoid receiving duplicate messages as the result of timeouts, a
+   receiver-SMTP MUST seek to minimize the time required to respond to
+   the final <CRLF>.<CRLF> end of data indicator.  See RFC 1047 [28] for
+   a discussion of this problem.
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 62]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+6.2 Loop Detection
+
+   Simple counting of the number of "Received:" headers in a message has
+   proven to be an effective, although rarely optimal, method of
+   detecting loops in mail systems.  SMTP servers using this technique
+   SHOULD use a large rejection threshold, normally at least 100
+   Received entries.  Whatever mechanisms are used, servers MUST contain
+   provisions for detecting and stopping trivial loops.
+
+6.3 Compensating for Irregularities
+
+   Unfortunately, variations, creative interpretations, and outright
+   violations of Internet mail protocols do occur; some would suggest
+   that they occur quite frequently.  The debate as to whether a well-
+   behaved SMTP receiver or relay should reject a malformed message,
+   attempt to pass it on unchanged, or attempt to repair it to increase
+   the odds of successful delivery (or subsequent reply) began almost
+   with the dawn of structured network mail and shows no signs of
+   abating.  Advocates of rejection claim that attempted repairs are
+   rarely completely adequate and that rejection of bad messages is the
+   only way to get the offending software repaired.  Advocates of
+   "repair" or "deliver no matter what" argue that users prefer that
+   mail go through it if at all possible and that there are significant
+   market pressures in that direction.  In practice, these market
+   pressures may be more important to particular vendors than strict
+   conformance to the standards, regardless of the preference of the
+   actual developers.
+
+   The problems associated with ill-formed messages were exacerbated by
+   the introduction of the split-UA mail reading protocols [3, 26, 5,
+   21].  These protocols have encouraged the use of SMTP as a posting
+   protocol, and SMTP servers as relay systems for these client hosts
+   (which are often only intermittently connected to the Internet).
+   Historically, many of those client machines lacked some of the
+   mechanisms and information assumed by SMTP (and indeed, by the mail
+   format protocol [7]).  Some could not keep adequate track of time;
+   others had no concept of time zones; still others could not identify
+   their own names or addresses; and, of course, none could satisfy the
+   assumptions that underlay RFC 822's conception of authenticated
+   addresses.
+
+   In response to these weak SMTP clients, many SMTP systems now
+   complete messages that are delivered to them in incomplete or
+   incorrect form.  This strategy is generally considered appropriate
+   when the server can identify or authenticate the client, and there
+   are prior agreements between them.  By contrast, there is at best
+   great concern about fixes applied by a relay or delivery SMTP server
+   that has little or no knowledge of the user or client machine.
+
+
+
+Klensin                     Standards Track                    [Page 63]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   The following changes to a message being processed MAY be applied
+   when necessary by an originating SMTP server, or one used as the
+   target of SMTP as an initial posting protocol:
+
+   -  Addition of a message-id field when none appears
+
+   -  Addition of a date, time or time zone when none appears
+
+   -  Correction of addresses to proper FQDN format
+
+   The less information the server has about the client, the less likely
+   these changes are to be correct and the more caution and conservatism
+   should be applied when considering whether or not to perform fixes
+   and how.  These changes MUST NOT be applied by an SMTP server that
+   provides an intermediate relay function.
+
+   In all cases, properly-operating clients supplying correct
+   information are preferred to corrections by the SMTP server.  In all
+   cases, documentation of actions performed by the servers (in trace
+   fields and/or header comments) is strongly encouraged.
+
+7. Security Considerations
+
+7.1 Mail Security and Spoofing
+
+   SMTP mail is inherently insecure in that it is feasible for even
+   fairly casual users to negotiate directly with receiving and relaying
+   SMTP servers and create messages that will trick a naive recipient
+   into believing that they came from somewhere else.  Constructing such
+   a message so that the "spoofed" behavior cannot be detected by an
+   expert is somewhat more difficult, but not sufficiently so as to be a
+   deterrent to someone who is determined and knowledgeable.
+   Consequently, as knowledge of Internet mail increases, so does the
+   knowledge that SMTP mail inherently cannot be authenticated, or
+   integrity checks provided, at the transport level.  Real mail
+   security lies only in end-to-end methods involving the message
+   bodies, such as those which use digital signatures (see [14] and,
+   e.g., PGP [4] or S/MIME [31]).
+
+   Various protocol extensions and configuration options that provide
+   authentication at the transport level (e.g., from an SMTP client to
+   an SMTP server) improve somewhat on the traditional situation
+   described above.  However, unless they are accompanied by careful
+   handoffs of responsibility in a carefully-designed trust environment,
+   they remain inherently weaker than end-to-end mechanisms which use
+   digitally signed messages rather than depending on the integrity of
+   the transport system.
+
+
+
+
+Klensin                     Standards Track                    [Page 64]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   Efforts to make it more difficult for users to set envelope return
+   path and header "From" fields to point to valid addresses other than
+   their own are largely misguided: they frustrate legitimate
+   applications in which mail is sent by one user on behalf of another
+   or in which error (or normal) replies should be directed to a special
+   address.  (Systems that provide convenient ways for users to alter
+   these fields on a per-message basis should attempt to establish a
+   primary and permanent mailbox address for the user so that Sender
+   fields within the message data can be generated sensibly.)
+
+   This specification does not further address the authentication issues
+   associated with SMTP other than to advocate that useful functionality
+   not be disabled in the hope of providing some small margin of
+   protection against an ignorant user who is trying to fake mail.
+
+7.2 "Blind" Copies
+
+   Addresses that do not appear in the message headers may appear in the
+   RCPT commands to an SMTP server for a number of reasons.  The two
+   most common involve the use of a mailing address as a "list exploder"
+   (a single address that resolves into multiple addresses) and the
+   appearance of "blind copies".  Especially when more than one RCPT
+   command is present, and in order to avoid defeating some of the
+   purpose of these mechanisms, SMTP clients and servers SHOULD NOT copy
+   the full set of RCPT command arguments into the headers, either as
+   part of trace headers or as informational or private-extension
+   headers.  Since this rule is often violated in practice, and cannot
+   be enforced, sending SMTP systems that are aware of "bcc" use MAY
+   find it helpful to send each blind copy as a separate message
+   transaction containing only a single RCPT command.
+
+   There is no inherent relationship between either "reverse" (from
+   MAIL, SAML, etc., commands) or "forward" (RCPT) addresses in the SMTP
+   transaction ("envelope") and the addresses in the headers.  Receiving
+   systems SHOULD NOT attempt to deduce such relationships and use them
+   to alter the headers of the message for delivery.  The popular
+   "Apparently-to" header is a violation of this principle as well as a
+   common source of unintended information disclosure and SHOULD NOT be
+   used.
+
+7.3 VRFY, EXPN, and Security
+
+   As discussed in section 3.5, individual sites may want to disable
+   either or both of VRFY or EXPN for security reasons.  As a corollary
+   to the above, implementations that permit this MUST NOT appear to
+   have verified addresses that are not, in fact, verified.  If a site
+
+
+
+
+
+Klensin                     Standards Track                    [Page 65]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   disables these commands for security reasons, the SMTP server MUST
+   return a 252 response, rather than a code that could be confused with
+   successful or unsuccessful verification.
+
+   Returning a 250 reply code with the address listed in the VRFY
+   command after having checked it only for syntax violates this rule.
+   Of course, an implementation that "supports" VRFY by always returning
+   550 whether or not the address is valid is equally not in
+   conformance.
+
+   Within the last few years, the contents of mailing lists have become
+   popular as an address information source for so-called "spammers."
+   The use of EXPN to "harvest" addresses has increased as list
+   administrators have installed protections against inappropriate uses
+   of the lists themselves.  Implementations SHOULD still provide
+   support for EXPN, but sites SHOULD carefully evaluate the tradeoffs.
+   As authentication mechanisms are introduced into SMTP, some sites may
+   choose to make EXPN available only to authenticated requestors.
+
+7.4 Information Disclosure in Announcements
+
+   There has been an ongoing debate about the tradeoffs between the
+   debugging advantages of announcing server type and version (and,
+   sometimes, even server domain name) in the greeting response or in
+   response to the HELP command and the disadvantages of exposing
+   information that might be useful in a potential hostile attack.  The
+   utility of the debugging information is beyond doubt.  Those who
+   argue for making it available point out that it is far better to
+   actually secure an SMTP server rather than hope that trying to
+   conceal known vulnerabilities by hiding the server's precise identity
+   will provide more protection.  Sites are encouraged to evaluate the
+   tradeoff with that issue in mind; implementations are strongly
+   encouraged to minimally provide for making type and version
+   information available in some way to other network hosts.
+
+7.5 Information Disclosure in Trace Fields
+
+   In some circumstances, such as when mail originates from within a LAN
+   whose hosts are not directly on the public Internet, trace
+   ("Received") fields produced in conformance with this specification
+   may disclose host names and similar information that would not
+   normally be available.  This ordinarily does not pose a problem, but
+   sites with special concerns about name disclosure should be aware of
+   it.  Also, the optional FOR clause should be supplied with caution or
+   not at all when multiple recipients are involved lest it
+   inadvertently disclose the identities of "blind copy" recipients to
+   others.
+
+
+
+
+Klensin                     Standards Track                    [Page 66]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+7.6 Information Disclosure in Message Forwarding
+
+   As discussed in section 3.4, use of the 251 or 551 reply codes to
+   identify the replacement address associated with a mailbox may
+   inadvertently disclose sensitive information.  Sites that are
+   concerned about those issues should ensure that they select and
+   configure servers appropriately.
+
+7.7 Scope of Operation of SMTP Servers
+
+   It is a well-established principle that an SMTP server may refuse to
+   accept mail for any operational or technical reason that makes sense
+   to the site providing the server.  However, cooperation among sites
+   and installations makes the Internet possible.  If sites take
+   excessive advantage of the right to reject traffic, the ubiquity of
+   email availability (one of the strengths of the Internet) will be
+   threatened; considerable care should be taken and balance maintained
+   if a site decides to be selective about the traffic it will accept
+   and process.
+
+   In recent years, use of the relay function through arbitrary sites
+   has been used as part of hostile efforts to hide the actual origins
+   of mail.  Some sites have decided to limit the use of the relay
+   function to known or identifiable sources, and implementations SHOULD
+   provide the capability to perform this type of filtering.  When mail
+   is rejected for these or other policy reasons, a 550 code SHOULD be
+   used in response to EHLO, MAIL, or RCPT as appropriate.
+
+8. IANA Considerations
+
+   IANA will maintain three registries in support of this specification.
+   The first consists of SMTP service extensions with the associated
+   keywords, and, as needed, parameters and verbs.  As specified in
+   section 2.2.2, no entry may be made in this registry that starts in
+   an "X".  Entries may be made only for service extensions (and
+   associated keywords, parameters, or verbs) that are defined in
+   standards-track or experimental RFCs specifically approved by the
+   IESG for this purpose.
+
+   The second registry consists of "tags" that identify forms of domain
+   literals other than those for IPv4 addresses (specified in RFC 821
+   and in this document) and IPv6 addresses (specified in this
+   document).  Additional literal types require standardization before
+   being used; none are anticipated at this time.
+
+   The third, established by RFC 821 and renewed by this specification,
+   is a registry of link and protocol identifiers to be used with the
+   "via" and "with" subclauses of the time stamp ("Received: header")
+
+
+
+Klensin                     Standards Track                    [Page 67]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   described in section 4.4.  Link and protocol identifiers in addition
+   to those specified in this document may be registered only by
+   standardization or by way of an RFC-documented, IESG-approved,
+   Experimental protocol extension.
+
+9. References
+
+   [1]  American National Standards Institute (formerly United States of
+        America Standards Institute), X3.4, 1968, "USA Code for
+        Information Interchange". ANSI X3.4-1968 has been replaced by
+        newer versions with slight modifications, but the 1968 version
+        remains definitive for the Internet.
+
+   [2]  Braden, R., "Requirements for Internet hosts - application and
+        support", STD 3, RFC 1123, October 1989.
+
+   [3]  Butler, M., Chase, D., Goldberger, J., Postel, J. and J.
+        Reynolds, "Post Office Protocol - version 2", RFC 937, February
+        1985.
+
+   [4]  Callas, J., Donnerhacke, L., Finney, H. and R. Thayer, "OpenPGP
+        Message Format", RFC 2440, November 1998.
+
+   [5]  Crispin, M., "Interactive Mail Access Protocol - Version 2", RFC
+        1176, August 1990.
+
+   [6]  Crispin, M., "Internet Message Access Protocol - Version 4", RFC
+        2060, December 1996.
+
+   [7]  Crocker, D., "Standard for the Format of ARPA Internet Text
+        Messages", RFC 822, August 1982.
+
+   [8]  Crocker, D. and P. Overell, Eds., "Augmented BNF for Syntax
+        Specifications: ABNF", RFC 2234, November 1997.
+
+   [9]  De Winter, J., "SMTP Service Extension for Remote Message Queue
+        Starting", RFC 1985, August 1996.
+
+   [10] Fajman, R., "An Extensible Message Format for Message
+        Disposition Notifications", RFC 2298, March 1998.
+
+   [11] Freed, N, "Behavior of and Requirements for Internet Firewalls",
+        RFC 2979, October 2000.
+
+   [12] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
+        Extensions (MIME) Part One: Format of Internet Message Bodies",
+        RFC 2045, December 1996.
+
+
+
+
+Klensin                     Standards Track                    [Page 68]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   [13] Freed, N., "SMTP Service Extension for Command Pipelining", RFC
+        2920, September 2000.
+
+   [14] Galvin, J., Murphy, S., Crocker, S. and N. Freed, "Security
+        Multiparts for MIME: Multipart/Signed and Multipart/Encrypted",
+        RFC 1847, October 1995.
+
+   [15] Gellens, R. and J. Klensin, "Message Submission", RFC 2476,
+        December 1998.
+
+   [16] Kille, S., "Mapping between X.400 and RFC822/MIME", RFC 2156,
+        January 1998.
+
+   [17] Hinden, R and S. Deering, Eds. "IP Version 6 Addressing
+        Architecture", RFC 2373, July 1998.
+
+   [18] Klensin, J., Freed, N. and K. Moore, "SMTP Service Extension for
+        Message Size Declaration", STD 10, RFC 1870, November 1995.
+
+   [19] Klensin, J., Freed, N., Rose, M., Stefferud, E. and D. Crocker,
+        "SMTP Service Extensions", STD 10, RFC 1869, November 1995.
+
+   [20] Klensin, J., Freed, N., Rose, M., Stefferud, E. and D. Crocker,
+        "SMTP Service Extension for 8bit-MIMEtransport", RFC 1652, July
+        1994.
+
+   [21] Lambert, M., "PCMAIL: A distributed mail system for personal
+        computers", RFC 1056, July 1988.
+
+   [22] Mockapetris, P., "Domain names - implementation and
+        specification", STD 13, RFC 1035, November 1987.
+
+        Mockapetris, P., "Domain names - concepts and facilities", STD
+        13, RFC 1034, November 1987.
+
+   [23] Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part
+        Three: Message Header Extensions for Non-ASCII Text", RFC 2047,
+        December 1996.
+
+   [24] Moore, K., "SMTP Service Extension for Delivery Status
+        Notifications", RFC 1891, January 1996.
+
+   [25] Moore, K., and G. Vaudreuil, "An Extensible Message Format for
+        Delivery Status Notifications", RFC 1894, January 1996.
+
+   [26] Myers, J. and M. Rose, "Post Office Protocol - Version 3", STD
+        53, RFC 1939, May 1996.
+
+
+
+
+Klensin                     Standards Track                    [Page 69]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   [27] Partridge, C., "Mail routing and the domain system", RFC 974,
+        January 1986.
+
+   [28] Partridge, C., "Duplicate messages and SMTP", RFC 1047, February
+        1988.
+
+   [29] Postel, J., ed., "Transmission Control Protocol - DARPA Internet
+        Program Protocol Specification", STD 7, RFC 793, September 1981.
+
+   [30] Postel, J., "Simple Mail Transfer Protocol", RFC 821, August
+        1982.
+
+   [31] Ramsdell, B., Ed., "S/MIME Version 3 Message Specification", RFC
+        2633, June 1999.
+
+   [32] Resnick, P., Ed., "Internet Message Format", RFC 2822, April
+        2001.
+
+   [33] Vaudreuil, G., "SMTP Service Extensions for Transmission of
+        Large and Binary MIME Messages", RFC 1830, August 1995.
+
+   [34] Vaudreuil, G., "Enhanced Mail System Status Codes", RFC 1893,
+        January 1996.
+
+10. Editor's Address
+
+   John C. Klensin
+   AT&T Laboratories
+   99 Bedford St
+   Boston, MA 02111 USA
+
+   Phone: 617-574-3076
+   EMail: klensin@research.att.com
+
+11. Acknowledgments
+
+   Many people worked long and hard on the many iterations of this
+   document.  There was wide-ranging debate in the IETF DRUMS Working
+   Group, both on its mailing list and in face to face discussions,
+   about many technical issues and the role of a revised standard for
+   Internet mail transport, and many contributors helped form the
+   wording in this specification.  The hundreds of participants in the
+   many discussions since RFC 821 was produced are too numerous to
+   mention, but they all helped this document become what it is.
+
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 70]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+APPENDICES
+
+A. TCP Transport Service
+
+   The TCP connection supports the transmission of 8-bit bytes.  The
+   SMTP data is 7-bit ASCII characters.  Each character is transmitted
+   as an 8-bit byte with the high-order bit cleared to zero.  Service
+   extensions may modify this rule to permit transmission of full 8-bit
+   data bytes as part of the message body, but not in SMTP commands or
+   responses.
+
+B. Generating SMTP Commands from RFC 822 Headers
+
+   Some systems use RFC 822 headers (only) in a mail submission
+   protocol, or otherwise generate SMTP commands from RFC 822 headers
+   when such a message is handed to an MTA from a UA.  While the MTA-UA
+   protocol is a private matter, not covered by any Internet Standard,
+   there are problems with this approach.  For example, there have been
+   repeated problems with proper handling of "bcc" copies and
+   redistribution lists when information that conceptually belongs to a
+   mail envelopes is not separated early in processing from header
+   information (and kept separate).
+
+   It is recommended that the UA provide its initial ("submission
+   client") MTA with an envelope separate from the message itself.
+   However, if the envelope is not supplied, SMTP commands SHOULD be
+   generated as follows:
+
+   1. Each recipient address from a TO, CC, or BCC header field SHOULD
+      be copied to a RCPT command (generating multiple message copies if
+      that is required for queuing or delivery).  This includes any
+      addresses listed in a RFC 822 "group".  Any BCC fields SHOULD then
+      be removed from the headers.  Once this process is completed, the
+      remaining headers SHOULD be checked to verify that at least one
+      To:, Cc:, or Bcc: header remains.  If none do, then a bcc: header
+      with no additional information SHOULD be inserted as specified in
+      [32].
+
+   2. The return address in the MAIL command SHOULD, if possible, be
+      derived from the system's identity for the submitting (local)
+      user, and the "From:" header field otherwise.  If there is a
+      system identity available, it SHOULD also be copied to the Sender
+      header field if it is different from the address in the From
+      header field.  (Any Sender field that was already there SHOULD be
+      removed.)  Systems may provide a way for submitters to override
+      the envelope return address, but may want to restrict its use to
+      privileged users.  This will not prevent mail forgery, but may
+      lessen its incidence; see section 7.1.
+
+
+
+Klensin                     Standards Track                    [Page 71]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   When an MTA is being used in this way, it bears responsibility for
+   ensuring that the message being transmitted is valid.  The mechanisms
+   for checking that validity, and for handling (or returning) messages
+   that are not valid at the time of arrival, are part of the MUA-MTA
+   interface and not covered by this specification.
+
+   A submission protocol based on Standard RFC 822 information alone
+   MUST NOT be used to gateway a message from a foreign (non-SMTP) mail
+   system into an SMTP environment.  Additional information to construct
+   an envelope must come from some source in the other environment,
+   whether supplemental headers or the foreign system's envelope.
+
+   Attempts to gateway messages using only their header "to" and "cc"
+   fields have repeatedly caused mail loops and other behavior adverse
+   to the proper functioning of the Internet mail environment.  These
+   problems have been especially common when the message originates from
+   an Internet mailing list and is distributed into the foreign
+   environment using envelope information.  When these messages are then
+   processed by a header-only remailer, loops back to the Internet
+   environment (and the mailing list) are almost inevitable.
+
+C. Source Routes
+
+   Historically, the <reverse-path> was a reverse source routing list of
+   hosts and a source mailbox.  The first host in the <reverse-path>
+   SHOULD be the host sending the MAIL command.  Similarly, the
+   <forward-path> may be a source routing lists of hosts and a
+   destination mailbox.  However, in general, the <forward-path> SHOULD
+   contain only a mailbox and domain name, relying on the domain name
+   system to supply routing information if required.  The use of source
+   routes is deprecated; while servers MUST be prepared to receive and
+   handle them as discussed in section 3.3 and F.2, clients SHOULD NOT
+   transmit them and this section was included only to provide context.
+
+   For relay purposes, the forward-path may be a source route of the
+   form "@ONE,@TWO:JOE@THREE", where ONE, TWO, and THREE MUST BE fully-
+   qualified domain names.  This form is used to emphasize the
+   distinction between an address and a route.  The mailbox is an
+   absolute address, and the route is information about how to get
+   there.  The two concepts should not be confused.
+
+   If source routes are used, RFC 821 and the text below should be
+   consulted for the mechanisms for constructing and updating the
+   forward- and reverse-paths.
+
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 72]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+   The SMTP server transforms the command arguments by moving its own
+   identifier (its domain name or that of any domain for which it is
+   acting as a mail exchanger), if it appears, from the forward-path to
+   the beginning of the reverse-path.
+
+   Notice that the forward-path and reverse-path appear in the SMTP
+   commands and replies, but not necessarily in the message.  That is,
+   there is no need for these paths and especially this syntax to appear
+   in the "To:" , "From:", "CC:", etc. fields of the message header.
+   Conversely, SMTP servers MUST NOT derive final message delivery
+   information from message header fields.
+
+   When the list of hosts is present, it is a "reverse" source route and
+   indicates that the mail was relayed through each host on the list
+   (the first host in the list was the most recent relay).  This list is
+   used as a source route to return non-delivery notices to the sender.
+   As each relay host adds itself to the beginning of the list, it MUST
+   use its name as known in the transport environment to which it is
+   relaying the mail rather than that of the transport environment from
+   which the mail came (if they are different).
+
+D. Scenarios
+
+   This section presents complete scenarios of several types of SMTP
+   sessions.  In the examples, "C:" indicates what is said by the SMTP
+   client, and "S:" indicates what is said by the SMTP server.
+
+D.1 A Typical SMTP Transaction Scenario
+
+   This SMTP example shows mail sent by Smith at host bar.com, to Jones,
+   Green, and Brown at host foo.com.  Here we assume that host bar.com
+   contacts host foo.com directly.  The mail is accepted for Jones and
+   Brown.  Green does not have a mailbox at host foo.com.
+
+      S: 220 foo.com Simple Mail Transfer Service Ready
+      C: EHLO bar.com
+      S: 250-foo.com greets bar.com
+      S: 250-8BITMIME
+      S: 250-SIZE
+      S: 250-DSN
+      S: 250 HELP
+      C: MAIL FROM:<Smith@bar.com>
+      S: 250 OK
+      C: RCPT TO:<Jones@foo.com>
+      S: 250 OK
+      C: RCPT TO:<Green@foo.com>
+      S: 550 No such user here
+      C: RCPT TO:<Brown@foo.com>
+
+
+
+Klensin                     Standards Track                    [Page 73]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+      S: 250 OK
+      C: DATA
+      S: 354 Start mail input; end with <CRLF>.<CRLF>
+      C: Blah blah blah...
+      C: ...etc. etc. etc.
+      C: .
+      S: 250 OK
+      C: QUIT
+      S: 221 foo.com Service closing transmission channel
+
+D.2 Aborted SMTP Transaction Scenario
+
+      S: 220 foo.com Simple Mail Transfer Service Ready
+      C: EHLO bar.com
+      S: 250-foo.com greets bar.com
+      S: 250-8BITMIME
+      S: 250-SIZE
+      S: 250-DSN
+      S: 250 HELP
+      C: MAIL FROM:<Smith@bar.com>
+      S: 250 OK
+      C: RCPT TO:<Jones@foo.com>
+      S: 250 OK
+      C: RCPT TO:<Green@foo.com>
+      S: 550 No such user here
+      C: RSET
+      S: 250 OK
+      C: QUIT
+      S: 221 foo.com Service closing transmission channel
+
+D.3 Relayed Mail Scenario
+
+   Step 1  --  Source Host to Relay Host
+
+      S: 220 foo.com Simple Mail Transfer Service Ready
+      C: EHLO bar.com
+      S: 250-foo.com greets bar.com
+      S: 250-8BITMIME
+      S: 250-SIZE
+      S: 250-DSN
+      S: 250 HELP
+      C: MAIL FROM:<JQP@bar.com>
+      S: 250 OK
+      C: RCPT TO:<@foo.com:Jones@XYZ.COM>
+      S: 250 OK
+      C: DATA
+      S: 354 Start mail input; end with <CRLF>.<CRLF>
+      C: Date: Thu, 21 May 1998 05:33:29 -0700
+
+
+
+Klensin                     Standards Track                    [Page 74]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+      C: From: John Q. Public <JQP@bar.com>
+      C: Subject:  The Next Meeting of the Board
+      C: To: Jones@xyz.com
+      C:
+      C: Bill:
+      C: The next meeting of the board of directors will be
+      C: on Tuesday.
+      C:                         John.
+      C: .
+      S: 250 OK
+      C: QUIT
+      S: 221 foo.com Service closing transmission channel
+
+   Step 2  --  Relay Host to Destination Host
+
+      S: 220 xyz.com Simple Mail Transfer Service Ready
+      C: EHLO foo.com
+      S: 250 xyz.com is on the air
+      C: MAIL FROM:<@foo.com:JQP@bar.com>
+      S: 250 OK
+      C: RCPT TO:<Jones@XYZ.COM>
+      S: 250 OK
+      C: DATA
+      S: 354 Start mail input; end with <CRLF>.<CRLF>
+      C: Received: from bar.com by foo.com ; Thu, 21 May 1998
+      C:     05:33:29 -0700
+      C: Date: Thu, 21 May 1998 05:33:22 -0700
+      C: From: John Q. Public <JQP@bar.com>
+      C: Subject:  The Next Meeting of the Board
+      C: To: Jones@xyz.com
+      C:
+      C: Bill:
+      C: The next meeting of the board of directors will be
+      C: on Tuesday.
+      C:                         John.
+      C: .
+      S: 250 OK
+      C: QUIT
+      S: 221 foo.com Service closing transmission channel
+
+D.4 Verifying and Sending Scenario
+
+      S: 220 foo.com Simple Mail Transfer Service Ready
+      C: EHLO bar.com
+      S: 250-foo.com greets bar.com
+      S: 250-8BITMIME
+      S: 250-SIZE
+      S: 250-DSN
+
+
+
+Klensin                     Standards Track                    [Page 75]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+      S: 250-VRFY
+      S: 250 HELP
+      C: VRFY Crispin
+      S: 250 Mark Crispin <Admin.MRC@foo.com>
+      C: SEND FROM:<EAK@bar.com>
+      S: 250 OK
+      C: RCPT TO:<Admin.MRC@foo.com>
+      S: 250 OK
+      C: DATA
+      S: 354 Start mail input; end with <CRLF>.<CRLF>
+      C: Blah blah blah...
+      C: ...etc. etc. etc.
+      C: .
+      S: 250 OK
+      C: QUIT
+      S: 221 foo.com Service closing transmission channel
+
+E. Other Gateway Issues
+
+   In general, gateways between the Internet and other mail systems
+   SHOULD attempt to preserve any layering semantics across the
+   boundaries between the two mail systems involved.  Gateway-
+   translation approaches that attempt to take shortcuts by mapping,
+   (such as envelope information from one system to the message headers
+   or body of another) have generally proven to be inadequate in
+   important ways.  Systems translating between environments that do not
+   support both envelopes and headers and Internet mail must be written
+   with the understanding that some information loss is almost
+   inevitable.
+
+F. Deprecated Features of RFC 821
+
+   A few features of RFC 821 have proven to be problematic and SHOULD
+   NOT be used in Internet mail.
+
+F.1 TURN
+
+   This command, described in RFC 821, raises important security issues
+   since, in the absence of strong authentication of the host requesting
+   that the client and server switch roles, it can easily be used to
+   divert mail from its correct destination.  Its use is deprecated;
+   SMTP systems SHOULD NOT use it unless the server can authenticate the
+   client.
+
+
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 76]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+F.2 Source Routing
+
+   RFC 821 utilized the concept of explicit source routing to get mail
+   from one host to another via a series of relays.  The requirement to
+   utilize source routes in regular mail traffic was eliminated by the
+   introduction of the domain name system "MX" record and the last
+   significant justification for them was eliminated by the
+   introduction, in RFC 1123, of a clear requirement that addresses
+   following an "@" must all be fully-qualified domain names.
+   Consequently, the only remaining justifications for the use of source
+   routes are support for very old SMTP clients or MUAs and in mail
+   system debugging.  They can, however, still be useful in the latter
+   circumstance and for routing mail around serious, but temporary,
+   problems such as problems with the relevant DNS records.
+
+   SMTP servers MUST continue to accept source route syntax as specified
+   in the main body of this document and in RFC 1123.  They MAY, if
+   necessary, ignore the routes and utilize only the target domain in
+   the address.  If they do utilize the source route, the message MUST
+   be sent to the first domain shown in the address.  In particular, a
+   server MUST NOT guess at shortcuts within the source route.
+
+   Clients SHOULD NOT utilize explicit source routing except under
+   unusual circumstances, such as debugging or potentially relaying
+   around firewall or mail system configuration errors.
+
+F.3 HELO
+
+   As discussed in sections 3.1 and 4.1.1, EHLO is strongly preferred to
+   HELO when the server will accept the former.  Servers must continue
+   to accept and process HELO in order to support older clients.
+
+F.4 #-literals
+
+   RFC 821 provided for specifying an Internet address as a decimal
+   integer host number prefixed by a pound sign, "#".  In practice, that
+   form has been obsolete since the introduction of TCP/IP.  It is
+   deprecated and MUST NOT be used.
+
+F.5 Dates and Years
+
+   When dates are inserted into messages by SMTP clients or servers
+   (e.g., in trace fields), four-digit years MUST BE used.  Two-digit
+   years are deprecated; three-digit years were never permitted in the
+   Internet mail system.
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 77]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+F.6 Sending versus Mailing
+
+   In addition to specifying a mechanism for delivering messages to
+   user's mailboxes, RFC 821 provided additional, optional, commands to
+   deliver messages directly to the user's terminal screen.  These
+   commands (SEND, SAML, SOML) were rarely implemented, and changes in
+   workstation technology and the introduction of other protocols may
+   have rendered them obsolete even where they are implemented.
+
+   Clients SHOULD NOT provide SEND, SAML, or SOML as services.  Servers
+   MAY implement them.  If they are implemented by servers, the
+   implementation model specified in RFC 821 MUST be used and the
+   command names MUST be published in the response to the EHLO command.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 78]
+
+RFC 2821             Simple Mail Transfer Protocol            April 2001
+
+
+Full Copyright Statement
+
+   Copyright (C) The Internet Society (2001).  All Rights Reserved.
+
+   This document and translations of it may be copied and furnished to
+   others, and derivative works that comment on or otherwise explain it
+   or assist in its implementation may be prepared, copied, published
+   and distributed, in whole or in part, without restriction of any
+   kind, provided that the above copyright notice and this paragraph are
+   included on all such copies and derivative works.  However, this
+   document itself may not be modified in any way, such as by removing
+   the copyright notice or references to the Internet Society or other
+   Internet organizations, except as needed for the purpose of
+   developing Internet standards in which case the procedures for
+   copyrights defined in the Internet Standards process must be
+   followed, or as required to translate it into languages other than
+   English.
+
+   The limited permissions granted above are perpetual and will not be
+   revoked by the Internet Society or its successors or assigns.
+
+   This document and the information contained herein is provided on an
+   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+Acknowledgement
+
+   Funding for the RFC Editor function is currently provided by the
+   Internet Society.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Klensin                     Standards Track                    [Page 79]
+
Index: zmailer/doc/rfc/rfc2822.txt
diff -u /dev/null zmailer/doc/rfc/rfc2822.txt:1.1
--- /dev/null	Tue May  8 16:00:10 2001
+++ zmailer/doc/rfc/rfc2822.txt	Tue May  8 15:49:22 2001
@@ -0,0 +1,2859 @@
+
+
+
+
+
+
+Network Working Group                                 P. Resnick, Editor
+Request for Comments: 2822                         QUALCOMM Incorporated
+Obsoletes: 822                                                April 2001
+Category: Standards Track
+
+
+                        Internet Message Format
+
+Status of this Memo
+
+   This document specifies an Internet standards track protocol for the
+   Internet community, and requests discussion and suggestions for
+   improvements.  Please refer to the current edition of the "Internet
+   Official Protocol Standards" (STD 1) for the standardization state
+   and status of this protocol.  Distribution of this memo is unlimited.
+
+Copyright Notice
+
+   Copyright (C) The Internet Society (2001).  All Rights Reserved.
+
+Abstract
+
+   This standard specifies a syntax for text messages that are sent
+   between computer users, within the framework of "electronic mail"
+   messages.  This standard supersedes the one specified in Request For
+   Comments (RFC) 822, "Standard for the Format of ARPA Internet Text
+   Messages", updating it to reflect current practice and incorporating
+   incremental changes that were specified in other RFCs.
+
+Table of Contents
+
+   1. Introduction ............................................... 3
+   1.1. Scope .................................................... 3
+   1.2. Notational conventions ................................... 4
+   1.2.1. Requirements notation .................................. 4
+   1.2.2. Syntactic notation ..................................... 4
+   1.3. Structure of this document ............................... 4
+   2. Lexical Analysis of Messages ............................... 5
+   2.1. General Description ...................................... 5
+   2.1.1. Line Length Limits ..................................... 6
+   2.2. Header Fields ............................................ 7
+   2.2.1. Unstructured Header Field Bodies ....................... 7
+   2.2.2. Structured Header Field Bodies ......................... 7
+   2.2.3. Long Header Fields ..................................... 7
+   2.3. Body ..................................................... 8
+   3. Syntax ..................................................... 9
+   3.1. Introduction ............................................. 9
+   3.2. Lexical Tokens ........................................... 9
+
+
+
+Resnick                     Standards Track                     [Page 1]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   3.2.1. Primitive Tokens ....................................... 9
+   3.2.2. Quoted characters ......................................10
+   3.2.3. Folding white space and comments .......................11
+   3.2.4. Atom ...................................................12
+   3.2.5. Quoted strings .........................................13
+   3.2.6. Miscellaneous tokens ...................................13
+   3.3. Date and Time Specification ..............................14
+   3.4. Address Specification ....................................15
+   3.4.1. Addr-spec specification ................................16
+   3.5 Overall message syntax ....................................17
+   3.6. Field definitions ........................................18
+   3.6.1. The origination date field .............................20
+   3.6.2. Originator fields ......................................21
+   3.6.3. Destination address fields .............................22
+   3.6.4. Identification fields ..................................23
+   3.6.5. Informational fields ...................................26
+   3.6.6. Resent fields ..........................................26
+   3.6.7. Trace fields ...........................................28
+   3.6.8. Optional fields ........................................29
+   4. Obsolete Syntax ............................................29
+   4.1. Miscellaneous obsolete tokens ............................30
+   4.2. Obsolete folding white space .............................31
+   4.3. Obsolete Date and Time ...................................31
+   4.4. Obsolete Addressing ......................................33
+   4.5. Obsolete header fields ...................................33
+   4.5.1. Obsolete origination date field ........................34
+   4.5.2. Obsolete originator fields .............................34
+   4.5.3. Obsolete destination address fields ....................34
+   4.5.4. Obsolete identification fields .........................35
+   4.5.5. Obsolete informational fields ..........................35
+   4.5.6. Obsolete resent fields .................................35
+   4.5.7. Obsolete trace fields ..................................36
+   4.5.8. Obsolete optional fields ...............................36
+   5. Security Considerations ....................................36
+   6. Bibliography ...............................................37
+   7. Editor's Address ...........................................38
+   8. Acknowledgements ...........................................39
+   Appendix A. Example messages ..................................41
+   A.1. Addressing examples ......................................41
+   A.1.1. A message from one person to another with simple
+          addressing .............................................41
+   A.1.2. Different types of mailboxes ...........................42
+   A.1.3. Group addresses ........................................43
+   A.2. Reply messages ...........................................43
+   A.3. Resent messages ..........................................44
+   A.4. Messages with trace fields ...............................46
+   A.5. White space, comments, and other oddities ................47
+   A.6. Obsoleted forms ..........................................47
+
+
+
+Resnick                     Standards Track                     [Page 2]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   A.6.1. Obsolete addressing ....................................48
+   A.6.2. Obsolete dates .........................................48
+   A.6.3. Obsolete white space and comments ......................48
+   Appendix B. Differences from earlier standards ................49
+   Appendix C. Notices ...........................................50
+   Full Copyright Statement ......................................51
+
+1. Introduction
+
+1.1. Scope
+
+   This standard specifies a syntax for text messages that are sent
+   between computer users, within the framework of "electronic mail"
+   messages.  This standard supersedes the one specified in Request For
+   Comments (RFC) 822, "Standard for the Format of ARPA Internet Text
+   Messages" [RFC822], updating it to reflect current practice and
+   incorporating incremental changes that were specified in other RFCs
+   [STD3].
+
+   This standard specifies a syntax only for text messages.  In
+   particular, it makes no provision for the transmission of images,
+   audio, or other sorts of structured data in electronic mail messages.
+   There are several extensions published, such as the MIME document
+   series [RFC2045, RFC2046, RFC2049], which describe mechanisms for the
+   transmission of such data through electronic mail, either by
+   extending the syntax provided here or by structuring such messages to
+   conform to this syntax.  Those mechanisms are outside of the scope of
+   this standard.
+
+   In the context of electronic mail, messages are viewed as having an
+   envelope and contents.  The envelope contains whatever information is
+   needed to accomplish transmission and delivery.  (See [RFC2821] for a
+   discussion of the envelope.)  The contents comprise the object to be
+   delivered to the recipient.  This standard applies only to the format
+   and some of the semantics of message contents.  It contains no
+   specification of the information in the envelope.
+
+   However, some message systems may use information from the contents
+   to create the envelope.  It is intended that this standard facilitate
+   the acquisition of such information by programs.
+
+   This specification is intended as a definition of what message
+   content format is to be passed between systems.  Though some message
+   systems locally store messages in this format (which eliminates the
+   need for translation between formats) and others use formats that
+   differ from the one specified in this standard, local storage is
+   outside of the scope of this standard.
+
+
+
+
+Resnick                     Standards Track                     [Page 3]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   Note: This standard is not intended to dictate the internal formats
+   used by sites, the specific message system features that they are
+   expected to support, or any of the characteristics of user interface
+   programs that create or read messages.  In addition, this standard
+   does not specify an encoding of the characters for either transport
+   or storage; that is, it does not specify the number of bits used or
+   how those bits are specifically transferred over the wire or stored
+   on disk.
+
+1.2. Notational conventions
+
+1.2.1. Requirements notation
+
+   This document occasionally uses terms that appear in capital letters.
+   When the terms "MUST", "SHOULD", "RECOMMENDED", "MUST NOT", "SHOULD
+   NOT", and "MAY" appear capitalized, they are being used to indicate
+   particular requirements of this specification.  A discussion of the
+   meanings of these terms appears in [RFC2119].
+
+1.2.2. Syntactic notation
+
+   This standard uses the Augmented Backus-Naur Form (ABNF) notation
+   specified in [RFC2234] for the formal definitions of the syntax of
+   messages.  Characters will be specified either by a decimal value
+   (e.g., the value %d65 for uppercase A and %d97 for lowercase A) or by
+   a case-insensitive literal value enclosed in quotation marks (e.g.,
+   "A" for either uppercase or lowercase A).  See [RFC2234] for the full
+   description of the notation.
+
+1.3. Structure of this document
+
+   This document is divided into several sections.
+
+   This section, section 1, is a short introduction to the document.
+
+   Section 2 lays out the general description of a message and its
+   constituent parts.  This is an overview to help the reader understand
+   some of the general principles used in the later portions of this
+   document.  Any examples in this section MUST NOT be taken as
+   specification of the formal syntax of any part of a message.
+
+   Section 3 specifies formal ABNF rules for the structure of each part
+   of a message (the syntax) and describes the relationship between
+   those parts and their meaning in the context of a message (the
+   semantics).  That is, it describes the actual rules for the structure
+   of each part of a message (the syntax) as well as a description of
+   the parts and instructions on how they ought to be interpreted (the
+   semantics).  This includes analysis of the syntax and semantics of
+
+
+
+Resnick                     Standards Track                     [Page 4]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   subparts of messages that have specific structure.  The syntax
+   included in section 3 represents messages as they MUST be created.
+   There are also notes in section 3 to indicate if any of the options
+   specified in the syntax SHOULD be used over any of the others.
+
+   Both sections 2 and 3 describe messages that are legal to generate
+   for purposes of this standard.
+
+   Section 4 of this document specifies an "obsolete" syntax.  There are
+   references in section 3 to these obsolete syntactic elements.  The
+   rules of the obsolete syntax are elements that have appeared in
+   earlier revisions of this standard or have previously been widely
+   used in Internet messages.  As such, these elements MUST be
+   interpreted by parsers of messages in order to be conformant to this
+   standard.  However, since items in this syntax have been determined
+   to be non-interoperable or to cause significant problems for
+   recipients of messages, they MUST NOT be generated by creators of
+   conformant messages.
+
+   Section 5 details security considerations to take into account when
+   implementing this standard.
+
+   Section 6 is a bibliography of references in this document.
+
+   Section 7 contains the editor's address.
+
+   Section 8 contains acknowledgements.
+
+   Appendix A lists examples of different sorts of messages.  These
+   examples are not exhaustive of the types of messages that appear on
+   the Internet, but give a broad overview of certain syntactic forms.
+
+   Appendix B lists the differences between this standard and earlier
+   standards for Internet messages.
+
+   Appendix C has copyright and intellectual property notices.
+
+2. Lexical Analysis of Messages
+
+2.1. General Description
+
+   At the most basic level, a message is a series of characters.  A
+   message that is conformant with this standard is comprised of
+   characters with values in the range 1 through 127 and interpreted as
+   US-ASCII characters [ASCII].  For brevity, this document sometimes
+   refers to this range of characters as simply "US-ASCII characters".
+
+
+
+
+
+Resnick                     Standards Track                     [Page 5]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   Note: This standard specifies that messages are made up of characters
+   in the US-ASCII range of 1 through 127.  There are other documents,
+   specifically the MIME document series [RFC2045, RFC2046, RFC2047,
+   RFC2048, RFC2049], that extend this standard to allow for values
+   outside of that range.  Discussion of those mechanisms is not within
+   the scope of this standard.
+
+   Messages are divided into lines of characters.  A line is a series of
+   characters that is delimited with the two characters carriage-return
+   and line-feed; that is, the carriage return (CR) character (ASCII
+   value 13) followed immediately by the line feed (LF) character (ASCII
+   value 10).  (The carriage-return/line-feed pair is usually written in
+   this document as "CRLF".)
+
+   A message consists of header fields (collectively called "the header
+   of the message") followed, optionally, by a body.  The header is a
+   sequence of lines of characters with special syntax as defined in
+   this standard. The body is simply a sequence of characters that
+   follows the header and is separated from the header by an empty line
+   (i.e., a line with nothing preceding the CRLF).
+
+2.1.1. Line Length Limits
+
+   There are two limits that this standard places on the number of
+   characters in a line. Each line of characters MUST be no more than
+   998 characters, and SHOULD be no more than 78 characters, excluding
+   the CRLF.
+
+   The 998 character limit is due to limitations in many implementations
+   which send, receive, or store Internet Message Format messages that
+   simply cannot handle more than 998 characters on a line. Receiving
+   implementations would do well to handle an arbitrarily large number
+   of characters in a line for robustness sake. However, there are so
+   many implementations which (in compliance with the transport
+   requirements of [RFC2821]) do not accept messages containing more
+   than 1000 character including the CR and LF per line, it is important
+   for implementations not to create such messages.
+
+   The more conservative 78 character recommendation is to accommodate
+   the many implementations of user interfaces that display these
+   messages which may truncate, or disastrously wrap, the display of
+   more than 78 characters per line, in spite of the fact that such
+   implementations are non-conformant to the intent of this
+   specification (and that of [RFC2821] if they actually cause
+   information to be lost). Again, even though this limitation is put on
+   messages, it is encumbant upon implementations which display messages
+
+
+
+
+
+Resnick                     Standards Track                     [Page 6]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   to handle an arbitrarily large number of characters in a line
+   (certainly at least up to the 998 character limit) for the sake of
+   robustness.
+
+2.2. Header Fields
+
+   Header fields are lines composed of a field name, followed by a colon
+   (":"), followed by a field body, and terminated by CRLF.  A field
+   name MUST be composed of printable US-ASCII characters (i.e.,
+   characters that have values between 33 and 126, inclusive), except
+   colon.  A field body may be composed of any US-ASCII characters,
+   except for CR and LF.  However, a field body may contain CRLF when
+   used in header "folding" and  "unfolding" as described in section
+   2.2.3.  All field bodies MUST conform to the syntax described in
+   sections 3 and 4 of this standard.
+
+2.2.1. Unstructured Header Field Bodies
+
+   Some field bodies in this standard are defined simply as
+   "unstructured" (which is specified below as any US-ASCII characters,
+   except for CR and LF) with no further restrictions.  These are
+   referred to as unstructured field bodies.  Semantically, unstructured
+   field bodies are simply to be treated as a single line of characters
+   with no further processing (except for header "folding" and
+   "unfolding" as described in section 2.2.3).
+
+2.2.2. Structured Header Field Bodies
+
+   Some field bodies in this standard have specific syntactical
+   structure more restrictive than the unstructured field bodies
+   described above. These are referred to as "structured" field bodies.
+   Structured field bodies are sequences of specific lexical tokens as
+   described in sections 3 and 4 of this standard.  Many of these tokens
+   are allowed (according to their syntax) to be introduced or end with
+   comments (as described in section 3.2.3) as well as the space (SP,
+   ASCII value 32) and horizontal tab (HTAB, ASCII value 9) characters
+   (together known as the white space characters, WSP), and those WSP
+   characters are subject to header "folding" and "unfolding" as
+   described in section 2.2.3.  Semantic analysis of structured field
+   bodies is given along with their syntax.
+
+2.2.3. Long Header Fields
+
+   Each header field is logically a single line of characters comprising
+   the field name, the colon, and the field body.  For convenience
+   however, and to deal with the 998/78 character limitations per line,
+   the field body portion of a header field can be split into a multiple
+   line representation; this is called "folding".  The general rule is
+
+
+
+Resnick                     Standards Track                     [Page 7]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   that wherever this standard allows for folding white space (not
+   simply WSP characters), a CRLF may be inserted before any WSP.  For
+   example, the header field:
+
+           Subject: This is a test
+
+   can be represented as:
+
+           Subject: This
+            is a test
+
+   Note: Though structured field bodies are defined in such a way that
+   folding can take place between many of the lexical tokens (and even
+   within some of the lexical tokens), folding SHOULD be limited to
+   placing the CRLF at higher-level syntactic breaks.  For instance, if
+   a field body is defined as comma-separated values, it is recommended
+   that folding occur after the comma separating the structured items in
+   preference to other places where the field could be folded, even if
+   it is allowed elsewhere.
+
+   The process of moving from this folded multiple-line representation
+   of a header field to its single line representation is called
+   "unfolding". Unfolding is accomplished by simply removing any CRLF
+   that is immediately followed by WSP.  Each header field should be
+   treated in its unfolded form for further syntactic and semantic
+   evaluation.
+
+2.3. Body
+
+   The body of a message is simply lines of US-ASCII characters.  The
+   only two limitations on the body are as follows:
+
+   - CR and LF MUST only occur together as CRLF; they MUST NOT appear
+     independently in the body.
+
+   - Lines of characters in the body MUST be limited to 998 characters,
+     and SHOULD be limited to 78 characters, excluding the CRLF.
+
+   Note: As was stated earlier, there are other standards documents,
+   specifically the MIME documents [RFC2045, RFC2046, RFC2048, RFC2049]
+   that extend this standard to allow for different sorts of message
+   bodies.  Again, these mechanisms are beyond the scope of this
+   document.
+
+
+
+
+
+
+
+
+Resnick                     Standards Track                     [Page 8]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+3. Syntax
+
+3.1. Introduction
+
+   The syntax as given in this section defines the legal syntax of
+   Internet messages.  Messages that are conformant to this standard
+   MUST conform to the syntax in this section.  If there are options in
+   this section where one option SHOULD be generated, that is indicated
+   either in the prose or in a comment next to the syntax.
+
+   For the defined expressions, a short description of the syntax and
+   use is given, followed by the syntax in ABNF, followed by a semantic
+   analysis.  Primitive tokens that are used but otherwise unspecified
+   come from [RFC2234].
+
+   In some of the definitions, there will be nonterminals whose names
+   start with "obs-".  These "obs-" elements refer to tokens defined in
+   the obsolete syntax in section 4.  In all cases, these productions
+   are to be ignored for the purposes of generating legal Internet
+   messages and MUST NOT be used as part of such a message.  However,
+   when interpreting messages, these tokens MUST be honored as part of
+   the legal syntax.  In this sense, section 3 defines a grammar for
+   generation of messages, with "obs-" elements that are to be ignored,
+   while section 4 adds grammar for interpretation of messages.
+
+3.2. Lexical Tokens
+
+   The following rules are used to define an underlying lexical
+   analyzer, which feeds tokens to the higher-level parsers.  This
+   section defines the tokens used in structured header field bodies.
+
+   Note: Readers of this standard need to pay special attention to how
+   these lexical tokens are used in both the lower-level and
+   higher-level syntax later in the document.  Particularly, the white
+   space tokens and the comment tokens defined in section 3.2.3 get used
+   in the lower-level tokens defined here, and those lower-level tokens
+   are in turn used as parts of the higher-level tokens defined later.
+   Therefore, the white space and comments may be allowed in the
+   higher-level tokens even though they may not explicitly appear in a
+   particular definition.
+
+3.2.1. Primitive Tokens
+
+   The following are primitive tokens referred to elsewhere in this
+   standard, but not otherwise defined in [RFC2234].  Some of them will
+   not appear anywhere else in the syntax, but they are convenient to
+   refer to in other parts of this document.
+
+
+
+
+Resnick                     Standards Track                     [Page 9]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   Note: The "specials" below are just such an example.  Though the
+   specials token does not appear anywhere else in this standard, it is
+   useful for implementers who use tools that lexically analyze
+   messages.  Each of the characters in specials can be used to indicate
+   a tokenization point in lexical analysis.
+
+NO-WS-CTL       =       %d1-8 /         ; US-ASCII control characters
+                        %d11 /          ;  that do not include the
+                        %d12 /          ;  carriage return, line feed,
+                        %d14-31 /       ;  and white space characters
+                        %d127
+
+text            =       %d1-9 /         ; Characters excluding CR and LF
+                        %d11 /
+                        %d12 /
+                        %d14-127 /
+                        obs-text
+
+specials        =       "(" / ")" /     ; Special characters used in
+                        "<" / ">" /     ;  other parts of the syntax
+                        "[" / "]" /
+                        ":" / ";" /
+                        "@" / "\" /
+                        "," / "." /
+                        DQUOTE
+
+   No special semantics are attached to these tokens.  They are simply
+   single characters.
+
+3.2.2. Quoted characters
+
+   Some characters are reserved for special interpretation, such as
+   delimiting lexical tokens.  To permit use of these characters as
+   uninterpreted data, a quoting mechanism is provided.
+
+quoted-pair     =       ("\" text) / obs-qp
+
+   Where any quoted-pair appears, it is to be interpreted as the text
+   character alone.  That is to say, the "\" character that appears as
+   part of a quoted-pair is semantically "invisible".
+
+   Note: The "\" character may appear in a message where it is not part
+   of a quoted-pair.  A "\" character that does not appear in a
+   quoted-pair is not semantically invisible.  The only places in this
+   standard where quoted-pair currently appears are ccontent, qcontent,
+   dcontent, no-fold-quote, and no-fold-literal.
+
+
+
+
+
+Resnick                     Standards Track                    [Page 10]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+3.2.3. Folding white space and comments
+
+   White space characters, including white space used in folding
+   (described in section 2.2.3), may appear between many elements in
+   header field bodies.  Also, strings of characters that are treated as
+   comments may be included in structured field bodies as characters
+   enclosed in parentheses.  The following defines the folding white
+   space (FWS) and comment constructs.
+
+   Strings of characters enclosed in parentheses are considered comments
+   so long as they do not appear within a "quoted-string", as defined in
+   section 3.2.5.  Comments may nest.
+
+   There are several places in this standard where comments and FWS may
+   be freely inserted.  To accommodate that syntax, an additional token
+   for "CFWS" is defined for places where comments and/or FWS can occur.
+   However, where CFWS occurs in this standard, it MUST NOT be inserted
+   in such a way that any line of a folded header field is made up
+   entirely of WSP characters and nothing else.
+
+FWS             =       ([*WSP CRLF] 1*WSP) /   ; Folding white space
+                        obs-FWS
+
+ctext           =       NO-WS-CTL /     ; Non white space controls
+
+                        %d33-39 /       ; The rest of the US-ASCII
+                        %d42-91 /       ;  characters not including "(",
+                        %d93-126        ;  ")", or "\"
+
+ccontent        =       ctext / quoted-pair / comment
+
+comment         =       "(" *([FWS] ccontent) [FWS] ")"
+
+CFWS            =       *([FWS] comment) (([FWS] comment) / FWS)
+
+   Throughout this standard, where FWS (the folding white space token)
+   appears, it indicates a place where header folding, as discussed in
+   section 2.2.3, may take place.  Wherever header folding appears in a
+   message (that is, a header field body containing a CRLF followed by
+   any WSP), header unfolding (removal of the CRLF) is performed before
+   any further lexical analysis is performed on that header field
+   according to this standard.  That is to say, any CRLF that appears in
+   FWS is semantically "invisible."
+
+   A comment is normally used in a structured field body to provide some
+   human readable informational text.  Since a comment is allowed to
+   contain FWS, folding is permitted within the comment.  Also note that
+   since quoted-pair is allowed in a comment, the parentheses and
+
+
+
+Resnick                     Standards Track                    [Page 11]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   backslash characters may appear in a comment so long as they appear
+   as a quoted-pair.  Semantically, the enclosing parentheses are not
+   part of the comment; the comment is what is contained between the two
+   parentheses.  As stated earlier, the "\" in any quoted-pair and the
+   CRLF in any FWS that appears within the comment are semantically
+   "invisible" and therefore not part of the comment either.
+
+   Runs of FWS, comment or CFWS that occur between lexical tokens in a
+   structured field header are semantically interpreted as a single
+   space character.
+
+3.2.4. Atom
+
+   Several productions in structured header field bodies are simply
+   strings of certain basic characters.  Such productions are called
+   atoms.
+
+   Some of the structured header field bodies also allow the period
+   character (".", ASCII value 46) within runs of atext.  An additional
+   "dot-atom" token is defined for those purposes.
+
+atext           =       ALPHA / DIGIT / ; Any character except controls,
+                        "!" / "#" /     ;  SP, and specials.
+                        "$" / "%" /     ;  Used for atoms
+                        "&" / "'" /
+                        "*" / "+" /
+                        "-" / "/" /
+                        "=" / "?" /
+                        "^" / "_" /
+                        "`" / "{" /
+                        "|" / "}" /
+                        "~"
+
+atom            =       [CFWS] 1*atext [CFWS]
+
+dot-atom        =       [CFWS] dot-atom-text [CFWS]
+
+dot-atom-text   =       1*atext *("." 1*atext)
+
+   Both atom and dot-atom are interpreted as a single unit, comprised of
+   the string of characters that make it up.  Semantically, the optional
+   comments and FWS surrounding the rest of the characters are not part
+   of the atom; the atom is only the run of atext characters in an atom,
+   or the atext and "." characters in a dot-atom.
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 12]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+3.2.5. Quoted strings
+
+   Strings of characters that include characters other than those
+   allowed in atoms may be represented in a quoted string format, where
+   the characters are surrounded by quote (DQUOTE, ASCII value 34)
+   characters.
+
+qtext           =       NO-WS-CTL /     ; Non white space controls
+
+                        %d33 /          ; The rest of the US-ASCII
+                        %d35-91 /       ;  characters not including "\"
+                        %d93-126        ;  or the quote character
+
+qcontent        =       qtext / quoted-pair
+
+quoted-string   =       [CFWS]
+                        DQUOTE *([FWS] qcontent) [FWS] DQUOTE
+                        [CFWS]
+
+   A quoted-string is treated as a unit.  That is, quoted-string is
+   identical to atom, semantically.  Since a quoted-string is allowed to
+   contain FWS, folding is permitted.  Also note that since quoted-pair
+   is allowed in a quoted-string, the quote and backslash characters may
+   appear in a quoted-string so long as they appear as a quoted-pair.
+
+   Semantically, neither the optional CFWS outside of the quote
+   characters nor the quote characters themselves are part of the
+   quoted-string; the quoted-string is what is contained between the two
+   quote characters.  As stated earlier, the "\" in any quoted-pair and
+   the CRLF in any FWS/CFWS that appears within the quoted-string are
+   semantically "invisible" and therefore not part of the quoted-string
+   either.
+
+3.2.6. Miscellaneous tokens
+
+   Three additional tokens are defined, word and phrase for combinations
+   of atoms and/or quoted-strings, and unstructured for use in
+   unstructured header fields and in some places within structured
+   header fields.
+
+word            =       atom / quoted-string
+
+phrase          =       1*word / obs-phrase
+
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 13]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+utext           =       NO-WS-CTL /     ; Non white space controls
+                        %d33-126 /      ; The rest of US-ASCII
+                        obs-utext
+
+unstructured    =       *([FWS] utext) [FWS]
+
+3.3. Date and Time Specification
+
+   Date and time occur in several header fields.  This section specifies
+   the syntax for a full date and time specification.  Though folding
+   white space is permitted throughout the date-time specification, it
+   is RECOMMENDED that a single space be used in each place that FWS
+   appears (whether it is required or optional); some older
+   implementations may not interpret other occurrences of folding white
+   space correctly.
+
+date-time       =       [ day-of-week "," ] date FWS time [CFWS]
+
+day-of-week     =       ([FWS] day-name) / obs-day-of-week
+
+day-name        =       "Mon" / "Tue" / "Wed" / "Thu" /
+                        "Fri" / "Sat" / "Sun"
+
+date            =       day month year
+
+year            =       4*DIGIT / obs-year
+
+month           =       (FWS month-name FWS) / obs-month
+
+month-name      =       "Jan" / "Feb" / "Mar" / "Apr" /
+                        "May" / "Jun" / "Jul" / "Aug" /
+                        "Sep" / "Oct" / "Nov" / "Dec"
+
+day             =       ([FWS] 1*2DIGIT) / obs-day
+
+time            =       time-of-day FWS zone
+
+time-of-day     =       hour ":" minute [ ":" second ]
+
+hour            =       2DIGIT / obs-hour
+
+minute          =       2DIGIT / obs-minute
+
+second          =       2DIGIT / obs-second
+
+zone            =       (( "+" / "-" ) 4DIGIT) / obs-zone
+
+
+
+
+
+Resnick                     Standards Track                    [Page 14]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   The day is the numeric day of the month.  The year is any numeric
+   year 1900 or later.
+
+   The time-of-day specifies the number of hours, minutes, and
+   optionally seconds since midnight of the date indicated.
+
+   The date and time-of-day SHOULD express local time.
+
+   The zone specifies the offset from Coordinated Universal Time (UTC,
+   formerly referred to as "Greenwich Mean Time") that the date and
+   time-of-day represent.  The "+" or "-" indicates whether the
+   time-of-day is ahead of (i.e., east of) or behind (i.e., west of)
+   Universal Time.  The first two digits indicate the number of hours
+   difference from Universal Time, and the last two digits indicate the
+   number of minutes difference from Universal Time.  (Hence, +hhmm
+   means +(hh * 60 + mm) minutes, and -hhmm means -(hh * 60 + mm)
+   minutes).  The form "+0000" SHOULD be used to indicate a time zone at
+   Universal Time.  Though "-0000" also indicates Universal Time, it is
+   used to indicate that the time was generated on a system that may be
+   in a local time zone other than Universal Time and therefore
+   indicates that the date-time contains no information about the local
+   time zone.
+
+   A date-time specification MUST be semantically valid.  That is, the
+   day-of-the-week (if included) MUST be the day implied by the date,
+   the numeric day-of-month MUST be between 1 and the number of days
+   allowed for the specified month (in the specified year), the
+   time-of-day MUST be in the range 00:00:00 through 23:59:60 (the
+   number of seconds allowing for a leap second; see [STD12]), and the
+   zone MUST be within the range -9959 through +9959.
+
+3.4. Address Specification
+
+   Addresses occur in several message header fields to indicate senders
+   and recipients of messages.  An address may either be an individual
+   mailbox, or a group of mailboxes.
+
+address         =       mailbox / group
+
+mailbox         =       name-addr / addr-spec
+
+name-addr       =       [display-name] angle-addr
+
+angle-addr      =       [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr
+
+group           =       display-name ":" [mailbox-list / CFWS] ";"
+                        [CFWS]
+
+
+
+
+Resnick                     Standards Track                    [Page 15]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+display-name    =       phrase
+
+mailbox-list    =       (mailbox *("," mailbox)) / obs-mbox-list
+
+address-list    =       (address *("," address)) / obs-addr-list
+
+   A mailbox receives mail.  It is a conceptual entity which does not
+   necessarily pertain to file storage.  For example, some sites may
+   choose to print mail on a printer and deliver the output to the
+   addressee's desk.  Normally, a mailbox is comprised of two parts: (1)
+   an optional display name that indicates the name of the recipient
+   (which could be a person or a system) that could be displayed to the
+   user of a mail application, and (2) an addr-spec address enclosed in
+   angle brackets ("<" and ">").  There is also an alternate simple form
+   of a mailbox where the addr-spec address appears alone, without the
+   recipient's name or the angle brackets.  The Internet addr-spec
+   address is described in section 3.4.1.
+
+   Note: Some legacy implementations used the simple form where the
+   addr-spec appears without the angle brackets, but included the name
+   of the recipient in parentheses as a comment following the addr-spec.
+   Since the meaning of the information in a comment is unspecified,
+   implementations SHOULD use the full name-addr form of the mailbox,
+   instead of the legacy form, to specify the display name associated
+   with a mailbox.  Also, because some legacy implementations interpret
+   the comment, comments generally SHOULD NOT be used in address fields
+   to avoid confusing such implementations.
+
+   When it is desirable to treat several mailboxes as a single unit
+   (i.e., in a distribution list), the group construct can be used.  The
+   group construct allows the sender to indicate a named group of
+   recipients. This is done by giving a display name for the group,
+   followed by a colon, followed by a comma separated list of any number
+   of mailboxes (including zero and one), and ending with a semicolon.
+   Because the list of mailboxes can be empty, using the group construct
+   is also a simple way to communicate to recipients that the message
+   was sent to one or more named sets of recipients, without actually
+   providing the individual mailbox address for each of those
+   recipients.
+
+3.4.1. Addr-spec specification
+
+   An addr-spec is a specific Internet identifier that contains a
+   locally interpreted string followed by the at-sign character ("@",
+   ASCII value 64) followed by an Internet domain.  The locally
+   interpreted string is either a quoted-string or a dot-atom.  If the
+   string can be represented as a dot-atom (that is, it contains no
+   characters other than atext characters or "." surrounded by atext
+
+
+
+Resnick                     Standards Track                    [Page 16]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   characters), then the dot-atom form SHOULD be used and the
+   quoted-string form SHOULD NOT be used. Comments and folding white
+   space SHOULD NOT be used around the "@" in the addr-spec.
+
+addr-spec       =       local-part "@" domain
+
+local-part      =       dot-atom / quoted-string / obs-local-part
+
+domain          =       dot-atom / domain-literal / obs-domain
+
+domain-literal  =       [CFWS] "[" *([FWS] dcontent) [FWS] "]" [CFWS]
+
+dcontent        =       dtext / quoted-pair
+
+dtext           =       NO-WS-CTL /     ; Non white space controls
+
+                        %d33-90 /       ; The rest of the US-ASCII
+                        %d94-126        ;  characters not including "[",
+                                        ;  "]", or "\"
+
+   The domain portion identifies the point to which the mail is
+   delivered. In the dot-atom form, this is interpreted as an Internet
+   domain name (either a host name or a mail exchanger name) as
+   described in [STD3, STD13, STD14].  In the domain-literal form, the
+   domain is interpreted as the literal Internet address of the
+   particular host.  In both cases, how addressing is used and how
+   messages are transported to a particular host is covered in the mail
+   transport document [RFC2821].  These mechanisms are outside of the
+   scope of this document.
+
+   The local-part portion is a domain dependent string.  In addresses,
+   it is simply interpreted on the particular host as a name of a
+   particular mailbox.
+
+3.5 Overall message syntax
+
+   A message consists of header fields, optionally followed by a message
+   body.  Lines in a message MUST be a maximum of 998 characters
+   excluding the CRLF, but it is RECOMMENDED that lines be limited to 78
+   characters excluding the CRLF.  (See section 2.1.1 for explanation.)
+   In a message body, though all of the characters listed in the text
+   rule MAY be used, the use of US-ASCII control characters (values 1
+   through 8, 11, 12, and 14 through 31) is discouraged since their
+   interpretation by receivers for display is not guaranteed.
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 17]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+message         =       (fields / obs-fields)
+                        [CRLF body]
+
+body            =       *(*998text CRLF) *998text
+
+   The header fields carry most of the semantic information and are
+   defined in section 3.6.  The body is simply a series of lines of text
+   which are uninterpreted for the purposes of this standard.
+
+3.6. Field definitions
+
+   The header fields of a message are defined here.  All header fields
+   have the same general syntactic structure: A field name, followed by
+   a colon, followed by the field body.  The specific syntax for each
+   header field is defined in the subsequent sections.
+
+   Note: In the ABNF syntax for each field in subsequent sections, each
+   field name is followed by the required colon.  However, for brevity
+   sometimes the colon is not referred to in the textual description of
+   the syntax.  It is, nonetheless, required.
+
+   It is important to note that the header fields are not guaranteed to
+   be in a particular order.  They may appear in any order, and they
+   have been known to be reordered occasionally when transported over
+   the Internet.  However, for the purposes of this standard, header
+   fields SHOULD NOT be reordered when a message is transported or
+   transformed.  More importantly, the trace header fields and resent
+   header fields MUST NOT be reordered, and SHOULD be kept in blocks
+   prepended to the message.  See sections 3.6.6 and 3.6.7 for more
+   information.
+
+   The only required header fields are the origination date field and
+   the originator address field(s).  All other header fields are
+   syntactically optional.  More information is contained in the table
+   following this definition.
+
+fields          =       *(trace
+                          *(resent-date /
+                           resent-from /
+                           resent-sender /
+                           resent-to /
+                           resent-cc /
+                           resent-bcc /
+                           resent-msg-id))
+                        *(orig-date /
+                        from /
+                        sender /
+                        reply-to /
+
+
+
+Resnick                     Standards Track                    [Page 18]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+                        to /
+                        cc /
+                        bcc /
+                        message-id /
+                        in-reply-to /
+                        references /
+                        subject /
+                        comments /
+                        keywords /
+                        optional-field)
+
+   The following table indicates limits on the number of times each
+   field may occur in a message header as well as any special
+   limitations on the use of those fields.  An asterisk next to a value
+   in the minimum or maximum column indicates that a special restriction
+   appears in the Notes column.
+
+Field           Min number      Max number      Notes
+
+trace           0               unlimited       Block prepended - see
+                                                3.6.7
+
+resent-date     0*              unlimited*      One per block, required
+                                                if other resent fields
+                                                present - see 3.6.6
+
+resent-from     0               unlimited*      One per block - see
+                                                3.6.6
+
+resent-sender   0*              unlimited*      One per block, MUST
+                                                occur with multi-address
+                                                resent-from - see 3.6.6
+
+resent-to       0               unlimited*      One per block - see
+                                                3.6.6
+
+resent-cc       0               unlimited*      One per block - see
+                                                3.6.6
+
+resent-bcc      0               unlimited*      One per block - see
+                                                3.6.6
+
+resent-msg-id   0               unlimited*      One per block - see
+                                                3.6.6
+
+orig-date       1               1
+
+from            1               1               See sender and 3.6.2
+
+
+
+Resnick                     Standards Track                    [Page 19]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+sender          0*              1               MUST occur with multi-
+                                                address from - see 3.6.2
+
+reply-to        0               1
+
+to              0               1
+
+cc              0               1
+
+bcc             0               1
+
+message-id      0*              1               SHOULD be present - see
+                                                3.6.4
+
+in-reply-to     0*              1               SHOULD occur in some
+                                                replies - see 3.6.4
+
+references      0*              1               SHOULD occur in some
+                                                replies - see 3.6.4
+
+subject         0               1
+
+comments        0               unlimited
+
+keywords        0               unlimited
+
+optional-field  0               unlimited
+
+   The exact interpretation of each field is described in subsequent
+   sections.
+
+3.6.1. The origination date field
+
+   The origination date field consists of the field name "Date" followed
+   by a date-time specification.
+
+orig-date       =       "Date:" date-time CRLF
+
+   The origination date specifies the date and time at which the creator
+   of the message indicated that the message was complete and ready to
+   enter the mail delivery system.  For instance, this might be the time
+   that a user pushes the "send" or "submit" button in an application
+   program.  In any case, it is specifically not intended to convey the
+   time that the message is actually transported, but rather the time at
+   which the human or other creator of the message has put the message
+   into its final form, ready for transport.  (For example, a portable
+   computer user who is not connected to a network might queue a message
+
+
+
+
+Resnick                     Standards Track                    [Page 20]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   for delivery.  The origination date is intended to contain the date
+   and time that the user queued the message, not the time when the user
+   connected to the network to send the message.)
+
+3.6.2. Originator fields
+
+   The originator fields of a message consist of the from field, the
+   sender field (when applicable), and optionally the reply-to field.
+   The from field consists of the field name "From" and a
+   comma-separated list of one or more mailbox specifications.  If the
+   from field contains more than one mailbox specification in the
+   mailbox-list, then the sender field, containing the field name
+   "Sender" and a single mailbox specification, MUST appear in the
+   message.  In either case, an optional reply-to field MAY also be
+   included, which contains the field name "Reply-To" and a
+   comma-separated list of one or more addresses.
+
+from            =       "From:" mailbox-list CRLF
+
+sender          =       "Sender:" mailbox CRLF
+
+reply-to        =       "Reply-To:" address-list CRLF
+
+   The originator fields indicate the mailbox(es) of the source of the
+   message.  The "From:" field specifies the author(s) of the message,
+   that is, the mailbox(es) of the person(s) or system(s) responsible
+   for the writing of the message.  The "Sender:" field specifies the
+   mailbox of the agent responsible for the actual transmission of the
+   message.  For example, if a secretary were to send a message for
+   another person, the mailbox of the secretary would appear in the
+   "Sender:" field and the mailbox of the actual author would appear in
+   the "From:" field.  If the originator of the message can be indicated
+   by a single mailbox and the author and transmitter are identical, the
+   "Sender:" field SHOULD NOT be used.  Otherwise, both fields SHOULD
+   appear.
+
+   The originator fields also provide the information required when
+   replying to a message.  When the "Reply-To:" field is present, it
+   indicates the mailbox(es) to which the author of the message suggests
+   that replies be sent.  In the absence of the "Reply-To:" field,
+   replies SHOULD by default be sent to the mailbox(es) specified in the
+   "From:" field unless otherwise specified by the person composing the
+   reply.
+
+   In all cases, the "From:" field SHOULD NOT contain any mailbox that
+   does not belong to the author(s) of the message.  See also section
+   3.6.3 for more information on forming the destination addresses for a
+   reply.
+
+
+
+Resnick                     Standards Track                    [Page 21]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+3.6.3. Destination address fields
+
+   The destination fields of a message consist of three possible fields,
+   each of the same form: The field name, which is either "To", "Cc", or
+   "Bcc", followed by a comma-separated list of one or more addresses
+   (either mailbox or group syntax).
+
+to              =       "To:" address-list CRLF
+
+cc              =       "Cc:" address-list CRLF
+
+bcc             =       "Bcc:" (address-list / [CFWS]) CRLF
+
+   The destination fields specify the recipients of the message.  Each
+   destination field may have one or more addresses, and each of the
+   addresses indicate the intended recipients of the message.  The only
+   difference between the three fields is how each is used.
+
+   The "To:" field contains the address(es) of the primary recipient(s)
+   of the message.
+
+   The "Cc:" field (where the "Cc" means "Carbon Copy" in the sense of
+   making a copy on a typewriter using carbon paper) contains the
+   addresses of others who are to receive the message, though the
+   content of the message may not be directed at them.
+
+   The "Bcc:" field (where the "Bcc" means "Blind Carbon Copy") contains
+   addresses of recipients of the message whose addresses are not to be
+   revealed to other recipients of the message.  There are three ways in
+   which the "Bcc:" field is used.  In the first case, when a message
+   containing a "Bcc:" field is prepared to be sent, the "Bcc:" line is
+   removed even though all of the recipients (including those specified
+   in the "Bcc:" field) are sent a copy of the message.  In the second
+   case, recipients specified in the "To:" and "Cc:" lines each are sent
+   a copy of the message with the "Bcc:" line removed as above, but the
+   recipients on the "Bcc:" line get a separate copy of the message
+   containing a "Bcc:" line.  (When there are multiple recipient
+   addresses in the "Bcc:" field, some implementations actually send a
+   separate copy of the message to each recipient with a "Bcc:"
+   containing only the address of that particular recipient.) Finally,
+   since a "Bcc:" field may contain no addresses, a "Bcc:" field can be
+   sent without any addresses indicating to the recipients that blind
+   copies were sent to someone.  Which method to use with "Bcc:" fields
+   is implementation dependent, but refer to the "Security
+   Considerations" section of this document for a discussion of each.
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 22]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   When a message is a reply to another message, the mailboxes of the
+   authors of the original message (the mailboxes in the "From:" field)
+   or mailboxes specified in the "Reply-To:" field (if it exists) MAY
+   appear in the "To:" field of the reply since these would normally be
+   the primary recipients of the reply.  If a reply is sent to a message
+   that has destination fields, it is often desirable to send a copy of
+   the reply to all of the recipients of the message, in addition to the
+   author.  When such a reply is formed, addresses in the "To:" and
+   "Cc:" fields of the original message MAY appear in the "Cc:" field of
+   the reply, since these are normally secondary recipients of the
+   reply.  If a "Bcc:" field is present in the original message,
+   addresses in that field MAY appear in the "Bcc:" field of the reply,
+   but SHOULD NOT appear in the "To:" or "Cc:" fields.
+
+   Note: Some mail applications have automatic reply commands that
+   include the destination addresses of the original message in the
+   destination addresses of the reply.  How those reply commands behave
+   is implementation dependent and is beyond the scope of this document.
+   In particular, whether or not to include the original destination
+   addresses when the original message had a "Reply-To:" field is not
+   addressed here.
+
+3.6.4. Identification fields
+
+   Though optional, every message SHOULD have a "Message-ID:" field.
+   Furthermore, reply messages SHOULD have "In-Reply-To:" and
+   "References:" fields as appropriate, as described below.
+
+   The "Message-ID:" field contains a single unique message identifier.
+   The "References:" and "In-Reply-To:" field each contain one or more
+   unique message identifiers, optionally separated by CFWS.
+
+   The message identifier (msg-id) is similar in syntax to an angle-addr
+   construct without the internal CFWS.
+
+message-id      =       "Message-ID:" msg-id CRLF
+
+in-reply-to     =       "In-Reply-To:" 1*msg-id CRLF
+
+references      =       "References:" 1*msg-id CRLF
+
+msg-id          =       [CFWS] "<" id-left "@" id-right ">" [CFWS]
+
+id-left         =       dot-atom-text / no-fold-quote / obs-id-left
+
+id-right        =       dot-atom-text / no-fold-literal / obs-id-right
+
+no-fold-quote   =       DQUOTE *(qtext / quoted-pair) DQUOTE
+
+
+
+Resnick                     Standards Track                    [Page 23]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+no-fold-literal =       "[" *(dtext / quoted-pair) "]"
+
+   The "Message-ID:" field provides a unique message identifier that
+   refers to a particular version of a particular message.  The
+   uniqueness of the message identifier is guaranteed by the host that
+   generates it (see below).  This message identifier is intended to be
+   machine readable and not necessarily meaningful to humans.  A message
+   identifier pertains to exactly one instantiation of a particular
+   message; subsequent revisions to the message each receive new message
+   identifiers.
+
+   Note: There are many instances when messages are "changed", but those
+   changes do not constitute a new instantiation of that message, and
+   therefore the message would not get a new message identifier.  For
+   example, when messages are introduced into the transport system, they
+   are often prepended with additional header fields such as trace
+   fields (described in section 3.6.7) and resent fields (described in
+   section 3.6.6).  The addition of such header fields does not change
+   the identity of the message and therefore the original "Message-ID:"
+   field is retained.  In all cases, it is the meaning that the sender
+   of the message wishes to convey (i.e., whether this is the same
+   message or a different message) that determines whether or not the
+   "Message-ID:" field changes, not any particular syntactic difference
+   that appears (or does not appear) in the message.
+
+   The "In-Reply-To:" and "References:" fields are used when creating a
+   reply to a message.  They hold the message identifier of the original
+   message and the message identifiers of other messages (for example,
+   in the case of a reply to a message which was itself a reply).  The
+   "In-Reply-To:" field may be used to identify the message (or
+   messages) to which the new message is a reply, while the
+   "References:" field may be used to identify a "thread" of
+   conversation.
+
+   When creating a reply to a message, the "In-Reply-To:" and
+   "References:" fields of the resultant message are constructed as
+   follows:
+
+   The "In-Reply-To:" field will contain the contents of the "Message-
+   ID:" field of the message to which this one is a reply (the "parent
+   message").  If there is more than one parent message, then the "In-
+   Reply-To:" field will contain the contents of all of the parents'
+   "Message-ID:" fields.  If there is no "Message-ID:" field in any of
+   the parent messages, then the new message will have no "In-Reply-To:"
+   field.
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 24]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   The "References:" field will contain the contents of the parent's
+   "References:" field (if any) followed by the contents of the parent's
+   "Message-ID:" field (if any).  If the parent message does not contain
+   a "References:" field but does have an "In-Reply-To:" field
+   containing a single message identifier, then the "References:" field
+   will contain the contents of the parent's "In-Reply-To:" field
+   followed by the contents of the parent's "Message-ID:" field (if
+   any).  If the parent has none of the "References:", "In-Reply-To:",
+   or "Message-ID:" fields, then the new message will have no
+   "References:" field.
+
+   Note: Some implementations parse the "References:" field to display
+   the "thread of the discussion".  These implementations assume that
+   each new message is a reply to a single parent and hence that they
+   can walk backwards through the "References:" field to find the parent
+   of each message listed there.  Therefore, trying to form a
+   "References:" field for a reply that has multiple parents is
+   discouraged and how to do so is not defined in this document.
+
+   The message identifier (msg-id) itself MUST be a globally unique
+   identifier for a message.  The generator of the message identifier
+   MUST guarantee that the msg-id is unique.  There are several
+   algorithms that can be used to accomplish this.  Since the msg-id has
+   a similar syntax to angle-addr (identical except that comments and
+   folding white space are not allowed), a good method is to put the
+   domain name (or a domain literal IP address) of the host on which the
+   message identifier was created on the right hand side of the "@", and
+   put a combination of the current absolute date and time along with
+   some other currently unique (perhaps sequential) identifier available
+   on the system (for example, a process id number) on the left hand
+   side.  Using a date on the left hand side and a domain name or domain
+   literal on the right hand side makes it possible to guarantee
+   uniqueness since no two hosts use the same domain name or IP address
+   at the same time.  Though other algorithms will work, it is
+   RECOMMENDED that the right hand side contain some domain identifier
+   (either of the host itself or otherwise) such that the generator of
+   the message identifier can guarantee the uniqueness of the left hand
+   side within the scope of that domain.
+
+   Semantically, the angle bracket characters are not part of the
+   msg-id; the msg-id is what is contained between the two angle bracket
+   characters.
+
+
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 25]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+3.6.5. Informational fields
+
+   The informational fields are all optional.  The "Keywords:" field
+   contains a comma-separated list of one or more words or
+   quoted-strings. The "Subject:" and "Comments:" fields are
+   unstructured fields as defined in section 2.2.1, and therefore may
+   contain text or folding white space.
+
+subject         =       "Subject:" unstructured CRLF
+
+comments        =       "Comments:" unstructured CRLF
+
+keywords        =       "Keywords:" phrase *("," phrase) CRLF
+
+   These three fields are intended to have only human-readable content
+   with information about the message.  The "Subject:" field is the most
+   common and contains a short string identifying the topic of the
+   message.  When used in a reply, the field body MAY start with the
+   string "Re: " (from the Latin "res", in the matter of) followed by
+   the contents of the "Subject:" field body of the original message.
+   If this is done, only one instance of the literal string "Re: " ought
+   to be used since use of other strings or more than one instance can
+   lead to undesirable consequences.  The "Comments:" field contains any
+   additional comments on the text of the body of the message.  The
+   "Keywords:" field contains a comma-separated list of important words
+   and phrases that might be useful for the recipient.
+
+3.6.6. Resent fields
+
+   Resent fields SHOULD be added to any message that is reintroduced by
+   a user into the transport system.  A separate set of resent fields
+   SHOULD be added each time this is done.  All of the resent fields
+   corresponding to a particular resending of the message SHOULD be
+   together.  Each new set of resent fields is prepended to the message;
+   that is, the most recent set of resent fields appear earlier in the
+   message.  No other fields in the message are changed when resent
+   fields are added.
+
+   Each of the resent fields corresponds to a particular field elsewhere
+   in the syntax.  For instance, the "Resent-Date:" field corresponds to
+   the "Date:" field and the "Resent-To:" field corresponds to the "To:"
+   field.  In each case, the syntax for the field body is identical to
+   the syntax given previously for the corresponding field.
+
+   When resent fields are used, the "Resent-From:" and "Resent-Date:"
+   fields MUST be sent.  The "Resent-Message-ID:" field SHOULD be sent.
+   "Resent-Sender:" SHOULD NOT be used if "Resent-Sender:" would be
+   identical to "Resent-From:".
+
+
+
+Resnick                     Standards Track                    [Page 26]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+resent-date     =       "Resent-Date:" date-time CRLF
+
+resent-from     =       "Resent-From:" mailbox-list CRLF
+
+resent-sender   =       "Resent-Sender:" mailbox CRLF
+
+resent-to       =       "Resent-To:" address-list CRLF
+
+resent-cc       =       "Resent-Cc:" address-list CRLF
+
+resent-bcc      =       "Resent-Bcc:" (address-list / [CFWS]) CRLF
+
+resent-msg-id   =       "Resent-Message-ID:" msg-id CRLF
+
+   Resent fields are used to identify a message as having been
+   reintroduced into the transport system by a user.  The purpose of
+   using resent fields is to have the message appear to the final
+   recipient as if it were sent directly by the original sender, with
+   all of the original fields remaining the same.  Each set of resent
+   fields correspond to a particular resending event.  That is, if a
+   message is resent multiple times, each set of resent fields gives
+   identifying information for each individual time.  Resent fields are
+   strictly informational.  They MUST NOT be used in the normal
+   processing of replies or other such automatic actions on messages.
+
+   Note: Reintroducing a message into the transport system and using
+   resent fields is a different operation from "forwarding".
+   "Forwarding" has two meanings: One sense of forwarding is that a mail
+   reading program can be told by a user to forward a copy of a message
+   to another person, making the forwarded message the body of the new
+   message.  A forwarded message in this sense does not appear to have
+   come from the original sender, but is an entirely new message from
+   the forwarder of the message.  On the other hand, forwarding is also
+   used to mean when a mail transport program gets a message and
+   forwards it on to a different destination for final delivery.  Resent
+   header fields are not intended for use with either type of
+   forwarding.
+
+   The resent originator fields indicate the mailbox of the person(s) or
+   system(s) that resent the message.  As with the regular originator
+   fields, there are two forms: a simple "Resent-From:" form which
+   contains the mailbox of the individual doing the resending, and the
+   more complex form, when one individual (identified in the
+   "Resent-Sender:" field) resends a message on behalf of one or more
+   others (identified in the "Resent-From:" field).
+
+   Note: When replying to a resent message, replies behave just as they
+   would with any other message, using the original "From:",
+
+
+
+Resnick                     Standards Track                    [Page 27]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   "Reply-To:", "Message-ID:", and other fields.  The resent fields are
+   only informational and MUST NOT be used in the normal processing of
+   replies.
+
+   The "Resent-Date:" indicates the date and time at which the resent
+   message is dispatched by the resender of the message.  Like the
+   "Date:" field, it is not the date and time that the message was
+   actually transported.
+
+   The "Resent-To:", "Resent-Cc:", and "Resent-Bcc:" fields function
+   identically to the "To:", "Cc:", and "Bcc:" fields respectively,
+   except that they indicate the recipients of the resent message, not
+   the recipients of the original message.
+
+   The "Resent-Message-ID:" field provides a unique identifier for the
+   resent message.
+
+3.6.7. Trace fields
+
+   The trace fields are a group of header fields consisting of an
+   optional "Return-Path:" field, and one or more "Received:" fields.
+   The "Return-Path:" header field contains a pair of angle brackets
+   that enclose an optional addr-spec.  The "Received:" field contains a
+   (possibly empty) list of name/value pairs followed by a semicolon and
+   a date-time specification.  The first item of the name/value pair is
+   defined by item-name, and the second item is either an addr-spec, an
+   atom, a domain, or a msg-id.  Further restrictions may be applied to
+   the syntax of the trace fields by standards that provide for their
+   use, such as [RFC2821].
+
+trace           =       [return]
+                        1*received
+
+return          =       "Return-Path:" path CRLF
+
+path            =       ([CFWS] "<" ([CFWS] / addr-spec) ">" [CFWS]) /
+                        obs-path
+
+received        =       "Received:" name-val-list ";" date-time CRLF
+
+name-val-list   =       [CFWS] [name-val-pair *(CFWS name-val-pair)]
+
+name-val-pair   =       item-name CFWS item-value
+
+item-name       =       ALPHA *(["-"] (ALPHA / DIGIT))
+
+item-value      =       1*angle-addr / addr-spec /
+                         atom / domain / msg-id
+
+
+
+Resnick                     Standards Track                    [Page 28]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   A full discussion of the Internet mail use of trace fields is
+   contained in [RFC2821].  For the purposes of this standard, the trace
+   fields are strictly informational, and any formal interpretation of
+   them is outside of the scope of this document.
+
+3.6.8. Optional fields
+
+   Fields may appear in messages that are otherwise unspecified in this
+   standard.  They MUST conform to the syntax of an optional-field.
+   This is a field name, made up of the printable US-ASCII characters
+   except SP and colon, followed by a colon, followed by any text which
+   conforms to unstructured.
+
+   The field names of any optional-field MUST NOT be identical to any
+   field name specified elsewhere in this standard.
+
+optional-field  =       field-name ":" unstructured CRLF
+
+field-name      =       1*ftext
+
+ftext           =       %d33-57 /               ; Any character except
+                        %d59-126                ;  controls, SP, and
+                                                ;  ":".
+
+   For the purposes of this standard, any optional field is
+   uninterpreted.
+
+4. Obsolete Syntax
+
+   Earlier versions of this standard allowed for different (usually more
+   liberal) syntax than is allowed in this version.  Also, there have
+   been syntactic elements used in messages on the Internet whose
+   interpretation have never been documented.  Though some of these
+   syntactic forms MUST NOT be generated according to the grammar in
+   section 3, they MUST be accepted and parsed by a conformant receiver.
+   This section documents many of these syntactic elements.  Taking the
+   grammar in section 3 and adding the definitions presented in this
+   section will result in the grammar to use for interpretation of
+   messages.
+
+   Note: This section identifies syntactic forms that any implementation
+   MUST reasonably interpret.  However, there are certainly Internet
+   messages which do not conform to even the additional syntax given in
+   this section.  The fact that a particular form does not appear in any
+   section of this document is not justification for computer programs
+   to crash or for malformed data to be irretrievably lost by any
+   implementation.  To repeat an example, though this document requires
+   lines in messages to be no longer than 998 characters, silently
+
+
+
+Resnick                     Standards Track                    [Page 29]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   discarding the 999th and subsequent characters in a line without
+   warning would still be bad behavior for an implementation.  It is up
+   to the implementation to deal with messages robustly.
+
+   One important difference between the obsolete (interpreting) and the
+   current (generating) syntax is that in structured header field bodies
+   (i.e., between the colon and the CRLF of any structured header
+   field), white space characters, including folding white space, and
+   comments can be freely inserted between any syntactic tokens.  This
+   allows many complex forms that have proven difficult for some
+   implementations to parse.
+
+   Another key difference between the obsolete and the current syntax is
+   that the rule in section 3.2.3 regarding lines composed entirely of
+   white space in comments and folding white space does not apply.  See
+   the discussion of folding white space in section 4.2 below.
+
+   Finally, certain characters that were formerly allowed in messages
+   appear in this section.  The NUL character (ASCII value 0) was once
+   allowed, but is no longer for compatibility reasons.  CR and LF were
+   allowed to appear in messages other than as CRLF; this use is also
+   shown here.
+
+   Other differences in syntax and semantics are noted in the following
+   sections.
+
+4.1. Miscellaneous obsolete tokens
+
+   These syntactic elements are used elsewhere in the obsolete syntax or
+   in the main syntax.  The obs-char and obs-qp elements each add ASCII
+   value 0. Bare CR and bare LF are added to obs-text and obs-utext.
+   The period character is added to obs-phrase. The obs-phrase-list
+   provides for "empty" elements in a comma-separated list of phrases.
+
+   Note: The "period" (or "full stop") character (".") in obs-phrase is
+   not a form that was allowed in earlier versions of this or any other
+   standard.  Period (nor any other character from specials) was not
+   allowed in phrase because it introduced a parsing difficulty
+   distinguishing between phrases and portions of an addr-spec (see
+   section 4.4).  It appears here because the period character is
+   currently used in many messages in the display-name portion of
+   addresses, especially for initials in names, and therefore must be
+   interpreted properly.  In the future, period may appear in the
+   regular syntax of phrase.
+
+obs-qp          =       "\" (%d0-127)
+
+obs-text        =       *LF *CR *(obs-char *LF *CR)
+
+
+
+Resnick                     Standards Track                    [Page 30]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+obs-char        =       %d0-9 / %d11 /          ; %d0-127 except CR and
+                        %d12 / %d14-127         ;  LF
+
+obs-utext       =       obs-text
+
+obs-phrase      =       word *(word / "." / CFWS)
+
+obs-phrase-list =       phrase / 1*([phrase] [CFWS] "," [CFWS]) [phrase]
+
+   Bare CR and bare LF appear in messages with two different meanings.
+   In many cases, bare CR or bare LF are used improperly instead of CRLF
+   to indicate line separators.  In other cases, bare CR and bare LF are
+   used simply as ASCII control characters with their traditional ASCII
+   meanings.
+
+4.2. Obsolete folding white space
+
+   In the obsolete syntax, any amount of folding white space MAY be
+   inserted where the obs-FWS rule is allowed.  This creates the
+   possibility of having two consecutive "folds" in a line, and
+   therefore the possibility that a line which makes up a folded header
+   field could be composed entirely of white space.
+
+   obs-FWS         =       1*WSP *(CRLF 1*WSP)
+
+4.3. Obsolete Date and Time
+
+   The syntax for the obsolete date format allows a 2 digit year in the
+   date field and allows for a list of alphabetic time zone
+   specifications that were used in earlier versions of this standard.
+   It also permits comments and folding white space between many of the
+   tokens.
+
+obs-day-of-week =       [CFWS] day-name [CFWS]
+
+obs-year        =       [CFWS] 2*DIGIT [CFWS]
+
+obs-month       =       CFWS month-name CFWS
+
+obs-day         =       [CFWS] 1*2DIGIT [CFWS]
+
+obs-hour        =       [CFWS] 2DIGIT [CFWS]
+
+obs-minute      =       [CFWS] 2DIGIT [CFWS]
+
+obs-second      =       [CFWS] 2DIGIT [CFWS]
+
+obs-zone        =       "UT" / "GMT" /          ; Universal Time
+
+
+
+Resnick                     Standards Track                    [Page 31]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+                                                ; North American UT
+                                                ; offsets
+                        "EST" / "EDT" /         ; Eastern:  - 5/ - 4
+                        "CST" / "CDT" /         ; Central:  - 6/ - 5
+                        "MST" / "MDT" /         ; Mountain: - 7/ - 6
+                        "PST" / "PDT" /         ; Pacific:  - 8/ - 7
+
+                        %d65-73 /               ; Military zones - "A"
+                        %d75-90 /               ; through "I" and "K"
+                        %d97-105 /              ; through "Z", both
+                        %d107-122               ; upper and lower case
+
+   Where a two or three digit year occurs in a date, the year is to be
+   interpreted as follows: If a two digit year is encountered whose
+   value is between 00 and 49, the year is interpreted by adding 2000,
+   ending up with a value between 2000 and 2049.  If a two digit year is
+   encountered with a value between 50 and 99, or any three digit year
+   is encountered, the year is interpreted by adding 1900.
+
+   In the obsolete time zone, "UT" and "GMT" are indications of
+   "Universal Time" and "Greenwich Mean Time" respectively and are both
+   semantically identical to "+0000".
+
+   The remaining three character zones are the US time zones.  The first
+   letter, "E", "C", "M", or "P" stands for "Eastern", "Central",
+   "Mountain" and "Pacific".  The second letter is either "S" for
+   "Standard" time, or "D" for "Daylight" (or summer) time.  Their
+   interpretations are as follows:
+
+   EDT is semantically equivalent to -0400
+   EST is semantically equivalent to -0500
+   CDT is semantically equivalent to -0500
+   CST is semantically equivalent to -0600
+   MDT is semantically equivalent to -0600
+   MST is semantically equivalent to -0700
+   PDT is semantically equivalent to -0700
+   PST is semantically equivalent to -0800
+
+   The 1 character military time zones were defined in a non-standard
+   way in [RFC822] and are therefore unpredictable in their meaning.
+   The original definitions of the military zones "A" through "I" are
+   equivalent to "+0100" through "+0900" respectively; "K", "L", and "M"
+   are equivalent to  "+1000", "+1100", and "+1200" respectively; "N"
+   through "Y" are equivalent to "-0100" through "-1200" respectively;
+   and "Z" is equivalent to "+0000".  However, because of the error in
+   [RFC822], they SHOULD all be considered equivalent to "-0000" unless
+   there is out-of-band information confirming their meaning.
+
+
+
+
+Resnick                     Standards Track                    [Page 32]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   Other multi-character (usually between 3 and 5) alphabetic time zones
+   have been used in Internet messages.  Any such time zone whose
+   meaning is not known SHOULD be considered equivalent to "-0000"
+   unless there is out-of-band information confirming their meaning.
+
+4.4. Obsolete Addressing
+
+   There are three primary differences in addressing.  First, mailbox
+   addresses were allowed to have a route portion before the addr-spec
+   when enclosed in "<" and ">".  The route is simply a comma-separated
+   list of domain names, each preceded by "@", and the list terminated
+   by a colon.  Second, CFWS were allowed between the period-separated
+   elements of local-part and domain (i.e., dot-atom was not used).  In
+   addition, local-part is allowed to contain quoted-string in addition
+   to just atom.  Finally, mailbox-list and address-list were allowed to
+   have "null" members.  That is, there could be two or more commas in
+   such a list with nothing in between them.
+
+obs-angle-addr  =       [CFWS] "<" [obs-route] addr-spec ">" [CFWS]
+
+obs-route       =       [CFWS] obs-domain-list ":" [CFWS]
+
+obs-domain-list =       "@" domain *(*(CFWS / "," ) [CFWS] "@" domain)
+
+obs-local-part  =       word *("." word)
+
+obs-domain      =       atom *("." atom)
+
+obs-mbox-list   =       1*([mailbox] [CFWS] "," [CFWS]) [mailbox]
+
+obs-addr-list   =       1*([address] [CFWS] "," [CFWS]) [address]
+
+   When interpreting addresses, the route portion SHOULD be ignored.
+
+4.5. Obsolete header fields
+
+   Syntactically, the primary difference in the obsolete field syntax is
+   that it allows multiple occurrences of any of the fields and they may
+   occur in any order.  Also, any amount of white space is allowed
+   before the ":" at the end of the field name.
+
+obs-fields      =       *(obs-return /
+                        obs-received /
+                        obs-orig-date /
+                        obs-from /
+                        obs-sender /
+                        obs-reply-to /
+                        obs-to /
+
+
+
+Resnick                     Standards Track                    [Page 33]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+                        obs-cc /
+                        obs-bcc /
+                        obs-message-id /
+                        obs-in-reply-to /
+                        obs-references /
+                        obs-subject /
+                        obs-comments /
+                        obs-keywords /
+                        obs-resent-date /
+                        obs-resent-from /
+                        obs-resent-send /
+                        obs-resent-rply /
+                        obs-resent-to /
+                        obs-resent-cc /
+                        obs-resent-bcc /
+                        obs-resent-mid /
+                        obs-optional)
+
+   Except for destination address fields (described in section 4.5.3),
+   the interpretation of multiple occurrences of fields is unspecified.
+   Also, the interpretation of trace fields and resent fields which do
+   not occur in blocks prepended to the message is unspecified as well.
+   Unless otherwise noted in the following sections, interpretation of
+   other fields is identical to the interpretation of their non-obsolete
+   counterparts in section 3.
+
+4.5.1. Obsolete origination date field
+
+obs-orig-date   =       "Date" *WSP ":" date-time CRLF
+
+4.5.2. Obsolete originator fields
+
+obs-from        =       "From" *WSP ":" mailbox-list CRLF
+
+obs-sender      =       "Sender" *WSP ":" mailbox CRLF
+
+obs-reply-to    =       "Reply-To" *WSP ":" mailbox-list CRLF
+
+4.5.3. Obsolete destination address fields
+
+obs-to          =       "To" *WSP ":" address-list CRLF
+
+obs-cc          =       "Cc" *WSP ":" address-list CRLF
+
+obs-bcc         =       "Bcc" *WSP ":" (address-list / [CFWS]) CRLF
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 34]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   When multiple occurrences of destination address fields occur in a
+   message, they SHOULD be treated as if the address-list in the first
+   occurrence of the field is combined with the address lists of the
+   subsequent occurrences by adding a comma and concatenating.
+
+4.5.4. Obsolete identification fields
+
+   The obsolete "In-Reply-To:" and "References:" fields differ from the
+   current syntax in that they allow phrase (words or quoted strings) to
+   appear.  The obsolete forms of the left and right sides of msg-id
+   allow interspersed CFWS, making them syntactically identical to
+   local-part and domain respectively.
+
+obs-message-id  =       "Message-ID" *WSP ":" msg-id CRLF
+
+obs-in-reply-to =       "In-Reply-To" *WSP ":" *(phrase / msg-id) CRLF
+
+obs-references  =       "References" *WSP ":" *(phrase / msg-id) CRLF
+
+obs-id-left     =       local-part
+
+obs-id-right    =       domain
+
+   For purposes of interpretation, the phrases in the "In-Reply-To:" and
+   "References:" fields are ignored.
+
+   Semantically, none of the optional CFWS surrounding the local-part
+   and the domain are part of the obs-id-left and obs-id-right
+   respectively.
+
+4.5.5. Obsolete informational fields
+
+obs-subject     =       "Subject" *WSP ":" unstructured CRLF
+
+obs-comments    =       "Comments" *WSP ":" unstructured CRLF
+
+obs-keywords    =       "Keywords" *WSP ":" obs-phrase-list CRLF
+
+4.5.6. Obsolete resent fields
+
+   The obsolete syntax adds a "Resent-Reply-To:" field, which consists
+   of the field name, the optional comments and folding white space, the
+   colon, and a comma separated list of addresses.
+
+obs-resent-from =       "Resent-From" *WSP ":" mailbox-list CRLF
+
+obs-resent-send =       "Resent-Sender" *WSP ":" mailbox CRLF
+
+
+
+
+Resnick                     Standards Track                    [Page 35]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+obs-resent-date =       "Resent-Date" *WSP ":" date-time CRLF
+
+obs-resent-to   =       "Resent-To" *WSP ":" address-list CRLF
+
+obs-resent-cc   =       "Resent-Cc" *WSP ":" address-list CRLF
+
+obs-resent-bcc  =       "Resent-Bcc" *WSP ":"
+                         (address-list / [CFWS]) CRLF
+
+obs-resent-mid  =       "Resent-Message-ID" *WSP ":" msg-id CRLF
+
+obs-resent-rply =       "Resent-Reply-To" *WSP ":" address-list CRLF
+
+   As with other resent fields, the "Resent-Reply-To:" field is to be
+   treated as trace information only.
+
+4.5.7. Obsolete trace fields
+
+   The obs-return and obs-received are again given here as template
+   definitions, just as return and received are in section 3.  Their
+   full syntax is given in [RFC2821].
+
+obs-return      =       "Return-Path" *WSP ":" path CRLF
+
+obs-received    =       "Received" *WSP ":" name-val-list CRLF
+
+obs-path        =       obs-angle-addr
+
+4.5.8. Obsolete optional fields
+
+obs-optional    =       field-name *WSP ":" unstructured CRLF
+
+5. Security Considerations
+
+   Care needs to be taken when displaying messages on a terminal or
+   terminal emulator.  Powerful terminals may act on escape sequences
+   and other combinations of ASCII control characters with a variety of
+   consequences.  They can remap the keyboard or permit other
+   modifications to the terminal which could lead to denial of service
+   or even damaged data.  They can trigger (sometimes programmable)
+   answerback messages which can allow a message to cause commands to be
+   issued on the recipient's behalf.  They can also effect the operation
+   of terminal attached devices such as printers.  Message viewers may
+   wish to strip potentially dangerous terminal escape sequences from
+   the message prior to display.  However, other escape sequences appear
+   in messages for useful purposes (cf. [RFC2045, RFC2046, RFC2047,
+   RFC2048, RFC2049, ISO2022]) and therefore should not be stripped
+   indiscriminately.
+
+
+
+Resnick                     Standards Track                    [Page 36]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   Transmission of non-text objects in messages raises additional
+   security issues.  These issues are discussed in [RFC2045, RFC2046,
+   RFC2047, RFC2048, RFC2049].
+
+   Many implementations use the "Bcc:" (blind carbon copy) field
+   described in section 3.6.3 to facilitate sending messages to
+   recipients without revealing the addresses of one or more of the
+   addressees to the other recipients.  Mishandling this use of "Bcc:"
+   has implications for confidential information that might be revealed,
+   which could eventually lead to security problems through knowledge of
+   even the existence of a particular mail address.  For example, if
+   using the first method described in section 3.6.3, where the "Bcc:"
+   line is removed from the message, blind recipients have no explicit
+   indication that they have been sent a blind copy, except insofar as
+   their address does not appear in the message header.  Because of
+   this, one of the blind addressees could potentially send a reply to
+   all of the shown recipients and accidentally reveal that the message
+   went to the blind recipient.  When the second method from section
+   3.6.3 is used, the blind recipient's address appears in the "Bcc:"
+   field of a separate copy of the message. If the "Bcc:" field sent
+   contains all of the blind addressees, all of the "Bcc:" recipients
+   will be seen by each "Bcc:" recipient.  Even if a separate message is
+   sent to each "Bcc:" recipient with only the individual's address,
+   implementations still need to be careful to process replies to the
+   message as per section 3.6.3 so as not to accidentally reveal the
+   blind recipient to other recipients.
+
+6. Bibliography
+
+   [ASCII]    American National Standards Institute (ANSI), Coded
+              Character Set - 7-Bit American National Standard Code for
+              Information Interchange, ANSI X3.4, 1986.
+
+   [ISO2022] International Organization for Standardization (ISO),
+              Information processing - ISO 7-bit and 8-bit coded
+              character sets - Code extension techniques, Third edition
+              - 1986-05-01, ISO 2022, 1986.
+
+   [RFC822]   Crocker, D., "Standard for the Format of ARPA Internet
+              Text Messages", RFC 822, August 1982.
+
+   [RFC2045]  Freed, N. and  N. Borenstein, "Multipurpose Internet Mail
+              Extensions (MIME) Part One: Format of Internet Message
+              Bodies", RFC 2045, November 1996.
+
+   [RFC2046]  Freed, N. and N. Borenstein, "Multipurpose Internet Mail
+              Extensions (MIME) Part Two: Media Types", RFC 2046,
+              November 1996.
+
+
+
+Resnick                     Standards Track                    [Page 37]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   [RFC2047]  Moore, K., "Multipurpose Internet Mail Extensions (MIME)
+              Part Three: Message Header Extensions for Non-ASCII Text",
+              RFC 2047, November 1996.
+
+   [RFC2048]  Freed, N., Klensin, J. and J. Postel, "Multipurpose
+              Internet Mail Extensions (MIME) Part Four: Format of
+              Internet Message Bodies", RFC 2048, November 1996.
+
+   [RFC2049]  Freed, N. and N. Borenstein, "Multipurpose Internet Mail
+              Extensions (MIME) Part Five: Conformance Criteria and
+              Examples", RFC 2049, November 1996.
+
+   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
+              Requirement Levels", BCP 14, RFC 2119, March 1997.
+
+   [RFC2234]  Crocker, D., Editor, and P. Overell, "Augmented BNF for
+              Syntax Specifications: ABNF", RFC 2234, November 1997.
+
+   [RFC2821]  Klensin, J., Editor, "Simple Mail Transfer Protocol", RFC
+              2821, March 2001.
+
+   [STD3]     Braden, R., "Host Requirements", STD 3, RFC 1122 and RFC
+              1123, October 1989.
+
+   [STD12]    Mills, D., "Network Time Protocol", STD 12, RFC 1119,
+              September 1989.
+
+   [STD13]    Mockapetris, P., "Domain Name System", STD 13, RFC 1034
+              and RFC 1035,  November 1987.
+
+   [STD14]    Partridge, C., "Mail Routing and the Domain System", STD
+              14, RFC 974, January 1986.
+
+7. Editor's Address
+
+   Peter W. Resnick
+   QUALCOMM Incorporated
+   5775 Morehouse Drive
+   San Diego, CA 92121-1714
+   USA
+
+   Phone: +1 858 651 4478
+   Fax:   +1 858 651 1102
+   EMail: presnick@qualcomm.com
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 38]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+8. Acknowledgements
+
+   Many people contributed to this document.  They included folks who
+   participated in the Detailed Revision and Update of Messaging
+   Standards (DRUMS) Working Group of the Internet Engineering Task
+   Force (IETF), the chair of DRUMS, the Area Directors of the IETF, and
+   people who simply sent their comments in via e-mail.  The editor is
+   deeply indebted to them all and thanks them sincerely.  The below
+   list includes everyone who sent e-mail concerning this document.
+   Hopefully, everyone who contributed is named here:
+
+   Matti Aarnio              Barry Finkel           Larry Masinter
+   Tanaka Akira              Erik Forsberg          Denis McKeon
+   Russ Allbery              Chuck Foster           William P McQuillan
+   Eric Allman               Paul Fox               Alexey Melnikov
+   Harald Tveit Alvestrand   Klaus M. Frank         Perry E. Metzger
+   Ran Atkinson              Ned Freed              Steven Miller
+   Jos Backus                Jochen Friedrich       Keith Moore
+   Bruce Balden              Randall C. Gellens     John Gardiner Myers
+   Dave Barr                 Sukvinder Singh Gill   Chris Newman
+   Alan Barrett              Tim Goodwin            John W. Noerenberg
+   John Beck                 Philip Guenther        Eric Norman
+   J. Robert von Behren      Tony Hansen            Mike O'Dell
+   Jos den Bekker            John Hawkinson         Larry Osterman
+   D. J. Bernstein           Philip Hazel           Paul Overell
+   James Berriman            Kai Henningsen         Jacob Palme
+   Norbert Bollow            Robert Herriot         Michael A. Patton
+   Raj Bose                  Paul Hethmon           Uzi Paz
+   Antony Bowesman           Jim Hill               Michael A. Quinlan
+   Scott Bradner             Paul E. Hoffman        Eric S. Raymond
+   Randy Bush                Steve Hole             Sam Roberts
+   Tom Byrer                 Kari Hurtta            Hugh Sasse
+   Bruce Campbell            Marco S. Hyman         Bart Schaefer
+   Larry Campbell            Ofer Inbar             Tom Scola
+   W. J. Carpenter           Olle Jarnefors         Wolfgang Segmuller
+   Michael Chapman           Kevin Johnson          Nick Shelness
+   Richard Clayton           Sudish Joseph          John Stanley
+   Maurizio Codogno          Maynard Kang           Einar Stefferud
+   Jim Conklin               Prabhat Keni           Jeff Stephenson
+   R. Kelley Cook            John C. Klensin        Bernard Stern
+   Steve Coya                Graham Klyne           Peter Sylvester
+   Mark Crispin              Brad Knowles           Mark Symons
+   Dave Crocker              Shuhei Kobayashi       Eric Thomas
+   Matt Curtin               Peter Koch             Lee Thompson
+   Michael D'Errico          Dan Kohn               Karel De Vriendt
+   Cyrus Daboo               Christian Kuhtz        Matthew Wall
+   Jutta Degener             Anand Kumria           Rolf Weber
+   Mark Delany               Steen Larsen           Brent B. Welch
+
+
+
+Resnick                     Standards Track                    [Page 39]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   Steve Dorner              Eliot Lear             Dan Wing
+   Harold A. Driscoll        Barry Leiba            Jack De Winter
+   Michael Elkins            Jay Levitt             Gregory J. Woodhouse
+   Robert Elz                Lars-Johan Liman       Greg A. Woods
+   Johnny Eriksson           Charles Lindsey        Kazu Yamamoto
+   Erik E. Fair              Pete Loshin            Alain Zahm
+   Roger Fajman              Simon Lyall            Jamie Zawinski
+   Patrik Faltstrom          Bill Manning           Timothy S. Zurcher
+   Claus Andre Farber        John Martin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 40]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+Appendix A. Example messages
+
+   This section presents a selection of messages.  These are intended to
+   assist in the implementation of this standard, but should not be
+   taken as normative; that is to say, although the examples in this
+   section were carefully reviewed, if there happens to be a conflict
+   between these examples and the syntax described in sections 3 and 4
+   of this document, the syntax in those sections is to be taken as
+   correct.
+
+   Messages are delimited in this section between lines of "----".  The
+   "----" lines are not part of the message itself.
+
+A.1. Addressing examples
+
+   The following are examples of messages that might be sent between two
+   individuals.
+
+A.1.1. A message from one person to another with simple addressing
+
+   This could be called a canonical message.  It has a single author,
+   John Doe, a single recipient, Mary Smith, a subject, the date, a
+   message identifier, and a textual message in the body.
+
+----
+From: John Doe <jdoe@machine.example>
+To: Mary Smith <mary@example.net>
+Subject: Saying Hello
+Date: Fri, 21 Nov 1997 09:55:06 -0600
+Message-ID: <1234@local.machine.example>
+
+This is a message just to say hello.
+So, "Hello".
+----
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 41]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   If John's secretary Michael actually sent the message, though John
+   was the author and replies to this message should go back to him, the
+   sender field would be used:
+
+----
+From: John Doe <jdoe@machine.example>
+Sender: Michael Jones <mjones@machine.example>
+To: Mary Smith <mary@example.net>
+Subject: Saying Hello
+Date: Fri, 21 Nov 1997 09:55:06 -0600
+Message-ID: <1234@local.machine.example>
+
+This is a message just to say hello.
+So, "Hello".
+----
+
+A.1.2. Different types of mailboxes
+
+   This message includes multiple addresses in the destination fields
+   and also uses several different forms of addresses.
+
+----
+From: "Joe Q. Public" <john.q.public@example.com>
+To: Mary Smith <mary@x.test>, jdoe@example.org, Who? <one@y.test>
+Cc: <boss@nil.test>, "Giant; \"Big\" Box" <sysservices@example.net>
+Date: Tue, 1 Jul 2003 10:52:37 +0200
+Message-ID: <5678.21-Nov-1997@example.com>
+
+Hi everyone.
+----
+
+   Note that the display names for Joe Q. Public and Giant; "Big" Box
+   needed to be enclosed in double-quotes because the former contains
+   the period and the latter contains both semicolon and double-quote
+   characters (the double-quote characters appearing as quoted-pair
+   construct).  Conversely, the display name for Who? could appear
+   without them because the question mark is legal in an atom.  Notice
+   also that jdoe@example.org and boss@nil.test have no display names
+   associated with them at all, and jdoe@example.org uses the simpler
+   address form without the angle brackets.
+
+
+
+
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 42]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+A.1.3. Group addresses
+
+----
+From: Pete <pete@silly.example>
+To: A Group:Chris Jones <c@a.test>,joe@where.test,John <jdoe@one.test>;
+Cc: Undisclosed recipients:;
+Date: Thu, 13 Feb 1969 23:32:54 -0330
+Message-ID: <testabcd.1234@silly.example>
+
+Testing.
+----
+
+   In this message, the "To:" field has a single group recipient named A
+   Group which contains 3 addresses, and a "Cc:" field with an empty
+   group recipient named Undisclosed recipients.
+
+A.2. Reply messages
+
+   The following is a series of three messages that make up a
+   conversation thread between John and Mary.  John firsts sends a
+   message to Mary, Mary then replies to John's message, and then John
+   replies to Mary's reply message.
+
+   Note especially the "Message-ID:", "References:", and "In-Reply-To:"
+   fields in each message.
+
+----
+From: John Doe <jdoe@machine.example>
+To: Mary Smith <mary@example.net>
+Subject: Saying Hello
+Date: Fri, 21 Nov 1997 09:55:06 -0600
+Message-ID: <1234@local.machine.example>
+
+This is a message just to say hello.
+So, "Hello".
+----
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 43]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   When sending replies, the Subject field is often retained, though
+   prepended with "Re: " as described in section 3.6.5.
+
+----
+From: Mary Smith <mary@example.net>
+To: John Doe <jdoe@machine.example>
+Reply-To: "Mary Smith: Personal Account" <smith@home.example>
+Subject: Re: Saying Hello
+Date: Fri, 21 Nov 1997 10:01:10 -0600
+Message-ID: <3456@example.net>
+In-Reply-To: <1234@local.machine.example>
+References: <1234@local.machine.example>
+
+This is a reply to your hello.
+----
+
+   Note the "Reply-To:" field in the above message.  When John replies
+   to Mary's message above, the reply should go to the address in the
+   "Reply-To:" field instead of the address in the "From:" field.
+
+----
+To: "Mary Smith: Personal Account" <smith@home.example>
+From: John Doe <jdoe@machine.example>
+Subject: Re: Saying Hello
+Date: Fri, 21 Nov 1997 11:00:00 -0600
+Message-ID: <abcd.1234@local.machine.tld>
+In-Reply-To: <3456@example.net>
+References: <1234@local.machine.example> <3456@example.net>
+
+This is a reply to your reply.
+----
+
+A.3. Resent messages
+
+   Start with the message that has been used as an example several
+   times:
+
+----
+From: John Doe <jdoe@machine.example>
+To: Mary Smith <mary@example.net>
+Subject: Saying Hello
+Date: Fri, 21 Nov 1997 09:55:06 -0600
+Message-ID: <1234@local.machine.example>
+
+This is a message just to say hello.
+So, "Hello".
+----
+
+
+
+
+Resnick                     Standards Track                    [Page 44]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   Say that Mary, upon receiving this message, wishes to send a copy of
+   the message to Jane such that (a) the message would appear to have
+   come straight from John; (b) if Jane replies to the message, the
+   reply should go back to John; and (c) all of the original
+   information, like the date the message was originally sent to Mary,
+   the message identifier, and the original addressee, is preserved.  In
+   this case, resent fields are prepended to the message:
+
+----
+Resent-From: Mary Smith <mary@example.net>
+Resent-To: Jane Brown <j-brown@other.example>
+Resent-Date: Mon, 24 Nov 1997 14:22:01 -0800
+Resent-Message-ID: <78910@example.net>
+From: John Doe <jdoe@machine.example>
+To: Mary Smith <mary@example.net>
+Subject: Saying Hello
+Date: Fri, 21 Nov 1997 09:55:06 -0600
+Message-ID: <1234@local.machine.example>
+
+This is a message just to say hello.
+So, "Hello".
+----
+
+   If Jane, in turn, wished to resend this message to another person,
+   she would prepend her own set of resent header fields to the above
+   and send that.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 45]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+A.4. Messages with trace fields
+
+   As messages are sent through the transport system as described in
+   [RFC2821], trace fields are prepended to the message.  The following
+   is an example of what those trace fields might look like.  Note that
+   there is some folding white space in the first one since these lines
+   can be long.
+
+----
+Received: from x.y.test
+   by example.net
+   via TCP
+   with ESMTP
+   id ABC12345
+   for <mary@example.net>;  21 Nov 1997 10:05:43 -0600
+Received: from machine.example by x.y.test; 21 Nov 1997 10:01:22 -0600
+From: John Doe <jdoe@machine.example>
+To: Mary Smith <mary@example.net>
+Subject: Saying Hello
+Date: Fri, 21 Nov 1997 09:55:06 -0600
+Message-ID: <1234@local.machine.example>
+
+This is a message just to say hello.
+So, "Hello".
+----
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 46]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+A.5. White space, comments, and other oddities
+
+   White space, including folding white space, and comments can be
+   inserted between many of the tokens of fields.  Taking the example
+   from A.1.3, white space and comments can be inserted into all of the
+   fields.
+
+----
+From: Pete(A wonderful \) chap) <pete(his account)@silly.test(his host)>
+To:A Group(Some people)
+     :Chris Jones <c@(Chris's host.)public.example>,
+         joe@example.org,
+  John <jdoe@one.test> (my dear friend); (the end of the group)
+Cc:(Empty list)(start)Undisclosed recipients  :(nobody(that I know))  ;
+Date: Thu,
+      13
+        Feb
+          1969
+      23:32
+               -0330 (Newfoundland Time)
+Message-ID:              <testabcd.1234@silly.test>
+
+Testing.
+----
+
+   The above example is aesthetically displeasing, but perfectly legal.
+   Note particularly (1) the comments in the "From:" field (including
+   one that has a ")" character appearing as part of a quoted-pair); (2)
+   the white space absent after the ":" in the "To:" field as well as
+   the comment and folding white space after the group name, the special
+   character (".") in the comment in Chris Jones's address, and the
+   folding white space before and after "joe@example.org,"; (3) the
+   multiple and nested comments in the "Cc:" field as well as the
+   comment immediately following the ":" after "Cc"; (4) the folding
+   white space (but no comments except at the end) and the missing
+   seconds in the time of the date field; and (5) the white space before
+   (but not within) the identifier in the "Message-ID:" field.
+
+A.6. Obsoleted forms
+
+   The following are examples of obsolete (that is, the "MUST NOT
+   generate") syntactic elements described in section 4 of this
+   document.
+
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 47]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+A.6.1. Obsolete addressing
+
+   Note in the below example the lack of quotes around Joe Q. Public,
+   the route that appears in the address for Mary Smith, the two commas
+   that appear in the "To:" field, and the spaces that appear around the
+   "." in the jdoe address.
+
+----
+From: Joe Q. Public <john.q.public@example.com>
+To: Mary Smith <@machine.tld:mary@example.net>, , jdoe@test   . example
+Date: Tue, 1 Jul 2003 10:52:37 +0200
+Message-ID: <5678.21-Nov-1997@example.com>
+
+Hi everyone.
+----
+
+A.6.2. Obsolete dates
+
+   The following message uses an obsolete date format, including a non-
+   numeric time zone and a two digit year.  Note that although the
+   day-of-week is missing, that is not specific to the obsolete syntax;
+   it is optional in the current syntax as well.
+
+----
+From: John Doe <jdoe@machine.example>
+To: Mary Smith <mary@example.net>
+Subject: Saying Hello
+Date: 21 Nov 97 09:55:06 GMT
+Message-ID: <1234@local.machine.example>
+
+This is a message just to say hello.
+So, "Hello".
+----
+
+A.6.3. Obsolete white space and comments
+
+   White space and comments can appear between many more elements than
+   in the current syntax.  Also, folding lines that are made up entirely
+   of white space are legal.
+
+
+
+
+
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 48]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+----
+From  : John Doe <jdoe@machine(comment).  example>
+To    : Mary Smith
+__
+          <mary@example.net>
+Subject     : Saying Hello
+Date  : Fri, 21 Nov 1997 09(comment):   55  :  06 -0600
+Message-ID  : <1234   @   local(blah)  .machine .example>
+
+This is a message just to say hello.
+So, "Hello".
+----
+
+   Note especially the second line of the "To:" field.  It starts with
+   two space characters.  (Note that "__" represent blank spaces.)
+   Therefore, it is considered part of the folding as described in
+   section 4.2.  Also, the comments and white space throughout
+   addresses, dates, and message identifiers are all part of the
+   obsolete syntax.
+
+Appendix B. Differences from earlier standards
+
+   This appendix contains a list of changes that have been made in the
+   Internet Message Format from earlier standards, specifically [RFC822]
+   and [STD3].  Items marked with an asterisk (*) below are items which
+   appear in section 4 of this document and therefore can no longer be
+   generated.
+
+   1. Period allowed in obsolete form of phrase.
+   2. ABNF moved out of document to [RFC2234].
+   3. Four or more digits allowed for year.
+   4. Header field ordering (and lack thereof) made explicit.
+   5. Encrypted header field removed.
+   6. Received syntax loosened to allow any token/value pair.
+   7. Specifically allow and give meaning to "-0000" time zone.
+   8. Folding white space is not allowed between every token.
+   9. Requirement for destinations removed.
+   10. Forwarding and resending redefined.
+   11. Extension header fields no longer specifically called out.
+   12. ASCII 0 (null) removed.*
+   13. Folding continuation lines cannot contain only white space.*
+   14. Free insertion of comments not allowed in date.*
+   15. Non-numeric time zones not allowed.*
+   16. Two digit years not allowed.*
+   17. Three digit years interpreted, but not allowed for generation.
+   18. Routes in addresses not allowed.*
+   19. CFWS within local-parts and domains not allowed.*
+   20. Empty members of address lists not allowed.*
+
+
+
+Resnick                     Standards Track                    [Page 49]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+   21. Folding white space between field name and colon not allowed.*
+   22. Comments between field name and colon not allowed.
+   23. Tightened syntax of in-reply-to and references.*
+   24. CFWS within msg-id not allowed.*
+   25. Tightened semantics of resent fields as informational only.
+   26. Resent-Reply-To not allowed.*
+   27. No multiple occurrences of fields (except resent and received).*
+   28. Free CR and LF not allowed.*
+   29. Routes in return path not allowed.*
+   30. Line length limits specified.
+   31. Bcc more clearly specified.
+
+Appendix C. Notices
+
+   Intellectual Property
+
+   The IETF takes no position regarding the validity or scope of any
+   intellectual property or other rights that might be claimed to
+   pertain to the implementation or use of the technology described in
+   this document or the extent to which any license under such rights
+   might or might not be available; neither does it represent that it
+   has made any effort to identify any such rights.  Information on the
+   IETF's procedures with respect to rights in standards-track and
+   standards-related documentation can be found in BCP-11.  Copies of
+   claims of rights made available for publication and any assurances of
+   licenses to be made available, or the result of an attempt made to
+   obtain a general license or permission for the use of such
+   proprietary rights by implementors or users of this specification can
+   be obtained from the IETF Secretariat.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 50]
+
+RFC 2822                Internet Message Format               April 2001
+
+
+Full Copyright Statement
+
+   Copyright (C) The Internet Society (2001).  All Rights Reserved.
+
+   This document and translations of it may be copied and furnished to
+   others, and derivative works that comment on or otherwise explain it
+   or assist in its implementation may be prepared, copied, published
+   and distributed, in whole or in part, without restriction of any
+   kind, provided that the above copyright notice and this paragraph are
+   included on all such copies and derivative works.  However, this
+   document itself may not be modified in any way, such as by removing
+   the copyright notice or references to the Internet Society or other
+   Internet organizations, except as needed for the purpose of
+   developing Internet standards in which case the procedures for
+   copyrights defined in the Internet Standards process must be
+   followed, or as required to translate it into languages other than
+   English.
+
+   The limited permissions granted above are perpetual and will not be
+   revoked by the Internet Society or its successors or assigns.
+
+   This document and the information contained herein is provided on an
+   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+Acknowledgement
+
+   Funding for the RFC Editor function is currently provided by the
+   Internet Society.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Resnick                     Standards Track                    [Page 51]
+
Index: zmailer/include/libc.h
diff -u zmailer/include/libc.h:1.6 zmailer/include/libc.h:1.7
--- zmailer/include/libc.h:1.6	Tue Jan 23 01:35:10 2001
+++ zmailer/include/libc.h	Thu Mar  8 12:12:33 2001
@@ -13,10 +13,12 @@
 /* fullname.c */
 extern char *fullname __((const char *s, char buf[], int buflen, const char *up));
 
-#ifndef HAVE_STDLIB_H
 /* getopt.c */
-extern int getopt __((int argc, char * const *argv, const char *optstring));
-#endif
+extern int zgetopt __((int argc, char * const *argv, const char *optstring));
+extern int zoptopt;
+extern int zoptind;
+extern int zopterr;
+extern const char * zoptarg;
 
 /* getdtblsize.c */
 extern int getdtablesize __((void));
@@ -70,7 +72,7 @@
 typedef unsigned int socklen_t;
 #endif
 #ifndef HAVE_GETNAMEINFO
-extern       int   getnameinfo __((const struct sockaddr *, socklen_t, char *, size_t, char *, size_t, int));
+extern       int   getnameinfo __((const struct sockaddr *, socklen_t, char *, size_t, char *, size_t, unsigned int));
 #endif
 #ifndef HAVE_GETADDRINFO
 extern       void  freeaddrinfo __((struct addrinfo *));
Index: zmailer/include/libsh.h
diff -u zmailer/include/libsh.h:1.6 zmailer/include/libsh.h:1.7
--- zmailer/include/libsh.h:1.6	Thu Sep  9 03:10:21 1999
+++ zmailer/include/libsh.h	Thu Mar  8 12:12:33 2001
@@ -163,7 +163,6 @@
 /* Globals .... */
 
 extern char *getenv __((const char *));
-extern char *optarg;
 extern char *strerror __((int));
 extern char *strsignal __((int));
 extern int D_assign;
@@ -171,8 +170,6 @@
 extern int D_functions;
 extern int D_matched;
 extern int errno;
-extern int opterr;
-extern int optind;
 extern void *tmalloc __((const size_t n));
 #ifdef SPTREE_H
 extern void sp_null __((struct sptree *));
Index: zmailer/include/mail.h.in
diff -u zmailer/include/mail.h.in:1.8 zmailer/include/mail.h.in:1.9
--- zmailer/include/mail.h.in:1.8	Sat Dec  2 00:34:22 2000
+++ zmailer/include/mail.h.in	Tue Apr  3 14:45:38 2001
@@ -38,32 +38,32 @@
 #define	MSG_X400		".x400"
 
 /* The following characters may appear in the first column of a control file */
+/* These are in order (roughly) what the router writes out. */
+#define _CF_FORMAT	'@'	/* What format variant are we ?? */
+
+#define _CF_FORMAT_TA_PID	0x00000001 /* At 'r' or 'X' lines */
+#define _CF_FORMAT_DELAY1	0x00000002 /* At 'r' or 'X' lines */
+#define _CF_FORMAT_MIMESTRUCT   0x00000004 /* The 'M' block       */
+#define _CF_FORMAT_KNOWN_SET (_CF_FORMAT_DELAY1|_CF_FORMAT_TA_PID | \
+			      _CF_FORMAT_MIMESTRUCT)
+
+#define _CF_VERBOSE	'v'	/* log file name for verbose log (mail -v) */
 #define _CF_MESSAGEID	'i'	/* inode number of file containing message */
 #define _CF_BODYOFFSET	'o'	/* byte offset into message file of body */
+#define _CF_LOGIDENT	'l'	/* identification string for log entries */
 #define _CF_BODYFILE	'b'	/* alternate message file for new body */
+#define _CF_ERRORADDR	'e'	/* return address for error messages */
+#define _CF_OBSOLETES	'x'	/* message id of message obsoleted by this */
+#define	_CF_TURNME	'T'	/* trigger scheduler to attempt delivery now */
 #define _CF_SENDER	's'	/* sender triple (channel, host, user) */
 #define _CF_RECIPIENT	'r'	/* recipient n-tuple, n >= 3 */
 #define _CF_DSNRETMODE  'R'	/* DSN message body return control */
 #define _CF_XORECIPIENT	'X'	/* one of XOR set of recipient n-tuples */
 #define _CF_RCPTNOTARY	'N'	/* DSN parameters for previous recipient */
 #define _CF_DSNENVID	'n'	/* DSN 'MAIL FROM<> ENVID=XXXX' data */
-#define _CF_ERRORADDR	'e'	/* return address for error messages */
-#define _CF_DIAGNOSTIC	'd'	/* diagnostic message for ctlfile offset */
 #define _CF_MSGHEADERS	'm'	/* message header for preceeding recipients */
 #define _CF_MIMESTRUCT	'M'	/* compacted MIME structure data for message */
-#define _CF_LOGIDENT	'l'	/* identification string for log entries */
-#define _CF_OBSOLETES	'x'	/* message id of message obsoleted by this */
-#define _CF_VERBOSE	'v'	/* log file name for verbose log (mail -v) */
-#define	_CF_TURNME	'T'	/* trigger scheduler to attempt delivery now */
-#define _CF_RCVFROM	'F'	/* Where-from we are coming ? */
-
-#define _CF_FORMAT	'@'	/* What format variant are we ?? */
-
-#define _CF_FORMAT_TA_PID	0x00000001 /* At 'r' or 'X' lines */
-#define _CF_FORMAT_DELAY1	0x00000002 /* At 'r' or 'X' lines */
-#define _CF_FORMAT_MIMESTRUCT   0x00000004 /* The 'M' block       */
-#define _CF_FORMAT_KNOWN_SET (_CF_FORMAT_DELAY1|_CF_FORMAT_TA_PID | \
-			      _CF_FORMAT_MIMESTRUCT)
+#define _CF_DIAGNOSTIC	'd'	/* diagnostic message for ctlfile offset */
 
 /* The following characters may appear in the second column after most _CF_* */
 #define	_CFTAG_NORMAL	' '	/* what the router sets it to be */
Index: zmailer/include/mailer.h
diff -u zmailer/include/mailer.h:1.8 zmailer/include/mailer.h:1.9
--- zmailer/include/mailer.h:1.8	Tue Jan 23 01:36:39 2001
+++ zmailer/include/mailer.h	Thu Mar  8 12:12:33 2001
@@ -122,6 +122,7 @@
 	const char	*dsn;
 };
 
+/* NOTE: This structure is constructed at couple of places! */
 struct address {
 	const char	*a_pname;		/* printable representation */
 	struct addr	*a_tokens;		/* RFC822 token list */
@@ -166,6 +167,8 @@
 		Resent,		/* this is a resent- header field */
 		eIdentinfo,	/* identification info		  */
 		eChannel,	/* received by this transport channel (mailer)*/
+		eErrorMsg,	/* Flag-like header telling this is created
+				   by the SCHEDULER for err msgs! */
 		eExternal,	/* external source of info, untrustable */
 		eEnvid,		/* SMTP-DSN ENVID string */
 		eFrom,		/* envelope sender address */
Index: zmailer/include/policy.h
diff -u zmailer/include/policy.h:1.10 zmailer/include/policy.h:1.11
--- zmailer/include/policy.h:1.10	Sun Nov  1 18:47:02 1998
+++ zmailer/include/policy.h	Fri Apr 27 17:44:22 2001
@@ -87,9 +87,10 @@
 #define P_A_TrustWhosOn		21
 #define P_A_RcptDnsRBL		22
 #define P_A_TestRcptDnsRBL	23
+#define P_A_WarnRcptDnsRBL	24
 
 #define P_A_FirstAttr	        2
-#define P_A_LastAttr	        23
+#define P_A_LastAttr	        24
 /* Note: Attribute codes outside range 1..31 cause problems at policystate
          processing!  If you ever need modify these, fix the  policytest.c,
 	 and  policytest.h: struct policystate { char values[]; } array,
@@ -138,7 +139,8 @@
 	"trustrecipients",
 	"trust-whoson",
 	"rcpt-dns-rbl",
-	"test-rcpt-dns-rbl"
+	"test-rcpt-dns-rbl",
+	"warn-rcpt-dns-rbl"
 };
 #define KA(x) ((((x)>0)&&((x)<=P_A_LastAttr))?_KA[(x) & 0xFF]:"??")
 
Index: zmailer/include/sysprotos.h
diff -u zmailer/include/sysprotos.h:1.1.1.1 zmailer/include/sysprotos.h:1.2
--- zmailer/include/sysprotos.h:1.1.1.1	Tue Feb 10 23:01:46 1998
+++ zmailer/include/sysprotos.h	Thu Mar  8 12:12:33 2001
@@ -70,7 +70,6 @@
 extern GETEUID_TYPE geteuid();
 extern int gethostname();
 extern char *getlogin();
-extern int getopt();
 extern int getpeername();
 extern int getpid();
 extern int getppid();
Index: zmailer/include/ta.h
diff -u zmailer/include/ta.h:1.24 zmailer/include/ta.h:1.25
--- zmailer/include/ta.h:1.24	Thu Nov 30 21:15:02 2000
+++ zmailer/include/ta.h	Mon Feb 26 13:44:53 2001
@@ -3,7 +3,7 @@
  *	This will be free software, but only when it is finished.
  */
 /*
- *	A plenty of changes, copyright Matti Aarnio 1990-1999
+ *	A plenty of changes, copyright Matti Aarnio 1990-2001
  */
 
 #ifndef _Z_TA_H_
@@ -60,6 +60,7 @@
 	const char	*inrcpt;	/* "DSN" INRCPT= string */
 	const char	*infrom;	/* "DSN" INFROM= string */
 	const char	*notify;	/*  DSN  NOTIFY= flags  */
+	const char	*ezmlm;		/* "DSN" EZMLM=  string */
 	int		notifyflgs;
 	time_t		deliverby;	/*  RFC 2852  DELIVERBY */
 	int		deliverbyflgs;
Index: zmailer/lib/pwdgrp.c
diff -u zmailer/lib/pwdgrp.c:1.3 zmailer/lib/pwdgrp.c:1.4
--- zmailer/lib/pwdgrp.c:1.3	Tue Jan 23 01:35:10 2001
+++ zmailer/lib/pwdgrp.c	Thu Mar  8 12:12:33 2001
@@ -161,8 +161,10 @@
 	  zgr.gr_name   = gr->gr_name;
 	  zgr.gr_passwd = gr->gr_passwd;
 	  zgr.gr_gid    = gr->gr_gid;
-	  zgr.gr_mem    = gr->gr_mem;
-
+	  zgr.gr_mem    = gr->gr_mem; /* FIXME: This is wrong way to COPY
+					 the thing, we really should copy
+					 the array of pointers, AND the
+					 buffer.. */
 	  return &zgr;
 	}
 
Index: zmailer/lib/skip821address.c
diff -u zmailer/lib/skip821address.c:1.2 zmailer/lib/skip821address.c:1.5
--- zmailer/lib/skip821address.c:1.2	Sun Jan  2 15:55:30 2000
+++ zmailer/lib/skip821address.c	Mon Feb 26 23:46:49 2001
@@ -1,10 +1,10 @@
 /*
  *  skip821address()
  *
- *  Routine to scan over a string representing an RFC-821 address
+ *  Routine to scan over a string representing a VALID RFC-821 address
  *  with embedded white-space in it
  *
- *  Copyright Matti Aarnio 1996
+ *  Copyright Matti Aarnio 1996, 2001
  *
  */
 
@@ -19,6 +19,7 @@
       ++s;
       if (*s == 0)
 	break;
+      continue;
     }
     if (c == quote) /* 'c' is non-zero here */
       quote = 0;
Index: zmailer/libc/getaddrinfo.c
diff -u zmailer/libc/getaddrinfo.c:1.21 zmailer/libc/getaddrinfo.c:1.22
--- zmailer/libc/getaddrinfo.c:1.21	Tue Oct 31 19:49:50 2000
+++ zmailer/libc/getaddrinfo.c	Tue Apr  3 14:45:38 2001
@@ -880,7 +880,7 @@
 	pg = g;
 	i = g->gaih (name, pservice, hints, end, vlog);
 	if (vlog)
-	  fprintf(vlog," g->gaih[%s]('%s',...) rc=%d\n",g->famname,name,i);
+	  fprintf(vlog," g->gaih[%s]('%s',...) rc=0%o\n",g->famname,name,i);
 
 	if (i != 0) {
 	  /* EAI_NODATA is a more specific result as it says that
Index: zmailer/libc/getnameinfo.c
diff -u zmailer/libc/getnameinfo.c:1.10 zmailer/libc/getnameinfo.c:1.12
--- zmailer/libc/getnameinfo.c:1.10	Mon Aug 21 10:30:22 2000
+++ zmailer/libc/getnameinfo.c	Mon Mar 12 11:12:34 2001
@@ -156,10 +156,28 @@
   return domain;
 }
 
+/* This is NASTY, GLIBC has changed the type after instroducing
+   this function, Sol (2.)8 has 'int', of upcoming POSIX standard
+   revision I don't know.. */
 
+#ifndef GETNAMEINFOFLAGTYPE
+# if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+#  if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 2
+	/* I am not sure that it was already 2.2(.0) that had
+	   this change, but 2.2.2 has it... */
+#   define GETNAMEINFOFLAGTYPE unsigned int
+#  else
+#   define GETNAMEINFOFLAGTYPE int
+#  endif
+# else
+#  define GETNAMEINFOFLAGTYPE int
+# endif
+#endif
+
 int
 getnameinfo __((const struct sockaddr *sa, size_t addrlen, char *host,
-		size_t hostlen, char *serv, size_t servlen, int flags));
+		size_t hostlen, char *serv, size_t servlen,
+		GETNAMEINFOFLAGTYPE flags));
 
 int
 getnameinfo (sa, addrlen, host, hostlen, serv, servlen, flags)
@@ -169,7 +187,7 @@
      size_t hostlen;
      char *serv;
      size_t servlen;
-     int flags;
+     GETNAMEINFOFLAGTYPE flags;
 {
   int serrno = errno;
   int ok = 0;
Index: zmailer/libc/getopt.c
diff -u zmailer/libc/getopt.c:1.1.1.1 zmailer/libc/getopt.c:1.3
--- zmailer/libc/getopt.c:1.1.1.1	Tue Feb 10 23:01:46 1998
+++ zmailer/libc/getopt.c	Mon Mar 12 11:12:34 2001
@@ -19,14 +19,14 @@
 #define	putc	fputc
 #endif	/* lint */
 
-char	*optarg;	/* Global argument pointer. */
-int	optind = 1;	/* Global argv index. */
+char	*zoptarg;	/* Global argument pointer. */
+int	zoptind = 1;	/* Global argv index. */
 
 /*
  * N.B. use following at own risk
  */
-int	opterr = 1;	/* for compatibility, should error be printed? */
-int	optopt;		/* for compatibility, option character checked */
+int	zopterr = 1;	/* for compatibility, should error be printed? */
+int	zoptopt;	/* for compatibility, option character checked */
 
 static char	*scan = NULL;	/* Private scan pointer. */
 
@@ -34,7 +34,7 @@
  * Print message about a bad option.  Watch this definition, it's
  * not a single statement.
  */
-#define	BADOPT(mess, ch)	if (opterr) { \
+#define	BADOPT(mess, ch)	if (zopterr) { \
 					extern int fputs(), fputc(); \
 					(void) fputs(argv[0], stderr); \
 					(void) fputs(mess, stderr); \
@@ -44,7 +44,7 @@
 				return('?')
 
 int
-getopt(argc, argv, optstring)
+zgetopt(argc, argv, optstring)
 	int argc;
 	char *const argv[];
 	const char *optstring;
@@ -52,43 +52,49 @@
 	register char c;
 	register const char *place;
 
-	optarg = NULL;
+	zoptarg = NULL;
 
-	if (optind == 1)
+	if (zoptind == 1)
 		scan = NULL;
 	
 	if (scan == NULL || *scan == '\0') {
-		if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0')
+
+		if (zoptind >= argc || argv[zoptind][0] != '-' || argv[zoptind][1] == '\0')
 			return EOF;
-		if (argv[optind][1] == '-' && argv[optind][2] == '\0') {
-			optind++;
+
+		if (argv[zoptind][1] == '-' && argv[zoptind][2] == '\0') {
+			zoptind++;
 			return EOF;
 		}
 	
-		scan = argv[optind]+1;
-		optind++;
+		scan = argv[zoptind]+1;
+		zoptind++;
 	}
 
 	c = *scan++;
-	optopt = c & 0377;
-	for (place = optstring; place != NULL && *place != '\0'; ++place)
+	zoptopt = c & 0377;
+
+	for (place = optstring; place != NULL && *place != '\0'; ++place) {
 		if (*place == c)
 			break;
+		if (place[1] == ':')
+			++place;
+	}
 
-	if (place == NULL || *place == '\0' || c == ':' || c == '?') {
+	if (place == NULL || *place == '\0' || c == '?') {
 		BADOPT(": unknown option -", c);
 	}
 
 	place++;
 	if (*place == ':') {
 		if (*scan != '\0') {
-			optarg = scan;
+			zoptarg = scan;
 			scan = NULL;
-		} else if (optind >= argc) {
+		} else if (zoptind >= argc) {
 			BADOPT(": option requires argument -", c);
 		} else {
-			optarg = argv[optind];
-			optind++;
+			zoptarg = argv[zoptind];
+			zoptind++;
 		}
 	}
 
Index: zmailer/libsh/builtins.c
diff -u zmailer/libsh/builtins.c:1.23 zmailer/libsh/builtins.c:1.24
--- zmailer/libsh/builtins.c:1.23	Tue Jan 23 01:35:11 2001
+++ zmailer/libsh/builtins.c	Thu Mar  8 12:12:33 2001
@@ -990,7 +990,7 @@
 		fprintf(stderr, USAGE_GETOPTS, argv[0]);
 		return 1;
 	}
-	opterr = 0;
+	zopterr = 0;
 	--argc, ++argv;
 	optstring = argv[0];
 	--argc, ++argv;
@@ -1007,14 +1007,14 @@
 			}
 		*av = NULL;
 	}
-	c = getopt(argc, (char*const*)argv,
-		   optstring);	/* this MUST be our getopt() */
-	sprintf(buf, "%d", optind);
+	c = zgetopt(argc, (char*const*)argv,
+		    optstring);	/* this MUST be our getopt() */
+	sprintf(buf, "%d", zoptind);
 	v_set(OPTIND, buf);
 	if (c == EOF)
 		return 1;
-	if (optarg != NULL)	/* our getopt() makes this reliable */
-		v_set(OPTARG, optarg);
+	if (zoptarg != NULL)	/* our zgetopt() makes this reliable */
+		v_set(OPTARG, zoptarg);
 	sprintf(buf, "%c", c);
 	v_set(name, buf);
 	return 0;
Index: zmailer/libsh/interpret.c
diff -u zmailer/libsh/interpret.c:1.32 zmailer/libsh/interpret.c:1.33
--- zmailer/libsh/interpret.c:1.32	Tue Jan 23 01:35:11 2001
+++ zmailer/libsh/interpret.c	Thu Mar  8 12:12:33 2001
@@ -28,6 +28,7 @@
 #include "interpret.h"
 #include "io.h"
 #include "shconfig.h"
+#include "libc.h"
 #include "libz.h"
 #include "libsh.h"
 
@@ -108,8 +109,11 @@
 	const char *str;
 	int   len;
 {
+#ifndef NO_DEQUOTE_AT_SIFTS
 	const char *sp, *ep;
-	char *s, *s0;
+	char *s;
+#endif
+	char *s0;
 
 #ifdef DEQUOTE_STICKY
 	memtypes stickytmp = stickymem;
@@ -1276,7 +1280,7 @@
 #endif	/* MAILER */
 	GCVARS6;
 
-	optind = 0;	/* for getopts */
+	zoptind = 0;	/* for zgetopts() */
 	commandIndex  = -1;
 	command = &commandStack[++commandIndex];
 	command->buffer = NULL;
Index: zmailer/libsh/main.c
diff -u zmailer/libsh/main.c:1.1.1.1 zmailer/libsh/main.c:1.2
--- zmailer/libsh/main.c:1.1.1.1	Tue Feb 10 23:01:47 1998
+++ zmailer/libsh/main.c	Thu Mar  8 12:12:34 2001
@@ -18,9 +18,10 @@
 conscell **return_valuep = 0;
 #endif	/* MAILER */
 
+#include "libc.h"
 #include "libsh.h"
 
-extern int optind;
+extern int zoptind;
 
 int
 main(argc, argv)
@@ -30,7 +31,7 @@
 	/* mal_debug(3); */
 	zshinit(argc, argv);
 	/* mal_leaktrace(1); */
-	trapexit(zshtoplevel(optind < argc ? argv[optind] : (char *)NULL));
+	trapexit(zshtoplevel(zoptind < argc ? argv[zoptind] : (char *)NULL));
 	/* NOTREACHED */
 	return 0;
 }
Index: zmailer/libsh/regex.c
diff -u zmailer/libsh/regex.c:1.5 zmailer/libsh/regex.c:1.6
--- zmailer/libsh/regex.c:1.5	Sun Apr  4 14:42:21 1999
+++ zmailer/libsh/regex.c	Thu Mar  8 11:13:31 2001
@@ -1,159 +1,191 @@
 #include "hostenv.h" /* ZMailer -configuration stuff */
 
+
 /* Extended regular expression matching and search library,
    version 0.12.
-   (Implements POSIX draft P10003.2/D11.2, except for
+   (Implements POSIX draft P1003.2/D11.2, except for some of the
    internationalization features.)
-
-   Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1993-1999, 2000 Free Software Foundation, Inc.
 
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
+   The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* AIX requires this to be the first thing in the file. */
-#if defined (_AIX) && !defined (REGEX_MALLOC)
+#if defined _AIX && !defined REGEX_MALLOC
   #pragma alloca
 #endif
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE 1
-#endif
+#undef	_GNU_SOURCE
+#define _GNU_SOURCE
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+/* #ifdef HAVE_CONFIG_H
+   # include <config.h>
+   #endif
+*/
 
+#ifndef PARAMS
+# if defined __GNUC__ || (defined __STDC__ && __STDC__)
+#  define PARAMS(args) args
+# else
+#  define PARAMS(args) ()
+# endif  /* GCC.  */
+#endif  /* Not PARAMS.  */
+
+#if defined STDC_HEADERS && !defined emacs
+# include <stddef.h>
+#else
 /* We need this for `regex.h', and perhaps for the Emacs include files.  */
-#include <sys/types.h>
+# include <sys/types.h>
+#endif
+
+#define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC)
 
+/* For platform which support the ISO C amendement 1 functionality we
+   support user defined character classes.  */
+#if defined _LIBC || WIDE_CHAR_SUPPORT
+/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.  */
+# include <wchar.h>
+# include <wctype.h>
+#endif
+
+#ifdef _LIBC
+/* We have to keep the namespace clean.  */
+# define regfree(preg) __regfree (preg)
+# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
+# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
+# define regerror(errcode, preg, errbuf, errbuf_size) \
+	__regerror(errcode, preg, errbuf, errbuf_size)
+# define re_set_registers(bu, re, nu, st, en) \
+	__re_set_registers (bu, re, nu, st, en)
+# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
+	__re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
+# define re_match(bufp, string, size, pos, regs) \
+	__re_match (bufp, string, size, pos, regs)
+# define re_search(bufp, string, size, startpos, range, regs) \
+	__re_search (bufp, string, size, startpos, range, regs)
+# define re_compile_pattern(pattern, length, bufp) \
+	__re_compile_pattern (pattern, length, bufp)
+# define re_set_syntax(syntax) __re_set_syntax (syntax)
+# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
+	__re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
+# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
+
+# define btowc __btowc
+
+/* We are also using some library internals.  */
+# include <locale/localeinfo.h>
+# include <locale/elem-hash.h>
+# include <langinfo.h>
+#endif
+
 /* This is for other GNU distributions with internationalized messages.  */
-#if defined(HAVE_LIBINTL_H) || defined (_LIBC)
+#if HAVE_LIBINTL_H || defined _LIBC
 # include <libintl.h>
 #else
 # define gettext(msgid) (msgid)
 #endif
 
+#ifndef gettext_noop
+/* This define is so xgettext can find the internationalizable
+   strings.  */
+# define gettext_noop(String) String
+#endif
+
 /* The `emacs' switch turns on certain matching commands
    that make sense only in Emacs. */
 #ifdef emacs
 
-#include "lisp.h"
-#include "buffer.h"
-#include "syntax.h"
+# include "lisp.h"
+# include "buffer.h"
+# include "syntax.h"
 
 #else  /* not emacs */
 
 /* If we are not linking with Emacs proper,
    we can't use the relocating allocator
    even if config.h says that we can.  */
-#undef REL_ALLOC
+# undef REL_ALLOC
 
-#if defined (STDC_HEADERS) || defined (_LIBC)
-#include <stdlib.h>
-#else
+# if defined STDC_HEADERS || defined _LIBC
+#  include <stdlib.h>
+# else
 char *malloc ();
 char *realloc ();
-#endif
+# endif
 
 /* When used in Emacs's lib-src, we need to get bzero and bcopy somehow.
    If nothing else has been done, use the method below.  */
-#ifdef INHIBIT_STRING_HEADER
-#if !(defined (HAVE_BZERO) && defined (HAVE_BCOPY))
-#if !defined (bzero) && !defined (bcopy)
-#undef INHIBIT_STRING_HEADER
-#endif
-#endif
-#endif
+# ifdef INHIBIT_STRING_HEADER
+#  if !(defined HAVE_BZERO && defined HAVE_BCOPY)
+#   if !defined bzero && !defined bcopy
+#    undef INHIBIT_STRING_HEADER
+#   endif
+#  endif
+# endif
 
 /* This is the normal way of making sure we have a bcopy and a bzero.
    This is used in most programs--a few other programs avoid this
    by defining INHIBIT_STRING_HEADER.  */
-#ifndef INHIBIT_STRING_HEADER
-#if defined (HAVE_STRING_H) || defined (STDC_HEADERS) || defined (_LIBC)
-#include <string.h>
-#ifndef bcmp
-#define bcmp(s1, s2, n)	memcmp ((s1), (s2), (n))
-#endif
-#ifndef bcopy
-#define bcopy(s, d, n)	memcpy ((d), (s), (n))
-#endif
-#ifndef bzero
-#define bzero(s, n)	memset ((s), 0, (n))
-#endif
-#else
-#include <strings.h>
-#endif
-#endif
+# ifndef INHIBIT_STRING_HEADER
+#  if defined HAVE_STRING_H || defined STDC_HEADERS || defined _LIBC
+#   include <string.h>
+#   ifndef bzero
+#    ifndef _LIBC
+#     define bzero(s, n)	(memset (s, '\0', n), (s))
+#    else
+#     define bzero(s, n)	__bzero (s, n)
+#    endif
+#   endif
+#  else
+#   include <strings.h>
+#   ifndef memcmp
+#    define memcmp(s1, s2, n)	bcmp (s1, s2, n)
+#   endif
+#   ifndef memcpy
+#    define memcpy(d, s, n)	(bcopy (s, d, n), (d))
+#   endif
+#  endif
+# endif
 
 /* Define the syntax stuff for \<, \>, etc.  */
 
 /* This must be nonzero for the wordchar and notwordchar pattern
    commands in re_match_2.  */
-#ifndef Sword 
-#define Sword 1
-#endif
+# ifndef Sword
+#  define Sword 1
+# endif
+
+# ifdef SWITCH_ENUM_BUG
+#  define SWITCH_ENUM_CAST(x) ((int)(x))
+# else
+#  define SWITCH_ENUM_CAST(x) (x)
+# endif
 
-#ifdef SWITCH_ENUM_BUG
-#define SWITCH_ENUM_CAST(x) ((int)(x))
-#else
-#define SWITCH_ENUM_CAST(x) (x)
-#endif
-
-#ifdef SYNTAX_TABLE
-
-extern char *re_syntax_table;
-
-#else /* not SYNTAX_TABLE */
-
-/* How many characters in the character set.  */
-#define CHAR_SET_SIZE 256
-
-static char re_syntax_table[CHAR_SET_SIZE];
-
-static void
-init_syntax_once ()
-{
-   register int c;
-   static int done = 0;
-
-   if (done)
-     return;
-
-   bzero (re_syntax_table, sizeof re_syntax_table);
-
-   for (c = 'a'; c <= 'z'; c++)
-     re_syntax_table[c] = Sword;
-
-   for (c = 'A'; c <= 'Z'; c++)
-     re_syntax_table[c] = Sword;
-
-   for (c = '0'; c <= '9'; c++)
-     re_syntax_table[c] = Sword;
-
-   re_syntax_table['_'] = Sword;
-
-   done = 1;
-}
-
-#endif /* not SYNTAX_TABLE */
+#endif /* not emacs */
 
-#define SYNTAX(c) re_syntax_table[c]
+#if defined _LIBC || HAVE_LIMITS_H
+# include <limits.h>
+#endif
 
-#endif /* not emacs */
+#ifndef MB_LEN_MAX
+# define MB_LEN_MAX 1
+#endif
 
 /* Get the interface, including the syntax bits.  */
-#include "regex.h"
+/* #include <regex.h> */
+#include "regex.h" /* local file at this directory! */
 
 /* isalpha etc. are used for the character classes.  */
 #include <ctype.h>
@@ -167,25 +199,28 @@
    STDC_HEADERS is defined, then autoconf has verified that the ctype
    macros don't need to be guarded with references to isascii. ...
    Defining isascii to 1 should let any compiler worth its salt
-   eliminate the && through constant folding."  */
+   eliminate the && through constant folding."
+   Solaris defines some of these symbols so we must undefine them first.  */
 
-#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
-#define ISASCII(c) 1
+#undef ISASCII
+#if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII)
+# define ISASCII(c) 1
 #else
-#define ISASCII(c) isascii(c)
+# define ISASCII(c) isascii(c)
 #endif
 
 #ifdef isblank
-#define ISBLANK(c) (ISASCII (c) && isblank (c))
+# define ISBLANK(c) (ISASCII (c) && isblank (c))
 #else
-#define ISBLANK(c) ((c) == ' ' || (c) == '\t')
+# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
 #endif
 #ifdef isgraph
-#define ISGRAPH(c) (ISASCII (c) && isgraph (c))
+# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
 #else
-#define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
+# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
 #endif
 
+#undef ISPRINT
 #define ISPRINT(c) (ISASCII (c) && isprint (c))
 #define ISDIGIT(c) (ISASCII (c) && isdigit (c))
 #define ISALNUM(c) (ISASCII (c) && isalnum (c))
@@ -197,8 +232,14 @@
 #define ISUPPER(c) (ISASCII (c) && isupper (c))
 #define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
 
+#ifdef _tolower
+# define TOLOWER(c) _tolower(c)
+#else
+# define TOLOWER(c) tolower(c)
+#endif
+
 #ifndef NULL
-#define NULL (void *)0
+# define NULL (void *)0
 #endif
 
 /* We remove any previous definition of `SIGN_EXTEND_CHAR',
@@ -207,94 +248,122 @@
    (Per Bothner suggested the basic approach.)  */
 #undef SIGN_EXTEND_CHAR
 #if __STDC__
-#define SIGN_EXTEND_CHAR(c) ((signed char) (c))
+# define SIGN_EXTEND_CHAR(c) ((signed char) (c))
 #else  /* not __STDC__ */
 /* As in Harbison and Steele.  */
-#define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
+# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
 #endif
 
+#ifndef emacs
+/* How many characters in the character set.  */
+# define CHAR_SET_SIZE 256
+
+# ifdef SYNTAX_TABLE
+
+extern char *re_syntax_table;
+
+# else /* not SYNTAX_TABLE */
+
+static char re_syntax_table[CHAR_SET_SIZE];
+
+static void
+init_syntax_once ()
+{
+   register int c;
+   static int done = 0;
+
+   if (done)
+     return;
+   bzero (re_syntax_table, sizeof re_syntax_table);
+
+   for (c = 0; c < CHAR_SET_SIZE; ++c)
+     if (ISALNUM (c))
+	re_syntax_table[c] = Sword;
+
+   re_syntax_table['_'] = Sword;
+
+   done = 1;
+}
+
+# endif /* not SYNTAX_TABLE */
+
+# define SYNTAX(c) re_syntax_table[(unsigned char) (c)]
+
+#endif /* emacs */
+
 /* Should we use malloc or alloca?  If REGEX_MALLOC is not defined, we
    use `alloca' instead of `malloc'.  This is because using malloc in
    re_search* or re_match* could cause memory leaks when C-g is used in
    Emacs; also, malloc is slower and causes storage fragmentation.  On
-   the other hand, malloc is more portable, and easier to debug.  
-   
+   the other hand, malloc is more portable, and easier to debug.
+
    Because we sometimes use alloca, some routines have to be macros,
    not functions -- `alloca'-allocated space disappears at the end of the
    function it is called in.  */
 
 #ifdef REGEX_MALLOC
 
-#define REGEX_ALLOCATE malloc
-#define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
-#define REGEX_FREE free
+# define REGEX_ALLOCATE malloc
+# define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
+# define REGEX_FREE free
 
 #else /* not REGEX_MALLOC  */
 
 /* Emacs already defines alloca, sometimes.  */
-#ifndef alloca
+# ifndef alloca
 
 /* Make alloca work the best possible way.  */
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#else /* not __GNUC__ */
-#if HAVE_ALLOCA_H
-#include <alloca.h>
-#else /* not __GNUC__ or HAVE_ALLOCA_H */
-#ifndef _AIX /* Already did AIX, up at the top.  */
-#if defined (__STDC__) && __STDC__
-void *alloca ();
-#else
-char *alloca ();
-#endif
-#endif /* not _AIX */
-#endif /* not HAVE_ALLOCA_H */ 
-#endif /* not __GNUC__ */
+#  ifdef __GNUC__
+#   define alloca __builtin_alloca
+#  else /* not __GNUC__ */
+#   if HAVE_ALLOCA_H
+#    include <alloca.h>
+#   endif /* HAVE_ALLOCA_H */
+#  endif /* not __GNUC__ */
 
-#endif /* not alloca */
+# endif /* not alloca */
 
-#define REGEX_ALLOCATE alloca
+# define REGEX_ALLOCATE alloca
 
 /* Assumes a `char *destination' variable.  */
-#define REGEX_REALLOCATE(source, osize, nsize)				\
+# define REGEX_REALLOCATE(source, osize, nsize)				\
   (destination = (char *) alloca (nsize),				\
-   bcopy (source, destination, osize),					\
-   destination)
+   memcpy (destination, source, osize))
 
 /* No need to do anything to free, after alloca.  */
-#define REGEX_FREE(arg) ((void)0) /* Do nothing!  But inhibit gcc warning.  */
+# define REGEX_FREE(arg) ((void)0) /* Do nothing!  But inhibit gcc warning.  */
 
 #endif /* not REGEX_MALLOC */
 
 /* Define how to allocate the failure stack.  */
 
-#if defined (REL_ALLOC) && defined (REGEX_MALLOC)
+#if defined REL_ALLOC && defined REGEX_MALLOC
 
-#define REGEX_ALLOCATE_STACK(size)				\
+# define REGEX_ALLOCATE_STACK(size)				\
   r_alloc (&failure_stack_ptr, (size))
-#define REGEX_REALLOCATE_STACK(source, osize, nsize)		\
+# define REGEX_REALLOCATE_STACK(source, osize, nsize)		\
   r_re_alloc (&failure_stack_ptr, (nsize))
-#define REGEX_FREE_STACK(ptr)					\
+# define REGEX_FREE_STACK(ptr)					\
   r_alloc_free (&failure_stack_ptr)
 
 #else /* not using relocating allocator */
 
-#ifdef REGEX_MALLOC
+# ifdef REGEX_MALLOC
 
-#define REGEX_ALLOCATE_STACK malloc
-#define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize)
-#define REGEX_FREE_STACK free
+#  define REGEX_ALLOCATE_STACK malloc
+#  define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize)
+#  define REGEX_FREE_STACK free
 
-#else /* not REGEX_MALLOC */
+# else /* not REGEX_MALLOC */
 
-#define REGEX_ALLOCATE_STACK alloca
+#  define REGEX_ALLOCATE_STACK alloca
 
-#define REGEX_REALLOCATE_STACK(source, osize, nsize)			\
+#  define REGEX_REALLOCATE_STACK(source, osize, nsize)			\
    REGEX_REALLOCATE (source, osize, nsize)
 /* No need to explicitly free anything.  */
-#define REGEX_FREE_STACK(arg)
+#  define REGEX_FREE_STACK(arg)
 
-#endif /* not REGEX_MALLOC */
+# endif /* not REGEX_MALLOC */
 #endif /* not using relocating allocator */
 
 
@@ -324,7 +393,12 @@
 #define false 0
 #define true 1
 
-static int re_match_2_internal ();
+static int re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp,
+					const char *string1, int size1,
+					const char *string2, int size2,
+					int pos,
+					struct re_registers *regs,
+					int stop));
 
 /* These are the command codes that appear in compiled regular
    expressions.  Some opcodes are followed by argument bytes.  A
@@ -390,9 +464,9 @@
 
         /* Analogously, for end of buffer/string.  */
   endbuf,
- 
+
         /* Followed by two byte relative address to which to jump.  */
-  jump, 
+  jump,
 
 	/* Same as jump, but marks the end of an alternative.  */
   jump_past_alt,
@@ -400,11 +474,11 @@
         /* Followed by two-byte relative address of place to resume at
            in case of failure.  */
   on_failure_jump,
-	
+
         /* Like on_failure_jump, but pushes a placeholder instead of the
            current string position when executed.  */
   on_failure_keep_string_jump,
-  
+
         /* Throw away latest failure point and then jump to following
            two-byte relative address.  */
   pop_failure_jump,
@@ -495,20 +569,21 @@
   } while (0)
 
 #ifdef DEBUG
+static void extract_number _RE_ARGS ((int *dest, unsigned char *source));
 static void
 extract_number (dest, source)
     int *dest;
     unsigned char *source;
 {
-  int temp = SIGN_EXTEND_CHAR (*(source + 1)); 
+  int temp = SIGN_EXTEND_CHAR (*(source + 1));
   *dest = *source & 0377;
   *dest += temp << 8;
 }
 
-#ifndef EXTRACT_MACROS /* To debug the macros.  */
-#undef EXTRACT_NUMBER
-#define EXTRACT_NUMBER(dest, src) extract_number (&dest, src)
-#endif /* not EXTRACT_MACROS */
+# ifndef EXTRACT_MACROS /* To debug the macros.  */
+#  undef EXTRACT_NUMBER
+#  define EXTRACT_NUMBER(dest, src) extract_number (&dest, src)
+# endif /* not EXTRACT_MACROS */
 
 #endif /* DEBUG */
 
@@ -522,20 +597,22 @@
   } while (0)
 
 #ifdef DEBUG
+static void extract_number_and_incr _RE_ARGS ((int *destination,
+					       unsigned char **source));
 static void
 extract_number_and_incr (destination, source)
     int *destination;
     unsigned char **source;
-{ 
+{
   extract_number (destination, *source);
   *source += 2;
 }
 
-#ifndef EXTRACT_MACROS
-#undef EXTRACT_NUMBER_AND_INCR
-#define EXTRACT_NUMBER_AND_INCR(dest, src) \
+# ifndef EXTRACT_MACROS
+#  undef EXTRACT_NUMBER_AND_INCR
+#  define EXTRACT_NUMBER_AND_INCR(dest, src) \
   extract_number_and_incr (&dest, &src)
-#endif /* not EXTRACT_MACROS */
+# endif /* not EXTRACT_MACROS */
 
 #endif /* DEBUG */
 
@@ -548,33 +625,33 @@
 #ifdef DEBUG
 
 /* We use standard I/O for debugging.  */
-#include <stdio.h>
+# include <stdio.h>
 
 /* It is useful to test things that ``must'' be true when debugging.  */
-#include <assert.h>
+# include <assert.h>
 
-static int debug = 0;
+static int debug;
 
-#define DEBUG_STATEMENT(e) e
-#define DEBUG_PRINT1(x) if (debug) printf (x)
-#define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2)
-#define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3)
-#define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4)
-#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) 				\
+# define DEBUG_STATEMENT(e) e
+# define DEBUG_PRINT1(x) if (debug) printf (x)
+# define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2)
+# define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3)
+# define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4)
+# define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) 				\
   if (debug) print_partial_compiled_pattern (s, e)
-#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)			\
+# define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)			\
   if (debug) print_double_string (w, s1, sz1, s2, sz2)
 
 
 /* Print the fastmap in human-readable form.  */
 
-static void
+void
 print_fastmap (fastmap)
     char *fastmap;
 {
   unsigned was_a_range = 0;
-  unsigned i = 0;  
-  
+  unsigned i = 0;
+
   while (i < (1 << BYTEWIDTH))
     {
       if (fastmap[i++])
@@ -593,7 +670,7 @@
             }
         }
     }
-  putchar ('\n'); 
+  putchar ('\n');
 }
 
 
@@ -606,6 +683,7 @@
     unsigned char *end;
 {
   int mcnt, mcnt2;
+  unsigned char *p1;
   unsigned char *p = start;
   unsigned char *pend = end;
 
@@ -614,11 +692,15 @@
       printf ("(null)\n");
       return;
     }
-    
+
   /* Loop over pattern commands.  */
   while (p < pend)
     {
-      printf ("%d:\t", p - start);
+#ifdef _LIBC
+      printf ("%t:\t", p - start);
+#else
+      printf ("%ld:\t", (long int) (p - start));
+#endif
 
       switch ((re_opcode_t) *p++)
 	{
@@ -663,7 +745,7 @@
 
 	    printf ("/charset [%s",
 	            (re_opcode_t) *(p - 1) == charset_not ? "^" : "");
-            
+
             assert (p + *p < pend);
 
             for (c = 0; c < 256; c++)
@@ -682,7 +764,7 @@
 		      putchar (last);
 		      in_range = 0;
 		    }
-                
+
 		  if (! in_range)
 		    putchar (c);
 
@@ -708,61 +790,103 @@
 
 	case on_failure_jump:
           extract_number_and_incr (&mcnt, &p);
-  	  printf ("/on_failure_jump to %d", p + mcnt - start);
+#ifdef _LIBC
+  	  printf ("/on_failure_jump to %t", p + mcnt - start);
+#else
+  	  printf ("/on_failure_jump to %ld", (long int) (p + mcnt - start));
+#endif
           break;
 
 	case on_failure_keep_string_jump:
           extract_number_and_incr (&mcnt, &p);
-  	  printf ("/on_failure_keep_string_jump to %d", p + mcnt - start);
+#ifdef _LIBC
+  	  printf ("/on_failure_keep_string_jump to %t", p + mcnt - start);
+#else
+  	  printf ("/on_failure_keep_string_jump to %ld",
+		  (long int) (p + mcnt - start));
+#endif
           break;
 
 	case dummy_failure_jump:
           extract_number_and_incr (&mcnt, &p);
-  	  printf ("/dummy_failure_jump to %d", p + mcnt - start);
+#ifdef _LIBC
+  	  printf ("/dummy_failure_jump to %t", p + mcnt - start);
+#else
+  	  printf ("/dummy_failure_jump to %ld", (long int) (p + mcnt - start));
+#endif
           break;
 
 	case push_dummy_failure:
           printf ("/push_dummy_failure");
           break;
-          
+
         case maybe_pop_jump:
           extract_number_and_incr (&mcnt, &p);
-  	  printf ("/maybe_pop_jump to %d", p + mcnt - start);
+#ifdef _LIBC
+  	  printf ("/maybe_pop_jump to %t", p + mcnt - start);
+#else
+  	  printf ("/maybe_pop_jump to %ld", (long int) (p + mcnt - start));
+#endif
 	  break;
 
         case pop_failure_jump:
 	  extract_number_and_incr (&mcnt, &p);
-  	  printf ("/pop_failure_jump to %d", p + mcnt - start);
-	  break;          
-          
+#ifdef _LIBC
+  	  printf ("/pop_failure_jump to %t", p + mcnt - start);
+#else
+  	  printf ("/pop_failure_jump to %ld", (long int) (p + mcnt - start));
+#endif
+	  break;
+
         case jump_past_alt:
 	  extract_number_and_incr (&mcnt, &p);
-  	  printf ("/jump_past_alt to %d", p + mcnt - start);
-	  break;          
-          
+#ifdef _LIBC
+  	  printf ("/jump_past_alt to %t", p + mcnt - start);
+#else
+  	  printf ("/jump_past_alt to %ld", (long int) (p + mcnt - start));
+#endif
+	  break;
+
         case jump:
 	  extract_number_and_incr (&mcnt, &p);
-  	  printf ("/jump to %d", p + mcnt - start);
+#ifdef _LIBC
+  	  printf ("/jump to %t", p + mcnt - start);
+#else
+  	  printf ("/jump to %ld", (long int) (p + mcnt - start));
+#endif
 	  break;
 
-        case succeed_n: 
+        case succeed_n:
           extract_number_and_incr (&mcnt, &p);
+	  p1 = p + mcnt;
           extract_number_and_incr (&mcnt2, &p);
-	  printf ("/succeed_n to %d, %d times", p + mcnt - start, mcnt2);
+#ifdef _LIBC
+	  printf ("/succeed_n to %t, %d times", p1 - start, mcnt2);
+#else
+	  printf ("/succeed_n to %ld, %d times",
+		  (long int) (p1 - start), mcnt2);
+#endif
           break;
-        
-        case jump_n: 
+
+        case jump_n:
           extract_number_and_incr (&mcnt, &p);
+	  p1 = p + mcnt;
           extract_number_and_incr (&mcnt2, &p);
-	  printf ("/jump_n to %d, %d times", p + mcnt - start, mcnt2);
+	  printf ("/jump_n to %d, %d times", p1 - start, mcnt2);
           break;
-        
-        case set_number_at: 
+
+        case set_number_at:
           extract_number_and_incr (&mcnt, &p);
+	  p1 = p + mcnt;
           extract_number_and_incr (&mcnt2, &p);
-	  printf ("/set_number_at location %d to %d", p + mcnt - start, mcnt2);
+#ifdef _LIBC
+	  printf ("/set_number_at location %t to %d", p1 - start, mcnt2);
+#else
+	  printf ("/set_number_at location %ld to %d",
+		  (long int) (p1 - start), mcnt2);
+#endif
           break;
-        
+
         case wordbound:
 	  printf ("/wordbound");
 	  break;
@@ -774,11 +898,11 @@
 	case wordbeg:
 	  printf ("/wordbeg");
 	  break;
-          
+
 	case wordend:
 	  printf ("/wordend");
-          
-#ifdef emacs
+
+# ifdef emacs
 	case before_dot:
 	  printf ("/before_dot");
           break;
@@ -796,18 +920,18 @@
 	  mcnt = *p++;
 	  printf ("/%d", mcnt);
           break;
-	  
+
 	case notsyntaxspec:
           printf ("/notsyntaxspec");
 	  mcnt = *p++;
 	  printf ("/%d", mcnt);
 	  break;
-#endif /* emacs */
+# endif /* emacs */
 
 	case wordchar:
 	  printf ("/wordchar");
           break;
-	  
+
 	case notwordchar:
 	  printf ("/notwordchar");
           break;
@@ -827,7 +951,11 @@
       putchar ('\n');
     }
 
-  printf ("%d:\tend of pattern.\n", p - start);
+#ifdef _LIBC
+  printf ("%t:\tend of pattern.\n", p - start);
+#else
+  printf ("%ld:\tend of pattern.\n", (long int) (p - start));
+#endif
 }
 
 
@@ -838,7 +966,8 @@
   unsigned char *buffer = bufp->buffer;
 
   print_partial_compiled_pattern (buffer, buffer + bufp->used);
-  printf ("%d bytes used/%d bytes allocated.\n", bufp->used, bufp->allocated);
+  printf ("%ld bytes used/%ld bytes allocated.\n",
+	  bufp->used, bufp->allocated);
 
   if (bufp->fastmap_accurate && bufp->fastmap)
     {
@@ -846,14 +975,18 @@
       print_fastmap (bufp->fastmap);
     }
 
-  printf ("re_nsub: %d\t", bufp->re_nsub);
+#ifdef _LIBC
+  printf ("re_nsub: %Zd\t", bufp->re_nsub);
+#else
+  printf ("re_nsub: %ld\t", (long int) bufp->re_nsub);
+#endif
   printf ("regs_alloc: %d\t", bufp->regs_allocated);
   printf ("can_be_null: %d\t", bufp->can_be_null);
   printf ("newline_anchor: %d\n", bufp->newline_anchor);
   printf ("no_sub: %d\t", bufp->no_sub);
   printf ("not_bol: %d\t", bufp->not_bol);
   printf ("not_eol: %d\t", bufp->not_eol);
-  printf ("syntax: %d\n", bufp->syntax);
+  printf ("syntax: %lx\n", bufp->syntax);
   /* Perhaps we should print the translate table?  */
 }
 
@@ -866,8 +999,8 @@
     int size1;
     int size2;
 {
-  unsigned this_char;
-  
+  int this_char;
+
   if (where == NULL)
     printf ("(null)");
   else
@@ -877,7 +1010,7 @@
           for (this_char = where - string1; this_char < size1; this_char++)
             putchar (string1[this_char]);
 
-          where = string2;    
+          where = string2;
         }
 
       for (this_char = where - string2; this_char < size2; this_char++)
@@ -885,18 +1018,25 @@
     }
 }
 
+void
+printchar (c)
+     int c;
+{
+  putc (c, stderr);
+}
+
 #else /* not DEBUG */
 
-#undef assert
-#define assert(e)
+# undef assert
+# define assert(e)
 
-#define DEBUG_STATEMENT(e)
-#define DEBUG_PRINT1(x)
-#define DEBUG_PRINT2(x1, x2)
-#define DEBUG_PRINT3(x1, x2, x3)
-#define DEBUG_PRINT4(x1, x2, x3, x4)
-#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
-#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
+# define DEBUG_STATEMENT(e)
+# define DEBUG_PRINT1(x)
+# define DEBUG_PRINT2(x1, x2)
+# define DEBUG_PRINT3(x1, x2, x3)
+# define DEBUG_PRINT4(x1, x2, x3, x4)
+# define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
+# define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
 
 #endif /* not DEBUG */
 
@@ -920,34 +1060,98 @@
     reg_syntax_t syntax;
 {
   reg_syntax_t ret = re_syntax_options;
-  
+
   re_syntax_options = syntax;
+#ifdef DEBUG
+  if (syntax & RE_DEBUG)
+    debug = 1;
+  else if (debug) /* was on but now is not */
+    debug = 0;
+#endif /* DEBUG */
   return ret;
 }
+#ifdef _LIBC
+weak_alias (__re_set_syntax, re_set_syntax)
+#endif
 
 /* This table gives an error message for each of the error codes listed
    in regex.h.  Obviously the order here has to be same as there.
    POSIX doesn't require that we do anything for REG_NOERROR,
    but why not be nice?  */
+
+static const char re_error_msgid[] =
+  {
+#define REG_NOERROR_IDX	0
+    gettext_noop ("Success")	/* REG_NOERROR */
+    "\0"
+#define REG_NOMATCH_IDX (REG_NOERROR_IDX + sizeof "Success")
+    gettext_noop ("No match")	/* REG_NOMATCH */
+    "\0"
+#define REG_BADPAT_IDX	(REG_NOMATCH_IDX + sizeof "No match")
+    gettext_noop ("Invalid regular expression") /* REG_BADPAT */
+    "\0"
+#define REG_ECOLLATE_IDX (REG_BADPAT_IDX + sizeof "Invalid regular expression")
+    gettext_noop ("Invalid collation character") /* REG_ECOLLATE */
+    "\0"
+#define REG_ECTYPE_IDX	(REG_ECOLLATE_IDX + sizeof "Invalid collation character")
+    gettext_noop ("Invalid character class name") /* REG_ECTYPE */
+    "\0"
+#define REG_EESCAPE_IDX	(REG_ECTYPE_IDX + sizeof "Invalid character class name")
+    gettext_noop ("Trailing backslash") /* REG_EESCAPE */
+    "\0"
+#define REG_ESUBREG_IDX	(REG_EESCAPE_IDX + sizeof "Trailing backslash")
+    gettext_noop ("Invalid back reference") /* REG_ESUBREG */
+    "\0"
+#define REG_EBRACK_IDX	(REG_ESUBREG_IDX + sizeof "Invalid back reference")
+    gettext_noop ("Unmatched [ or [^")	/* REG_EBRACK */
+    "\0"
+#define REG_EPAREN_IDX	(REG_EBRACK_IDX + sizeof "Unmatched [ or [^")
+    gettext_noop ("Unmatched ( or \\(") /* REG_EPAREN */
+    "\0"
+#define REG_EBRACE_IDX	(REG_EPAREN_IDX + sizeof "Unmatched ( or \\(")
+    gettext_noop ("Unmatched \\{") /* REG_EBRACE */
+    "\0"
+#define REG_BADBR_IDX	(REG_EBRACE_IDX + sizeof "Unmatched \\{")
+    gettext_noop ("Invalid content of \\{\\}") /* REG_BADBR */
+    "\0"
+#define REG_ERANGE_IDX	(REG_BADBR_IDX + sizeof "Invalid content of \\{\\}")
+    gettext_noop ("Invalid range end")	/* REG_ERANGE */
+    "\0"
+#define REG_ESPACE_IDX	(REG_ERANGE_IDX + sizeof "Invalid range end")
+    gettext_noop ("Memory exhausted") /* REG_ESPACE */
+    "\0"
+#define REG_BADRPT_IDX	(REG_ESPACE_IDX + sizeof "Memory exhausted")
+    gettext_noop ("Invalid preceding regular expression") /* REG_BADRPT */
+    "\0"
+#define REG_EEND_IDX	(REG_BADRPT_IDX + sizeof "Invalid preceding regular expression")
+    gettext_noop ("Premature end of regular expression") /* REG_EEND */
+    "\0"
+#define REG_ESIZE_IDX	(REG_EEND_IDX + sizeof "Premature end of regular expression")
+    gettext_noop ("Regular expression too big") /* REG_ESIZE */
+    "\0"
+#define REG_ERPAREN_IDX	(REG_ESIZE_IDX + sizeof "Regular expression too big")
+    gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */
+  };
 
-static const char *re_error_msgid[] =
-  { "Success",					/* REG_NOERROR */
-    "No match",					/* REG_NOMATCH */
-    "Invalid regular expression",		/* REG_BADPAT */
-    "Invalid collation character",		/* REG_ECOLLATE */
-    "Invalid character class name",		/* REG_ECTYPE */
-    "Trailing backslash",			/* REG_EESCAPE */
-    "Invalid back reference",			/* REG_ESUBREG */
-    "Unmatched [ or [^",			/* REG_EBRACK */
-    "Unmatched ( or \\(",			/* REG_EPAREN */
-    "Unmatched \\{",				/* REG_EBRACE */
-    "Invalid content of \\{\\}",		/* REG_BADBR */
-    "Invalid range end",			/* REG_ERANGE */
-    "Memory exhausted",				/* REG_ESPACE */
-    "Invalid preceding regular expression",	/* REG_BADRPT */
-    "Premature end of regular expression",	/* REG_EEND */
-    "Regular expression too big",		/* REG_ESIZE */
-    "Unmatched ) or \\)",			/* REG_ERPAREN */
+static const size_t re_error_msgid_idx[] =
+  {
+    REG_NOERROR_IDX,
+    REG_NOMATCH_IDX,
+    REG_BADPAT_IDX,
+    REG_ECOLLATE_IDX,
+    REG_ECTYPE_IDX,
+    REG_EESCAPE_IDX,
+    REG_ESUBREG_IDX,
+    REG_EBRACK_IDX,
+    REG_EPAREN_IDX,
+    REG_EBRACE_IDX,
+    REG_BADBR_IDX,
+    REG_ERANGE_IDX,
+    REG_ESPACE_IDX,
+    REG_BADRPT_IDX,
+    REG_EEND_IDX,
+    REG_ESIZE_IDX,
+    REG_ERPAREN_IDX
   };
 
 /* Avoiding alloca during matching, to placate r_alloc.  */
@@ -960,7 +1164,7 @@
    ralloc heap) shift the data out from underneath the regexp
    routines.
 
-   Here's another reason to avoid allocation: Emacs 
+   Here's another reason to avoid allocation: Emacs
    processes input from X in a signal handler; processing X input may
    call malloc; if input arrives while a matching routine is calling
    malloc, then we're scrod.  But Emacs can't just block input while
@@ -975,7 +1179,7 @@
 /* When using GNU C, we are not REALLY using the C alloca, no matter
    what config.h may say.  So don't take precautions for it.  */
 #ifdef __GNUC__
-#undef C_ALLOCA
+# undef C_ALLOCA
 #endif
 
 /* The match routines may not allocate if (1) they would do it with malloc
@@ -983,32 +1187,62 @@
    Note that if REL_ALLOC is defined, matching would not use malloc for the
    failure stack, but we would still use it for the register vectors;
    so REL_ALLOC should not affect this.  */
-#if (defined (C_ALLOCA) || defined (REGEX_MALLOC)) && defined (emacs)
-#undef MATCH_MAY_ALLOCATE
+#if (defined C_ALLOCA || defined REGEX_MALLOC) && defined emacs
+# undef MATCH_MAY_ALLOCATE
 #endif
 
 
 /* Failure stack declarations and macros; both re_compile_fastmap and
    re_match_2 use a failure stack.  These have to be macros because of
    REGEX_ALLOCATE_STACK.  */
-   
+
 
 /* Number of failure points for which to initially allocate space
    when matching.  If this number is exceeded, we allocate more
    space, so it is not a hard limit.  */
 #ifndef INIT_FAILURE_ALLOC
-#define INIT_FAILURE_ALLOC 5
+# define INIT_FAILURE_ALLOC 5
 #endif
 
 /* Roughly the maximum number of failure points on the stack.  Would be
-   exactly that if always used MAX_FAILURE_SPACE each time we failed.
+   exactly that if always used MAX_FAILURE_ITEMS items each time we failed.
    This is a variable only so users of regex can assign to it; we never
    change it ourselves.  */
-#if defined (MATCH_MAY_ALLOCATE)
-int re_max_failures = 200000;
-#else
+
+#ifdef INT_IS_16BIT
+
+# if defined MATCH_MAY_ALLOCATE
+/* 4400 was enough to cause a crash on Alpha OSF/1,
+   whose default stack limit is 2mb.  */
+long int re_max_failures = 4000;
+# else
+long int re_max_failures = 2000;
+# endif
+
+union fail_stack_elt
+{
+  unsigned char *pointer;
+  long int integer;
+};
+
+typedef union fail_stack_elt fail_stack_elt_t;
+
+typedef struct
+{
+  fail_stack_elt_t *stack;
+  unsigned long int size;
+  unsigned long int avail;		/* Offset of next open position.  */
+} fail_stack_type;
+
+#else /* not INT_IS_16BIT */
+
+# if defined MATCH_MAY_ALLOCATE
+/* 4400 was enough to cause a crash on Alpha OSF/1,
+   whose default stack limit is 2mb.  */
+int re_max_failures = 4000;
+# else
 int re_max_failures = 2000;
-#endif
+# endif
 
 union fail_stack_elt
 {
@@ -1025,6 +1259,8 @@
   unsigned avail;			/* Offset of next open position.  */
 } fail_stack_type;
 
+#endif /* INT_IS_16BIT */
+
 #define FAIL_STACK_EMPTY()     (fail_stack.avail == 0)
 #define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0)
 #define FAIL_STACK_FULL()      (fail_stack.avail == fail_stack.size)
@@ -1034,10 +1270,10 @@
    Do `return -2' if the alloc fails.  */
 
 #ifdef MATCH_MAY_ALLOCATE
-#define INIT_FAIL_STACK()						\
+# define INIT_FAIL_STACK()						\
   do {									\
     fail_stack.stack = (fail_stack_elt_t *)				\
-      REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t));	\
+      REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \
 									\
     if (fail_stack.stack == NULL)					\
       return -2;							\
@@ -1046,26 +1282,26 @@
     fail_stack.avail = 0;						\
   } while (0)
 
-#define RESET_FAIL_STACK()  REGEX_FREE_STACK (fail_stack.stack)
+# define RESET_FAIL_STACK()  REGEX_FREE_STACK (fail_stack.stack)
 #else
-#define INIT_FAIL_STACK()						\
+# define INIT_FAIL_STACK()						\
   do {									\
     fail_stack.avail = 0;						\
   } while (0)
 
-#define RESET_FAIL_STACK()
+# define RESET_FAIL_STACK()
 #endif
 
 
 /* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
 
    Return 1 if succeeds, and 0 if either ran out of memory
-   allocating space for it or it was already too large.  
-   
+   allocating space for it or it was already too large.
+
    REGEX_REALLOCATE_STACK requires `destination' be declared.   */
 
 #define DOUBLE_FAIL_STACK(fail_stack)					\
-  ((fail_stack).size > re_max_failures * MAX_FAILURE_ITEMS		\
+  ((fail_stack).size > (unsigned) (re_max_failures * MAX_FAILURE_ITEMS)	\
    ? 0									\
    : ((fail_stack).stack = (fail_stack_elt_t *)				\
         REGEX_REALLOCATE_STACK ((fail_stack).stack, 			\
@@ -1078,7 +1314,7 @@
          1)))
 
 
-/* Push pointer POINTER on FAIL_STACK. 
+/* Push pointer POINTER on FAIL_STACK.
    Return 1 if was able to do so and 0 if ran out of memory allocating
    space to do so.  */
 #define PUSH_PATTERN_OP(POINTER, FAIL_STACK)				\
@@ -1114,21 +1350,21 @@
 
 /* Used to omit pushing failure point id's when we're not debugging.  */
 #ifdef DEBUG
-#define DEBUG_PUSH PUSH_FAILURE_INT
-#define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_INT ()
+# define DEBUG_PUSH PUSH_FAILURE_INT
+# define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_INT ()
 #else
-#define DEBUG_PUSH(item)
-#define DEBUG_POP(item_addr)
+# define DEBUG_PUSH(item)
+# define DEBUG_POP(item_addr)
 #endif
 
 
 /* Push the information about the state we will need
-   if we ever fail back to it.  
-   
+   if we ever fail back to it.
+
    Requires variables fail_stack, regstart, regend, reg_info, and
-   num_regs be declared.  DOUBLE_FAIL_STACK requires `destination' be
-   declared.
-   
+   num_regs_pushed be declared.  DOUBLE_FAIL_STACK requires `destination'
+   be declared.
+
    Does `return FAILURE_CODE' if runs out of memory.  */
 
 #define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code)	\
@@ -1136,7 +1372,10 @@
     char *destination;							\
     /* Must be int, so when we don't save any registers, the arithmetic	\
        of 0 + -1 isn't done as unsigned.  */				\
-    int this_reg;							\
+    /* Can't be int, since there is not a shred of a guarantee that int	\
+       is wide enough to hold a value of something to which pointer can	\
+       be assigned */							\
+    active_reg_t this_reg;						\
     									\
     DEBUG_STATEMENT (failure_id++);					\
     DEBUG_STATEMENT (nfailure_points_pushed++);				\
@@ -1144,7 +1383,7 @@
     DEBUG_PRINT2 ("  Before push, next avail: %d\n", (fail_stack).avail);\
     DEBUG_PRINT2 ("                     size: %d\n", (fail_stack).size);\
 									\
-    DEBUG_PRINT2 ("  slots needed: %d\n", NUM_FAILURE_ITEMS);		\
+    DEBUG_PRINT2 ("  slots needed: %ld\n", NUM_FAILURE_ITEMS);		\
     DEBUG_PRINT2 ("     available: %d\n", REMAINING_AVAIL_SLOTS);	\
 									\
     /* Ensure we have enough space allocated for what we will push.  */	\
@@ -1161,20 +1400,21 @@
     /* Push the info, starting with the registers.  */			\
     DEBUG_PRINT1 ("\n");						\
 									\
-    if (!RE_NO_POSIX_BACKTRACKING & bufp->syntax)			\
+    if (1)								\
       for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \
 	   this_reg++)							\
 	{								\
-	  DEBUG_PRINT2 ("  Pushing reg: %d\n", this_reg);		\
+	  DEBUG_PRINT2 ("  Pushing reg: %lu\n", this_reg);		\
 	  DEBUG_STATEMENT (num_regs_pushed++);				\
 									\
-	  DEBUG_PRINT2 ("    start: 0x%x\n", regstart[this_reg]);	\
+	  DEBUG_PRINT2 ("    start: %p\n", regstart[this_reg]);		\
 	  PUSH_FAILURE_POINTER (regstart[this_reg]);			\
 									\
-	  DEBUG_PRINT2 ("    end: 0x%x\n", regend[this_reg]);		\
+	  DEBUG_PRINT2 ("    end: %p\n", regend[this_reg]);		\
 	  PUSH_FAILURE_POINTER (regend[this_reg]);			\
 									\
-	  DEBUG_PRINT2 ("    info: 0x%x\n      ", reg_info[this_reg]);	\
+	  DEBUG_PRINT2 ("    info: %p\n      ",				\
+			reg_info[this_reg].word.pointer);		\
 	  DEBUG_PRINT2 (" match_null=%d",				\
 			REG_MATCH_NULL_STRING_P (reg_info[this_reg]));	\
 	  DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg]));	\
@@ -1186,17 +1426,17 @@
 	  PUSH_FAILURE_ELT (reg_info[this_reg].word);			\
 	}								\
 									\
-    DEBUG_PRINT2 ("  Pushing  low active reg: %d\n", lowest_active_reg);\
+    DEBUG_PRINT2 ("  Pushing  low active reg: %ld\n", lowest_active_reg);\
     PUSH_FAILURE_INT (lowest_active_reg);				\
 									\
-    DEBUG_PRINT2 ("  Pushing high active reg: %d\n", highest_active_reg);\
+    DEBUG_PRINT2 ("  Pushing high active reg: %ld\n", highest_active_reg);\
     PUSH_FAILURE_INT (highest_active_reg);				\
 									\
-    DEBUG_PRINT2 ("  Pushing pattern 0x%x: ", pattern_place);		\
+    DEBUG_PRINT2 ("  Pushing pattern %p:\n", pattern_place);		\
     DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend);		\
     PUSH_FAILURE_POINTER (pattern_place);				\
 									\
-    DEBUG_PRINT2 ("  Pushing string 0x%x: `", string_place);		\
+    DEBUG_PRINT2 ("  Pushing string %p: `", string_place);		\
     DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2,   \
 				 size2);				\
     DEBUG_PRINT1 ("'\n");						\
@@ -1212,17 +1452,20 @@
 
 /* Individual items aside from the registers.  */
 #ifdef DEBUG
-#define NUM_NONREG_ITEMS 5 /* Includes failure point id.  */
+# define NUM_NONREG_ITEMS 5 /* Includes failure point id.  */
 #else
-#define NUM_NONREG_ITEMS 4
+# define NUM_NONREG_ITEMS 4
 #endif
 
 /* We push at most this many items on the stack.  */
-#define MAX_FAILURE_ITEMS ((num_regs - 1) * NUM_REG_ITEMS + NUM_NONREG_ITEMS)
+/* We used to use (num_regs - 1), which is the number of registers
+   this regexp will save; but that was changed to 5
+   to avoid stack overflow for a regexp with lots of parens.  */
+#define MAX_FAILURE_ITEMS (5 * NUM_REG_ITEMS + NUM_NONREG_ITEMS)
 
 /* We actually push this many items.  */
 #define NUM_FAILURE_ITEMS				\
-  (((RE_NO_POSIX_BACKTRACKING & bufp->syntax		\
+  (((0							\
      ? 0 : highest_active_reg - lowest_active_reg + 1)	\
     * NUM_REG_ITEMS)					\
    + NUM_NONREG_ITEMS)
@@ -1239,14 +1482,14 @@
      LOW_REG, HIGH_REG -- the highest and lowest active registers.
      REGSTART, REGEND -- arrays of string positions.
      REG_INFO -- array of information about each subexpression.
-   
+
    Also assumes the variables `fail_stack' and (if debugging), `bufp',
    `pend', `string1', `size1', `string2', and `size2'.  */
 
 #define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\
 {									\
-  DEBUG_STATEMENT (fail_stack_elt_t failure_id;)			\
-  int this_reg;								\
+  DEBUG_STATEMENT (unsigned failure_id;)				\
+  active_reg_t this_reg;						\
   const unsigned char *string_temp;					\
 									\
   assert (!FAIL_STACK_EMPTY ());					\
@@ -1268,35 +1511,46 @@
   if (string_temp != NULL)						\
     str = (const char *) string_temp;					\
 									\
-  DEBUG_PRINT2 ("  Popping string 0x%x: `", str);			\
+  DEBUG_PRINT2 ("  Popping string %p: `", str);				\
   DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2);	\
   DEBUG_PRINT1 ("'\n");							\
 									\
   pat = (unsigned char *) POP_FAILURE_POINTER ();			\
-  DEBUG_PRINT2 ("  Popping pattern 0x%x: ", pat);			\
+  DEBUG_PRINT2 ("  Popping pattern %p:\n", pat);			\
   DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend);			\
 									\
   /* Restore register info.  */						\
-  high_reg = (unsigned) POP_FAILURE_INT ();				\
-  DEBUG_PRINT2 ("  Popping high active reg: %d\n", high_reg);		\
+  high_reg = (active_reg_t) POP_FAILURE_INT ();				\
+  DEBUG_PRINT2 ("  Popping high active reg: %ld\n", high_reg);		\
 									\
-  low_reg = (unsigned) POP_FAILURE_INT ();				\
-  DEBUG_PRINT2 ("  Popping  low active reg: %d\n", low_reg);		\
+  low_reg = (active_reg_t) POP_FAILURE_INT ();				\
+  DEBUG_PRINT2 ("  Popping  low active reg: %ld\n", low_reg);		\
 									\
-  if (!RE_NO_POSIX_BACKTRACKING & bufp->syntax)				\
+  if (1)								\
     for (this_reg = high_reg; this_reg >= low_reg; this_reg--)		\
       {									\
-	DEBUG_PRINT2 ("    Popping reg: %d\n", this_reg);		\
+	DEBUG_PRINT2 ("    Popping reg: %ld\n", this_reg);		\
 									\
 	reg_info[this_reg].word = POP_FAILURE_ELT ();			\
-	DEBUG_PRINT2 ("      info: 0x%x\n", reg_info[this_reg]);	\
+	DEBUG_PRINT2 ("      info: %p\n",				\
+		      reg_info[this_reg].word.pointer);			\
 									\
 	regend[this_reg] = (const char *) POP_FAILURE_POINTER ();	\
-	DEBUG_PRINT2 ("      end: 0x%x\n", regend[this_reg]);		\
+	DEBUG_PRINT2 ("      end: %p\n", regend[this_reg]);		\
 									\
 	regstart[this_reg] = (const char *) POP_FAILURE_POINTER ();	\
-	DEBUG_PRINT2 ("      start: 0x%x\n", regstart[this_reg]);	\
+	DEBUG_PRINT2 ("      start: %p\n", regstart[this_reg]);		\
       }									\
+  else									\
+    {									\
+      for (this_reg = highest_active_reg; this_reg > high_reg; this_reg--) \
+	{								\
+	  reg_info[this_reg].word.integer = 0;				\
+	  regend[this_reg] = 0;						\
+	  regstart[this_reg] = 0;					\
+	}								\
+      highest_active_reg = high_reg;					\
+    }									\
 									\
   set_regs_matched_done = 0;						\
   DEBUG_STATEMENT (nfailure_points_popped++);				\
@@ -1308,13 +1562,16 @@
    Other register information, such as the
    starting and ending positions (which are addresses), and the list of
    inner groups (which is a bits list) are maintained in separate
-   variables.  
-   
+   variables.
+
    We are making a (strictly speaking) nonportable assumption here: that
    the compiler will pack our bit fields into something that fits into
    the type of `word', i.e., is something that fits into one item on the
    failure stack.  */
 
+
+/* Declarations and macros for re_match_2.  */
+
 typedef union
 {
   fail_stack_elt_t word;
@@ -1344,7 +1601,7 @@
     {									\
       if (!set_regs_matched_done)					\
 	{								\
-	  unsigned r;							\
+	  active_reg_t r;						\
 	  set_regs_matched_done = 1;					\
 	  for (r = lowest_active_reg; r <= highest_active_reg; r++)	\
 	    {								\
@@ -1363,21 +1620,38 @@
 
 /* Subroutine declarations and macros for regex_compile.  */
 
-static void store_op1 (), store_op2 ();
-static void insert_op1 (), insert_op2 ();
-static boolean at_begline_loc_p (), at_endline_loc_p ();
-static boolean group_in_compile_stack ();
-static reg_errcode_t compile_range ();
+static reg_errcode_t regex_compile _RE_ARGS ((const char *pattern, size_t size,
+					      reg_syntax_t syntax,
+					      struct re_pattern_buffer *bufp));
+static void store_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg));
+static void store_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc,
+				 int arg1, int arg2));
+static void insert_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc,
+				  int arg, unsigned char *end));
+static void insert_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc,
+				  int arg1, int arg2, unsigned char *end));
+static boolean at_begline_loc_p _RE_ARGS ((const char *pattern, const char *p,
+					   reg_syntax_t syntax));
+static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend,
+					   reg_syntax_t syntax));
+static reg_errcode_t compile_range _RE_ARGS ((unsigned int range_start,
+					      const char **p_ptr,
+					      const char *pend,
+					      char *translate,
+					      reg_syntax_t syntax,
+					      unsigned char *b));
 
-/* Fetch the next character in the uncompiled pattern---translating it 
+/* Fetch the next character in the uncompiled pattern---translating it
    if necessary.  Also cast from a signed character in the constant
    string passed to us by the user to an unsigned char that we can use
    as an array index (in, e.g., `translate').  */
-#define PATFETCH(c)							\
+#ifndef PATFETCH
+# define PATFETCH(c)							\
   do {if (p == pend) return REG_EEND;					\
     c = (unsigned char) *p++;						\
-    if (translate) c = translate[c]; 					\
+    if (translate) c = (unsigned char) translate[c];			\
   } while (0)
+#endif
 
 /* Fetch the next character in the uncompiled pattern, with no
    translation.  */
@@ -1394,7 +1668,10 @@
    cast the subscript to translate because some data is declared as
    `char *', to avoid warnings when a string constant is passed.  But
    when we use a character as a subscript we must make it unsigned.  */
-#define TRANSLATE(d) (translate ? translate[(unsigned char) (d)] : (d))
+#ifndef TRANSLATE
+# define TRANSLATE(d) \
+  (translate ? (char) translate[(unsigned char) (d)] : (d))
+#endif
 
 
 /* Macros for outputting the compiled pattern into `buffer'.  */
@@ -1404,7 +1681,7 @@
 
 /* Make sure we have at least N more bytes of space in buffer.  */
 #define GET_BUFFER_SPACE(n)						\
-    while (b - bufp->buffer + (n) > bufp->allocated)			\
+    while ((unsigned long) (b - bufp->buffer + (n)) > bufp->allocated)	\
       EXTEND_BUFFER ()
 
 /* Make sure we have one more byte of buffer space and then add C to it.  */
@@ -1437,54 +1714,89 @@
 /* Store a jump with opcode OP at LOC to location TO.  We store a
    relative address offset by the three bytes the jump itself occupies.  */
 #define STORE_JUMP(op, loc, to) \
-  store_op1 (op, loc, (to) - (loc) - 3)
+  store_op1 (op, loc, (int) ((to) - (loc) - 3))
 
 /* Likewise, for a two-argument jump.  */
 #define STORE_JUMP2(op, loc, to, arg) \
-  store_op2 (op, loc, (to) - (loc) - 3, arg)
+  store_op2 (op, loc, (int) ((to) - (loc) - 3), arg)
 
 /* Like `STORE_JUMP', but for inserting.  Assume `b' is the buffer end.  */
 #define INSERT_JUMP(op, loc, to) \
-  insert_op1 (op, loc, (to) - (loc) - 3, b)
+  insert_op1 (op, loc, (int) ((to) - (loc) - 3), b)
 
 /* Like `STORE_JUMP2', but for inserting.  Assume `b' is the buffer end.  */
 #define INSERT_JUMP2(op, loc, to, arg) \
-  insert_op2 (op, loc, (to) - (loc) - 3, arg, b)
+  insert_op2 (op, loc, (int) ((to) - (loc) - 3), arg, b)
 
 
 /* This is not an arbitrary limit: the arguments which represent offsets
    into the pattern are two bytes long.  So if 2^16 bytes turns out to
    be too small, many things would have to change.  */
-#define MAX_BUF_SIZE (1L << 16)
-
+/* Any other compiler which, like MSC, has allocation limit below 2^16
+   bytes will have to use approach similar to what was done below for
+   MSC and drop MAX_BUF_SIZE a bit.  Otherwise you may end up
+   reallocating to 0 bytes.  Such thing is not going to work too well.
+   You have been warned!!  */
+#if defined _MSC_VER  && !defined WIN32
+/* Microsoft C 16-bit versions limit malloc to approx 65512 bytes.
+   The REALLOC define eliminates a flurry of conversion warnings,
+   but is not required. */
+# define MAX_BUF_SIZE  65500L
+# define REALLOC(p,s) realloc ((p), (size_t) (s))
+#else
+# define MAX_BUF_SIZE (1L << 16)
+# define REALLOC(p,s) realloc ((p), (s))
+#endif
 
 /* Extend the buffer by twice its current size via realloc and
    reset the pointers that pointed into the old block to point to the
    correct places in the new one.  If extending the buffer results in it
    being larger than MAX_BUF_SIZE, then flag memory exhausted.  */
+#if __BOUNDED_POINTERS__
+# define SET_HIGH_BOUND(P) (__ptrhigh (P) = __ptrlow (P) + bufp->allocated)
+# define MOVE_BUFFER_POINTER(P) \
+  (__ptrlow (P) += incr, SET_HIGH_BOUND (P), __ptrvalue (P) += incr)
+# define ELSE_EXTEND_BUFFER_HIGH_BOUND		\
+  else						\
+    {						\
+      SET_HIGH_BOUND (b);			\
+      SET_HIGH_BOUND (begalt);			\
+      if (fixup_alt_jump)			\
+	SET_HIGH_BOUND (fixup_alt_jump);	\
+      if (laststart)				\
+	SET_HIGH_BOUND (laststart);		\
+      if (pending_exact)			\
+	SET_HIGH_BOUND (pending_exact);		\
+    }
+#else
+# define MOVE_BUFFER_POINTER(P) (P) += incr
+# define ELSE_EXTEND_BUFFER_HIGH_BOUND
+#endif
 #define EXTEND_BUFFER()							\
-  do { 									\
+  do {									\
     unsigned char *old_buffer = bufp->buffer;				\
-    if (bufp->allocated == MAX_BUF_SIZE) 				\
+    if (bufp->allocated == MAX_BUF_SIZE)				\
       return REG_ESIZE;							\
     bufp->allocated <<= 1;						\
     if (bufp->allocated > MAX_BUF_SIZE)					\
-      bufp->allocated = MAX_BUF_SIZE; 					\
-    bufp->buffer = (unsigned char *) realloc (bufp->buffer, bufp->allocated);\
+      bufp->allocated = MAX_BUF_SIZE;					\
+    bufp->buffer = (unsigned char *) REALLOC (bufp->buffer, bufp->allocated);\
     if (bufp->buffer == NULL)						\
       return REG_ESPACE;						\
     /* If the buffer moved, move all the pointers into it.  */		\
     if (old_buffer != bufp->buffer)					\
       {									\
-        b = (b - old_buffer) + bufp->buffer;				\
-        begalt = (begalt - old_buffer) + bufp->buffer;			\
-        if (fixup_alt_jump)						\
-          fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\
-        if (laststart)							\
-          laststart = (laststart - old_buffer) + bufp->buffer;		\
-        if (pending_exact)						\
-          pending_exact = (pending_exact - old_buffer) + bufp->buffer;	\
+	int incr = bufp->buffer - old_buffer;				\
+	MOVE_BUFFER_POINTER (b);					\
+	MOVE_BUFFER_POINTER (begalt);					\
+	if (fixup_alt_jump)						\
+	  MOVE_BUFFER_POINTER (fixup_alt_jump);				\
+	if (laststart)							\
+	  MOVE_BUFFER_POINTER (laststart);				\
+	if (pending_exact)						\
+	  MOVE_BUFFER_POINTER (pending_exact);				\
       }									\
+    ELSE_EXTEND_BUFFER_HIGH_BOUND					\
   } while (0)
 
 
@@ -1502,14 +1814,15 @@
 
 /* Since offsets can go either forwards or backwards, this type needs to
    be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1.  */
-typedef int pattern_offset_t;
+/* int may be not enough when sizeof(int) == 2.  */
+typedef long pattern_offset_t;
 
 typedef struct
 {
   pattern_offset_t begalt_offset;
   pattern_offset_t fixup_alt_jump;
   pattern_offset_t inner_group_offset;
-  pattern_offset_t laststart_offset;  
+  pattern_offset_t laststart_offset;
   regnum_t regnum;
 } compile_stack_elt_t;
 
@@ -1542,7 +1855,7 @@
   { if (p != pend)							\
      {									\
        PATFETCH (c); 							\
-       while (ISDIGIT (c)) 						\
+       while ('0' <= c && c <= '9')					\
          { 								\
            if (num < 0)							\
               num = 0;							\
@@ -1552,17 +1865,35 @@
            PATFETCH (c);						\
          } 								\
        } 								\
-    }		
+    }
 
-#define CHAR_CLASS_MAX_LENGTH  6 /* Namely, `xdigit'.  */
+#if defined _LIBC || WIDE_CHAR_SUPPORT
+/* The GNU C library provides support for user-defined character classes
+   and the functions from ISO C amendement 1.  */
+# ifdef CHARCLASS_NAME_MAX
+#  define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
+# else
+/* This shouldn't happen but some implementation might still have this
+   problem.  Use a reasonable default value.  */
+#  define CHAR_CLASS_MAX_LENGTH 256
+# endif
+
+# ifdef _LIBC
+#  define IS_CHAR_CLASS(string) __wctype (string)
+# else
+#  define IS_CHAR_CLASS(string) wctype (string)
+# endif
+#else
+# define CHAR_CLASS_MAX_LENGTH  6 /* Namely, `xdigit'.  */
 
-#define IS_CHAR_CLASS(string)						\
+# define IS_CHAR_CLASS(string)						\
    (STREQ (string, "alpha") || STREQ (string, "upper")			\
     || STREQ (string, "lower") || STREQ (string, "digit")		\
     || STREQ (string, "alnum") || STREQ (string, "xdigit")		\
     || STREQ (string, "space") || STREQ (string, "print")		\
     || STREQ (string, "punct") || STREQ (string, "graph")		\
     || STREQ (string, "cntrl") || STREQ (string, "blank"))
+#endif
 
 #ifndef MATCH_MAY_ALLOCATE
 
@@ -1583,7 +1914,7 @@
 static const char **     regstart, **     regend;
 static const char ** old_regstart, ** old_regend;
 static const char **best_regstart, **best_regend;
-static register_info_type *reg_info; 
+static register_info_type *reg_info;
 static const char **reg_dummy;
 static register_info_type *reg_info_dummy;
 
@@ -1612,6 +1943,10 @@
 
 #endif /* not MATCH_MAY_ALLOCATE */
 
+static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type
+						 compile_stack,
+						 regnum_t regnum));
+
 /* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
    Returns one of error codes defined in `regex.h', or zero for success.
 
@@ -1626,7 +1961,7 @@
      `fastmap_accurate' is zero;
      `re_nsub' is the number of subexpressions in PATTERN;
      `not_bol' and `not_eol' are zero;
-   
+
    The `fastmap' and `newline_anchor' fields are neither
    examined nor set.  */
 
@@ -1634,12 +1969,10 @@
 #define FREE_STACK_RETURN(value)		\
   return (free (compile_stack.stack), value)
 
-static reg_errcode_t regex_compile __((const char *, int, reg_syntax_t, struct re_pattern_buffer *));
-
 static reg_errcode_t
 regex_compile (pattern, size, syntax, bufp)
      const char *pattern;
-     int size;
+     size_t size;
      reg_syntax_t syntax;
      struct re_pattern_buffer *bufp;
 {
@@ -1647,22 +1980,22 @@
      `char *' (i.e., signed), we declare these variables as unsigned, so
      they can be reliably used as array indices.  */
   register unsigned char c, c1;
-  
+
   /* A random temporary spot in PATTERN.  */
   const char *p1;
 
   /* Points to the end of the buffer, where we should append.  */
   register unsigned char *b;
-  
+
   /* Keeps track of unclosed groups.  */
   compile_stack_type compile_stack;
 
   /* Points to the current (ending) position in the pattern.  */
   const char *p = pattern;
   const char *pend = pattern + size;
-  
+
   /* How to translate the characters in the pattern.  */
-  char *translate = bufp->translate;
+  RE_TRANSLATE_TYPE translate = bufp->translate;
 
   /* Address of the count-byte of the most recently inserted `exactn'
      command.  This makes it possible to tell if a new exact-match
@@ -1681,7 +2014,7 @@
   /* Place in the uncompiled pattern (i.e., the {) to
      which to go back if the interval is invalid.  */
   const char *beg_interval;
-                
+
   /* Address of the place where a forward jump should go to the end of
      the containing expression.  Each alternative of an `or' -- except the
      last -- ends with a forward jump of this sort.  */
@@ -1697,7 +2030,7 @@
   if (debug)
     {
       unsigned debug_count;
-      
+
       for (debug_count = 0; debug_count < size; debug_count++)
         putchar (pattern[debug_count]);
       putchar ('\n');
@@ -1721,11 +2054,11 @@
      printer (for debugging) will think there's no pattern.  We reset it
      at the end.  */
   bufp->used = 0;
-  
+
   /* Always count groups, whether or not bufp->no_sub is set.  */
-  bufp->re_nsub = 0;				
+  bufp->re_nsub = 0;
 
-#if !defined (emacs) && !defined (SYNTAX_TABLE)
+#if !defined emacs && !defined SYNTAX_TABLE
   /* Initialize the syntax table.  */
    init_syntax_once ();
 #endif
@@ -1774,7 +2107,7 @@
         case '$':
           {
             if (   /* If at end of pattern, it's an operator.  */
-                   p == pend 
+                   p == pend
                    /* If context independent, it's an operator.  */
                 || syntax & RE_CONTEXT_INDEP_ANCHORS
                    /* Otherwise, depends on what's next.  */
@@ -1805,7 +2138,7 @@
           {
             /* Are we optimizing this jump?  */
             boolean keep_string_p = false;
-            
+
             /* 1 means zero (many) matches is allowed.  */
             char zero_times_ok = 0, many_times_ok = 0;
 
@@ -1853,7 +2186,7 @@
 
             /* Star, etc. applied to an empty pattern is equivalent
                to an empty pattern.  */
-            if (!laststart)  
+            if (!laststart)
               break;
 
             /* Now we know whether or not zero matches is allowed
@@ -1862,7 +2195,7 @@
               { /* More than one repetition is allowed, so put in at the
                    end a backward relative jump from `b' to before the next
                    jump we're going to put in below (which jumps from
-                   laststart to after this jump).  
+                   laststart to after this jump).
 
                    But if we are at the `*' in the exact sequence `.*\n',
                    insert an unconditional jump backwards to the .,
@@ -1928,6 +2261,7 @@
         case '[':
           {
             boolean had_char_class = false;
+	    unsigned int range_start = 0xffffffff;
 
             if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
 
@@ -1939,7 +2273,7 @@
 
             /* We test `*p == '^' twice, instead of using an if
                statement, so we only need one BUF_PUSH.  */
-            BUF_PUSH (*p == '^' ? charset_not : charset); 
+            BUF_PUSH (*p == '^' ? charset_not : charset);
             if (*p == '^')
               p++;
 
@@ -1971,6 +2305,7 @@
 
                     PATFETCH (c1);
                     SET_LIST_BIT (c1);
+		    range_start = c1;
                     continue;
                   }
 
@@ -1989,14 +2324,16 @@
                    was a character: if this is a hyphen not at the
                    beginning or the end of a list, then it's the range
                    operator.  */
-                if (c == '-' 
-                    && !(p - 2 >= pattern && p[-2] == '[') 
+                if (c == '-'
+                    && !(p - 2 >= pattern && p[-2] == '[')
                     && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
                     && *p != ']')
                   {
                     reg_errcode_t ret
-                      = compile_range (&p, pend, translate, syntax, b);
+                      = compile_range (range_start, &p, pend, translate,
+				       syntax, b);
                     if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
+		    range_start = 0xffffffff;
                   }
 
                 else if (p[0] == '-' && p[1] != ']')
@@ -2005,9 +2342,10 @@
 
 		    /* Move past the `-'.  */
                     PATFETCH (c1);
-                    
-                    ret = compile_range (&p, pend, translate, syntax, b);
+
+                    ret = compile_range (c, &p, pend, translate, syntax, b);
                     if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
+		    range_start = 0xffffffff;
                   }
 
                 /* See if we're at the beginning of a possible character
@@ -2026,19 +2364,55 @@
                     for (;;)
                       {
                         PATFETCH (c);
-                        if (c == ':' || c == ']' || p == pend
-                            || c1 == CHAR_CLASS_MAX_LENGTH)
+                        if ((c == ':' && *p == ']') || p == pend)
                           break;
-                        str[c1++] = c;
+			if (c1 < CHAR_CLASS_MAX_LENGTH)
+			  str[c1++] = c;
+			else
+			  /* This is in any case an invalid class name.  */
+			  str[0] = '\0';
                       }
                     str[c1] = '\0';
 
-                    /* If isn't a word bracketed by `[:' and:`]':
-                       undo the ending character, the letters, and leave 
+                    /* If isn't a word bracketed by `[:' and `:]':
+                       undo the ending character, the letters, and leave
                        the leading `:' and `[' (but set bits for them).  */
                     if (c == ':' && *p == ']')
                       {
+#if defined _LIBC || WIDE_CHAR_SUPPORT
+                        boolean is_lower = STREQ (str, "lower");
+                        boolean is_upper = STREQ (str, "upper");
+			wctype_t wt;
                         int ch;
+
+			wt = IS_CHAR_CLASS (str);
+			if (wt == 0)
+			  FREE_STACK_RETURN (REG_ECTYPE);
+
+                        /* Throw away the ] at the end of the character
+                           class.  */
+                        PATFETCH (c);
+
+                        if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
+
+                        for (ch = 0; ch < 1 << BYTEWIDTH; ++ch)
+			  {
+# ifdef _LIBC
+			    if (__iswctype (__btowc (ch), wt))
+			      SET_LIST_BIT (ch);
+# else
+			    if (iswctype (btowc (ch), wt))
+			      SET_LIST_BIT (ch);
+# endif
+
+			    if (translate && (is_upper || is_lower)
+				&& (ISUPPER (ch) || ISLOWER (ch)))
+			      SET_LIST_BIT (ch);
+			  }
+
+                        had_char_class = true;
+#else
+                        int ch;
                         boolean is_alnum = STREQ (str, "alnum");
                         boolean is_alpha = STREQ (str, "alpha");
                         boolean is_blank = STREQ (str, "blank");
@@ -2051,13 +2425,13 @@
                         boolean is_space = STREQ (str, "space");
                         boolean is_upper = STREQ (str, "upper");
                         boolean is_xdigit = STREQ (str, "xdigit");
-                        
+
                         if (!IS_CHAR_CLASS (str))
 			  FREE_STACK_RETURN (REG_ECTYPE);
 
                         /* Throw away the ] at the end of the character
                            class.  */
-                        PATFETCH (c);					
+                        PATFETCH (c);
 
                         if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
 
@@ -2080,30 +2454,310 @@
                                 || (is_upper  && ISUPPER (ch))
                                 || (is_xdigit && ISXDIGIT (ch)))
 			      SET_LIST_BIT (ch);
+			    if (   translate && (is_upper || is_lower)
+				&& (ISUPPER (ch) || ISLOWER (ch)))
+			      SET_LIST_BIT (ch);
                           }
                         had_char_class = true;
+#endif	/* libc || wctype.h */
                       }
                     else
                       {
                         c1++;
-                        while (c1--)    
+                        while (c1--)
                           PATUNFETCH;
                         SET_LIST_BIT ('[');
                         SET_LIST_BIT (':');
+			range_start = ':';
                         had_char_class = false;
                       }
                   }
+                else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '=')
+		  {
+		    unsigned char str[MB_LEN_MAX + 1];
+#ifdef _LIBC
+		    uint32_t nrules =
+		      _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+#endif
+
+		    PATFETCH (c);
+		    c1 = 0;
+
+		    /* If pattern is `[[='.  */
+		    if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
+
+		    for (;;)
+		      {
+			PATFETCH (c);
+			if ((c == '=' && *p == ']') || p == pend)
+			  break;
+			if (c1 < MB_LEN_MAX)
+			  str[c1++] = c;
+			else
+			  /* This is in any case an invalid class name.  */
+			  str[0] = '\0';
+                      }
+		    str[c1] = '\0';
+
+		    if (c == '=' && *p == ']' && str[0] != '\0')
+		      {
+			/* If we have no collation data we use the default
+			   collation in which each character is in a class
+			   by itself.  It also means that ASCII is the
+			   character set and therefore we cannot have character
+			   with more than one byte in the multibyte
+			   representation.  */
+#ifdef _LIBC
+			if (nrules == 0)
+#endif
+			  {
+			    if (c1 != 1)
+			      FREE_STACK_RETURN (REG_ECOLLATE);
+
+			    /* Throw away the ] at the end of the equivalence
+			       class.  */
+			    PATFETCH (c);
+
+			    /* Set the bit for the character.  */
+			    SET_LIST_BIT (str[0]);
+			  }
+#ifdef _LIBC
+			else
+			  {
+			    /* Try to match the byte sequence in `str' against
+			       those known to the collate implementation.
+			       First find out whether the bytes in `str' are
+			       actually from exactly one character.  */
+			    const int32_t *table;
+			    const unsigned char *weights;
+			    const unsigned char *extra;
+			    const int32_t *indirect;
+			    int32_t idx;
+			    const unsigned char *cp = str;
+			    int ch;
+
+			    /* This #include defines a local function!  */
+# include <locale/weight.h>
+
+			    table = (const int32_t *)
+			      _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+			    weights = (const unsigned char *)
+			      _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB);
+			    extra = (const unsigned char *)
+			      _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
+			    indirect = (const int32_t *)
+			      _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
+
+			    idx = findidx (&cp);
+			    if (idx == 0 || cp < str + c1)
+			      /* This is no valid character.  */
+			      FREE_STACK_RETURN (REG_ECOLLATE);
+
+			    /* Throw away the ] at the end of the equivalence
+			       class.  */
+			    PATFETCH (c);
+
+			    /* Now we have to go throught the whole table
+			       and find all characters which have the same
+			       first level weight.
+
+			       XXX Note that this is not entirely correct.
+			       we would have to match multibyte sequences
+			       but this is not possible with the current
+			       implementation.  */
+			    for (ch = 1; ch < 256; ++ch)
+			      /* XXX This test would have to be changed if we
+				 would allow matching multibyte sequences.  */
+			      if (table[ch] > 0)
+				{
+				  int32_t idx2 = table[ch];
+				  size_t len = weights[idx2];
+
+				  /* Test whether the lenghts match.  */
+				  if (weights[idx] == len)
+				    {
+				      /* They do.  New compare the bytes of
+					 the weight.  */
+				      size_t cnt = 0;
+
+				      while (cnt < len
+					     && (weights[idx + 1 + cnt]
+						 == weights[idx2 + 1 + cnt]))
+					++len;
+
+				      if (cnt == len)
+					/* They match.  Mark the character as
+					   acceptable.  */
+					SET_LIST_BIT (ch);
+				    }
+				}
+			  }
+#endif
+			had_char_class = true;
+		      }
+                    else
+                      {
+                        c1++;
+                        while (c1--)
+                          PATUNFETCH;
+                        SET_LIST_BIT ('[');
+                        SET_LIST_BIT ('=');
+			range_start = '=';
+                        had_char_class = false;
+                      }
+		  }
+                else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '.')
+		  {
+		    unsigned char str[128];	/* Should be large enough.  */
+#ifdef _LIBC
+		    uint32_t nrules =
+		      _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+#endif
+
+		    PATFETCH (c);
+		    c1 = 0;
+
+		    /* If pattern is `[[='.  */
+		    if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
+
+		    for (;;)
+		      {
+			PATFETCH (c);
+			if ((c == '.' && *p == ']') || p == pend)
+			  break;
+			if (c1 < sizeof (str))
+			  str[c1++] = c;
+			else
+			  /* This is in any case an invalid class name.  */
+			  str[0] = '\0';
+                      }
+		    str[c1] = '\0';
+
+		    if (c == '.' && *p == ']' && str[0] != '\0')
+		      {
+			/* If we have no collation data we use the default
+			   collation in which each character is the name
+			   for its own class which contains only the one
+			   character.  It also means that ASCII is the
+			   character set and therefore we cannot have character
+			   with more than one byte in the multibyte
+			   representation.  */
+#ifdef _LIBC
+			if (nrules == 0)
+#endif
+			  {
+			    if (c1 != 1)
+			      FREE_STACK_RETURN (REG_ECOLLATE);
+
+			    /* Throw away the ] at the end of the equivalence
+			       class.  */
+			    PATFETCH (c);
+
+			    /* Set the bit for the character.  */
+			    SET_LIST_BIT (str[0]);
+			    range_start = ((const unsigned char *) str)[0];
+			  }
+#ifdef _LIBC
+			else
+			  {
+			    /* Try to match the byte sequence in `str' against
+			       those known to the collate implementation.
+			       First find out whether the bytes in `str' are
+			       actually from exactly one character.  */
+			    int32_t table_size;
+			    const int32_t *symb_table;
+			    const unsigned char *extra;
+			    int32_t idx;
+			    int32_t elem;
+			    int32_t second;
+			    int32_t hash;
+
+			    table_size =
+			      _NL_CURRENT_WORD (LC_COLLATE,
+						_NL_COLLATE_SYMB_HASH_SIZEMB);
+			    symb_table = (const int32_t *)
+			      _NL_CURRENT (LC_COLLATE,
+					   _NL_COLLATE_SYMB_TABLEMB);
+			    extra = (const unsigned char *)
+			      _NL_CURRENT (LC_COLLATE,
+					   _NL_COLLATE_SYMB_EXTRAMB);
+
+			    /* Locate the character in the hashing table.  */
+			    hash = elem_hash (str, c1);
+
+			    idx = 0;
+			    elem = hash % table_size;
+			    second = hash % (table_size - 2);
+			    while (symb_table[2 * elem] != 0)
+			      {
+				/* First compare the hashing value.  */
+				if (symb_table[2 * elem] == hash
+				    && c1 == extra[symb_table[2 * elem + 1]]
+				    && memcmp (str,
+					       &extra[symb_table[2 * elem + 1]
+						     + 1],
+					       c1) == 0)
+				  {
+				    /* Yep, this is the entry.  */
+				    idx = symb_table[2 * elem + 1];
+				    idx += 1 + extra[idx];
+				    break;
+				  }
+
+				/* Next entry.  */
+				elem += second;
+			      }
+
+			    if (symb_table[2 * elem] == 0)
+			      /* This is no valid character.  */
+			      FREE_STACK_RETURN (REG_ECOLLATE);
+
+			    /* Throw away the ] at the end of the equivalence
+			       class.  */
+			    PATFETCH (c);
+
+			    /* Now add the multibyte character(s) we found
+			       to the accept list.
+
+			       XXX Note that this is not entirely correct.
+			       we would have to match multibyte sequences
+			       but this is not possible with the current
+			       implementation.  Also, we have to match
+			       collating symbols, which expand to more than
+			       one file, as a whole and not allow the
+			       individual bytes.  */
+			    c1 = extra[idx++];
+			    if (c1 == 1)
+			      range_start = extra[idx];
+			    while (c1-- > 0)
+			      SET_LIST_BIT (extra[idx++]);
+			  }
+#endif
+			had_char_class = false;
+		      }
+                    else
+                      {
+                        c1++;
+                        while (c1--)
+                          PATUNFETCH;
+                        SET_LIST_BIT ('[');
+                        SET_LIST_BIT ('.');
+			range_start = '.';
+                        had_char_class = false;
+                      }
+		  }
                 else
                   {
                     had_char_class = false;
                     SET_LIST_BIT (c);
+		    range_start = c;
                   }
               }
 
             /* Discard any (non)matching list bytes that are all 0 at the
                end of the map.  Decrease the map-length byte too.  */
-            while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) 
-              b[-1]--; 
+            while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+              b[-1]--;
             b += b[-1];
           }
           break;
@@ -2163,7 +2817,7 @@
               regnum++;
 
               if (COMPILE_STACK_FULL)
-                { 
+                {
                   RETALLOC (compile_stack.stack, compile_stack.size << 1,
                             compile_stack_elt_t);
                   if (compile_stack.stack == NULL) return REG_ESPACE;
@@ -2176,7 +2830,7 @@
                  whole pattern moves because of realloc, they will still
                  be valid.  */
               COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
-              COMPILE_STACK_TOP.fixup_alt_jump 
+              COMPILE_STACK_TOP.fixup_alt_jump
                 = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
               COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
               COMPILE_STACK_TOP.regnum = regnum;
@@ -2190,7 +2844,7 @@
                   COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
                   BUF_PUSH_3 (start_memory, regnum, 0);
                 }
-                
+
               compile_stack.avail++;
 
               fixup_alt_jump = 0;
@@ -2206,12 +2860,13 @@
             case ')':
               if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
 
-              if (COMPILE_STACK_EMPTY) {
-                if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
-                  goto normal_backslash;
-                else
-                  FREE_STACK_RETURN (REG_ERPAREN);
-	      }
+              if (COMPILE_STACK_EMPTY)
+		{
+		  if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+		    goto normal_backslash;
+		  else
+		    FREE_STACK_RETURN (REG_ERPAREN);
+		}
 
             handle_close:
               if (fixup_alt_jump)
@@ -2220,19 +2875,20 @@
                      `pop_failure_jump' to pop.  See comments at
                      `push_dummy_failure' in `re_match_2'.  */
                   BUF_PUSH (push_dummy_failure);
-                  
+
                   /* We allocated space for this jump when we assigned
                      to `fixup_alt_jump', in the `handle_alt' case below.  */
                   STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
                 }
 
               /* See similar code for backslashed left paren above.  */
-              if (COMPILE_STACK_EMPTY) {
-                if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
-                  goto normal_char;
-                else
-                  FREE_STACK_RETURN (REG_ERPAREN);
-	      }
+              if (COMPILE_STACK_EMPTY)
+		{
+		  if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+		    goto normal_char;
+		  else
+		    FREE_STACK_RETURN (REG_ERPAREN);
+		}
 
               /* Since we just checked for an empty stack above, this
                  ``can't happen''.  */
@@ -2243,11 +2899,11 @@
                    as in `(ab)c(de)' -- the second group is #2.  */
                 regnum_t this_group_regnum;
 
-                compile_stack.avail--;		
+                compile_stack.avail--;
                 begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
                 fixup_alt_jump
                   = COMPILE_STACK_TOP.fixup_alt_jump
-                    ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 
+                    ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
                     : 0;
                 laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
                 this_group_regnum = COMPILE_STACK_TOP.regnum;
@@ -2262,7 +2918,7 @@
                   {
                     unsigned char *inner_group_loc
                       = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
-                    
+
                     *inner_group_loc = regnum - this_group_regnum;
                     BUF_PUSH_3 (stop_memory, this_group_regnum,
                                 regnum - this_group_regnum);
@@ -2291,10 +2947,10 @@
                  jump (put in below, which in turn will jump to the next
                  (if any) alternative's such jump, etc.).  The last such
                  jump jumps to the correct final destination.  A picture:
-                          _____ _____ 
-                          |   | |   |   
-                          |   v |   v 
-                         a | b   | c   
+                          _____ _____
+                          |   | |   |
+                          |   v |   v
+                         a | b   | c
 
                  If we are at `b', then fixup_alt_jump right now points to a
                  three-byte space after `a'.  We'll put in the jump, set
@@ -2316,13 +2972,12 @@
               break;
 
 
-            case '{': 
+            case '{':
               /* If \{ is a literal.  */
               if (!(syntax & RE_INTERVALS)
-                     /* If we're at `\{' and it's not the open-interval 
+                     /* If we're at `\{' and it's not the open-interval
                         operator.  */
-                  || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
-                  || (p - 2 == pattern  &&  p == pend))
+		  || (syntax & RE_NO_BK_BRACES))
                 goto normal_backslash;
 
             handle_interval:
@@ -2336,7 +2991,7 @@
 
                 if (p == pend)
                   {
-                    if (syntax & RE_NO_BK_BRACES)
+                    if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
                       goto unfetch_interval;
                     else
                       FREE_STACK_RETURN (REG_EBRACE);
@@ -2347,7 +3002,12 @@
                 if (c == ',')
                   {
                     GET_UNSIGNED_NUMBER (upper_bound);
-                    if (upper_bound < 0) upper_bound = RE_DUP_MAX;
+		    if ((!(syntax & RE_NO_BK_BRACES) && c != '\\')
+			|| ((syntax & RE_NO_BK_BRACES) && c != '}'))
+		      FREE_STACK_RETURN (REG_BADBR);
+
+		    if (upper_bound < 0)
+		      upper_bound = RE_DUP_MAX;
                   }
                 else
                   /* Interval such as `{1}' => match exactly once. */
@@ -2356,13 +3016,13 @@
                 if (lower_bound < 0 || upper_bound > RE_DUP_MAX
                     || lower_bound > upper_bound)
                   {
-                    if (syntax & RE_NO_BK_BRACES)
+                    if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
                       goto unfetch_interval;
-                    else 
+                    else
                       FREE_STACK_RETURN (REG_BADBR);
                   }
 
-                if (!(syntax & RE_NO_BK_BRACES)) 
+                if (!(syntax & RE_NO_BK_BRACES))
                   {
                     if (c != '\\') FREE_STACK_RETURN (REG_EBRACE);
 
@@ -2371,9 +3031,9 @@
 
                 if (c != '}')
                   {
-                    if (syntax & RE_NO_BK_BRACES)
+                    if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
                       goto unfetch_interval;
-                    else 
+                    else
                       FREE_STACK_RETURN (REG_BADBR);
                   }
 
@@ -2409,7 +3069,7 @@
                       jump_n <succeed_n addr> <jump count>
                     (The upper bound and `jump_n' are omitted if
                     `upper_bound' is 1, though.)  */
-                 else 
+                 else
                    { /* If the upper bound is > 1, we need to insert
                         more at the end of the loop.  */
                      unsigned nbytes = 10 + (upper_bound > 1) * 10;
@@ -2426,7 +3086,7 @@
                                    lower_bound);
                      b += 5;
 
-                     /* Code to initialize the lower bound.  Insert 
+                     /* Code to initialize the lower bound.  Insert
                         before the `succeed_n'.  The `5' is the last two
                         bytes of this `set_number_at', plus 3 bytes of
                         the following `succeed_n'.  */
@@ -2437,7 +3097,7 @@
                        { /* More than one repetition is allowed, so
                             append a backward jump to the `succeed_n'
                             that starts this interval.
-                            
+
                             When we've reached this during matching,
                             we'll have matched the interval once, so
                             jump back only `upper_bound - 1' times.  */
@@ -2455,7 +3115,7 @@
                             so everything is getting moved up by 5.
                             Conclusion: (b - 2) - (laststart + 3) + 5,
                             i.e., b - laststart.
-                            
+
                             We insert this at the beginning of the loop
                             so that if we fail during matching, we'll
                             reinitialize the bounds.  */
@@ -2476,7 +3136,7 @@
                beg_interval = NULL;
 
                /* normal_char and normal_backslash need `c'.  */
-               PATFETCH (c);	
+               PATFETCH (c);
 
                if (!(syntax & RE_NO_BK_BRACES))
                  {
@@ -2492,7 +3152,7 @@
               BUF_PUSH (at_dot);
               break;
 
-            case 's':	
+            case 's':
               laststart = b;
               PATFETCH (c);
               BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
@@ -2507,38 +3167,54 @@
 
 
             case 'w':
+	      if (syntax & RE_NO_GNU_OPS)
+		goto normal_char;
               laststart = b;
               BUF_PUSH (wordchar);
               break;
 
 
             case 'W':
+	      if (syntax & RE_NO_GNU_OPS)
+		goto normal_char;
               laststart = b;
               BUF_PUSH (notwordchar);
               break;
 
 
             case '<':
+	      if (syntax & RE_NO_GNU_OPS)
+		goto normal_char;
               BUF_PUSH (wordbeg);
               break;
 
             case '>':
+	      if (syntax & RE_NO_GNU_OPS)
+		goto normal_char;
               BUF_PUSH (wordend);
               break;
 
             case 'b':
+	      if (syntax & RE_NO_GNU_OPS)
+		goto normal_char;
               BUF_PUSH (wordbound);
               break;
 
             case 'B':
+	      if (syntax & RE_NO_GNU_OPS)
+		goto normal_char;
               BUF_PUSH (notwordbound);
               break;
 
             case '`':
+	      if (syntax & RE_NO_GNU_OPS)
+		goto normal_char;
               BUF_PUSH (begbuf);
               break;
 
             case '\'':
+	      if (syntax & RE_NO_GNU_OPS)
+		goto normal_char;
               BUF_PUSH (endbuf);
               break;
 
@@ -2553,7 +3229,7 @@
                 FREE_STACK_RETURN (REG_ESUBREG);
 
               /* Can't back reference to a subexpression if inside of it.  */
-              if (group_in_compile_stack (compile_stack, c1))
+              if (group_in_compile_stack (compile_stack, (regnum_t) c1))
                 goto normal_char;
 
               laststart = b;
@@ -2583,11 +3259,11 @@
         /* Expects the character in `c'.  */
 	normal_char:
 	      /* If no exactn currently being built.  */
-          if (!pending_exact 
+          if (!pending_exact
 
               /* If last exactn not at current position.  */
               || pending_exact + *pending_exact + 1 != b
-              
+
               /* We have only one byte following the exactn for the count.  */
 	      || *pending_exact == (1 << BYTEWIDTH) - 1
 
@@ -2602,26 +3278,26 @@
                       : (p[0] == '\\' && p[1] == '{'))))
 	    {
 	      /* Start building a new exactn.  */
-              
+
               laststart = b;
 
 	      BUF_PUSH_2 (exactn, 0);
 	      pending_exact = b - 1;
             }
-            
+
 	  BUF_PUSH (c);
           (*pending_exact)++;
 	  break;
         } /* switch (c) */
     } /* while p != pend */
+
 
-  
   /* Through the pattern now.  */
-  
+
   if (fixup_alt_jump)
     STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
 
-  if (!COMPILE_STACK_EMPTY) 
+  if (!COMPILE_STACK_EMPTY)
     FREE_STACK_RETURN (REG_EPAREN);
 
   /* If we don't want backtracking, force success
@@ -2656,27 +3332,27 @@
       {
 	fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS);
 
-#ifdef emacs
+# ifdef emacs
 	if (! fail_stack.stack)
 	  fail_stack.stack
-	    = (fail_stack_elt_t *) xmalloc (fail_stack.size 
+	    = (fail_stack_elt_t *) xmalloc (fail_stack.size
 					    * sizeof (fail_stack_elt_t));
 	else
 	  fail_stack.stack
 	    = (fail_stack_elt_t *) xrealloc (fail_stack.stack,
 					     (fail_stack.size
 					      * sizeof (fail_stack_elt_t)));
-#else /* not emacs */
+# else /* not emacs */
 	if (! fail_stack.stack)
 	  fail_stack.stack
-	    = (fail_stack_elt_t *) malloc (fail_stack.size 
+	    = (fail_stack_elt_t *) malloc (fail_stack.size
 					   * sizeof (fail_stack_elt_t));
 	else
 	  fail_stack.stack
 	    = (fail_stack_elt_t *) realloc (fail_stack.stack,
 					    (fail_stack.size
 					     * sizeof (fail_stack_elt_t)));
-#endif /* not emacs */
+# endif /* not emacs */
       }
 
     regex_grow_registers (num_regs);
@@ -2723,14 +3399,14 @@
     re_opcode_t op;
     unsigned char *loc;
     int arg;
-    unsigned char *end;    
+    unsigned char *end;
 {
   register unsigned char *pfrom = end;
   register unsigned char *pto = end + 3;
 
   while (pfrom != loc)
     *--pto = *--pfrom;
-    
+
   store_op1 (op, loc, arg);
 }
 
@@ -2742,14 +3418,14 @@
     re_opcode_t op;
     unsigned char *loc;
     int arg1, arg2;
-    unsigned char *end;    
+    unsigned char *end;
 {
   register unsigned char *pfrom = end;
   register unsigned char *pto = end + 5;
 
   while (pfrom != loc)
     *--pto = *--pfrom;
-    
+
   store_op2 (op, loc, arg1, arg2);
 }
 
@@ -2765,7 +3441,7 @@
 {
   const char *prev = p - 2;
   boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
-  
+
   return
        /* After a subexpression?  */
        (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
@@ -2780,12 +3456,12 @@
 static boolean
 at_endline_loc_p (p, pend, syntax)
     const char *p, *pend;
-    int syntax;
+    reg_syntax_t syntax;
 {
   const char *next = p;
   boolean next_backslash = *next == '\\';
   const char *next_next = p + 1 < pend ? p + 1 : 0;
-  
+
   return
        /* Before a subexpression?  */
        (syntax & RE_NO_BK_PARENS ? *next == ')'
@@ -2796,7 +3472,7 @@
 }
 
 
-/* Returns true if REGNUM is in one of COMPILE_STACK's elements and 
+/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
    false if it's not.  */
 
 static boolean
@@ -2806,8 +3482,8 @@
 {
   int this_element;
 
-  for (this_element = compile_stack.avail - 1;  
-       this_element >= 0; 
+  for (this_element = compile_stack.avail - 1;
+       this_element >= 0;
        this_element--)
     if (compile_stack.stack[this_element].regnum == regnum)
       return true;
@@ -2821,56 +3497,71 @@
    starting character is in `P[-2]'.  (`P[-1]' is the character `-'.)
    Then we set the translation of all bits between the starting and
    ending characters (inclusive) in the compiled pattern B.
-   
+
    Return an error code.
-   
+
    We use these short variable names so we can use the same macros as
    `regex_compile' itself.  */
 
 static reg_errcode_t
-compile_range (p_ptr, pend, translate, syntax, b)
-    const char **p_ptr, *pend;
-    char *translate;
-    reg_syntax_t syntax;
-    unsigned char *b;
+compile_range (range_start_char, p_ptr, pend, translate, syntax, b)
+     unsigned int range_start_char;
+     const char **p_ptr, *pend;
+     RE_TRANSLATE_TYPE translate;
+     reg_syntax_t syntax;
+     unsigned char *b;
 {
   unsigned this_char;
-
   const char *p = *p_ptr;
-  int range_start, range_end;
-  
+  reg_errcode_t ret;
+#if _LIBC
+  const unsigned char *collseq;
+  unsigned int start_colseq;
+  unsigned int end_colseq;
+#else
+  unsigned end_char;
+#endif
+
   if (p == pend)
     return REG_ERANGE;
 
-  /* Even though the pattern is a signed `char *', we need to fetch
-     with unsigned char *'s; if the high bit of the pattern character
-     is set, the range endpoints will be negative if we fetch using a
-     signed char *.
-
-     We also want to fetch the endpoints without translating them; the 
-     appropriate translation is done in the bit-setting loop below.  */
-  /* The SVR4 compiler on the 3B2 had trouble with unsigned const char *.  */
-  range_start = ((const unsigned char *) p)[-2];
-  range_end   = ((const unsigned char *) p)[0];
-
   /* Have to increment the pointer into the pattern string, so the
      caller isn't still at the ending character.  */
   (*p_ptr)++;
+
+  /* Report an error if the range is empty and the syntax prohibits this.  */
+  ret = syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
 
-  /* If the start is after the end, the range is empty.  */
-  if (range_start > range_end)
-    return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
+#if _LIBC
+  collseq = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
+						 _NL_COLLATE_COLLSEQMB);
+
+  start_colseq = collseq[TRANSLATE (range_start_char)];
+  end_colseq = collseq[TRANSLATE (p[0])];
+  for (this_char = 0; this_char <= (unsigned char) -1; ++this_char)
+    {
+      unsigned int this_colseq = collseq[TRANSLATE (this_char)];
 
+      if (start_colseq <= this_colseq && this_colseq <= end_colseq)
+	{
+	  SET_LIST_BIT (TRANSLATE (this_char));
+	  ret = REG_NOERROR;
+	}
+    }
+#else
   /* Here we see why `this_char' has to be larger than an `unsigned
-     char' -- the range is inclusive, so if `range_end' == 0xff
-     (assuming 8-bit characters), we would otherwise go into an infinite
-     loop, since all characters <= 0xff.  */
-  for (this_char = range_start; this_char <= range_end; this_char++)
+     char' -- we would otherwise go into an infinite loop, since all
+     characters <= 0xff.  */
+  range_start_char = TRANSLATE (range_start_char);
+  end_char = TRANSLATE (p[0]);
+  for (this_char = range_start_char; this_char <= end_char; ++this_char)
     {
       SET_LIST_BIT (TRANSLATE (this_char));
+      ret = REG_NOERROR;
     }
-  
-  return REG_NOERROR;
+#endif
+
+  return ret;
 }
 
 /* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
@@ -2880,7 +3571,7 @@
 
    The caller must supply the address of a (1 << BYTEWIDTH)-byte data
    area as BUFP->fastmap.
-   
+
    We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
    the pattern buffer.
 
@@ -2897,18 +3588,15 @@
 #ifndef REGEX_MALLOC
   char *destination;
 #endif
-  /* We don't push any register information onto the failure stack.  */
-  unsigned num_regs = 0;
-  
+
   register char *fastmap = bufp->fastmap;
   unsigned char *pattern = bufp->buffer;
-  unsigned long size = bufp->used;
   unsigned char *p = pattern;
-  register unsigned char *pend = pattern + size;
+  register unsigned char *pend = pattern + bufp->used;
 
+#ifdef REL_ALLOC
   /* This holds the pointer to the failure stack, when
      it is allocated relocatably.  */
-#ifdef REL_ALLOC
   fail_stack_elt_t *failure_stack_ptr;
 #endif
 
@@ -2922,12 +3610,12 @@
   boolean succeed_n_p = false;
 
   assert (fastmap != NULL && p != NULL);
-  
+
   INIT_FAIL_STACK ();
   bzero (fastmap, 1 << BYTEWIDTH);  /* Assume nothing's valid.  */
   bufp->fastmap_accurate = 1;	    /* It will be when we're done.  */
   bufp->can_be_null = 0;
-      
+
   while (1)
     {
       if (p == pend || *p == succeed)
@@ -2950,7 +3638,7 @@
 
       /* We should never be about to go beyond the end of the pattern.  */
       assert (p < pend);
-      
+
       switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
 	{
 
@@ -3073,10 +3761,10 @@
         case jump_past_alt:
 	case dummy_failure_jump:
           EXTRACT_NUMBER_AND_INCR (j, p);
-	  p += j;	
+	  p += j;
 	  if (j > 0)
 	    continue;
-            
+
           /* Jump backward implies we just went through the body of a
              loop and matched nothing.  Opcode jumped to should be
              `on_failure_jump' or `succeed_n'.  Just treat it like an
@@ -3088,10 +3776,10 @@
 
           p++;
           EXTRACT_NUMBER_AND_INCR (j, p);
-          p += j;		
-	  
+          p += j;
+
           /* If what's on the stack is where we are now, pop it.  */
-          if (!FAIL_STACK_EMPTY () 
+          if (!FAIL_STACK_EMPTY ()
 	      && fail_stack.stack[fail_stack.avail - 1].pointer == p)
             fail_stack.avail--;
 
@@ -3132,7 +3820,7 @@
 
 	case succeed_n:
           /* Get to the number of times to succeed.  */
-          p += 2;		
+          p += 2;
 
           /* Increment p past the n for when k != 0.  */
           EXTRACT_NUMBER_AND_INCR (k, p);
@@ -3178,6 +3866,9 @@
   RESET_FAIL_STACK ();
   return 0;
 } /* re_compile_fastmap */
+#ifdef _LIBC
+weak_alias (__re_compile_fastmap, re_compile_fastmap)
+#endif
 
 /* Set REGS to hold NUM_REGS registers, storing them in STARTS and
    ENDS.  Subsequent matches using PATTERN_BUFFER and REGS will use
@@ -3213,6 +3904,9 @@
       regs->start = regs->end = (regoff_t *) 0;
     }
 }
+#ifdef _LIBC
+weak_alias (__re_set_registers, re_set_registers)
+#endif
 
 /* Searching routines.  */
 
@@ -3226,25 +3920,28 @@
      int size, startpos, range;
      struct re_registers *regs;
 {
-  return re_search_2 (bufp, NULL, 0, string, size, startpos, range, 
+  return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
 		      regs, size);
 }
+#ifdef _LIBC
+weak_alias (__re_search, re_search)
+#endif
 
 
 /* Using the compiled pattern in BUFP->buffer, first tries to match the
    virtual concatenation of STRING1 and STRING2, starting first at index
    STARTPOS, then at STARTPOS + 1, and so on.
-   
+
    STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
-   
+
    RANGE is how far to scan while trying to match.  RANGE = 0 means try
    only at STARTPOS; in general, the last start tried is STARTPOS +
    RANGE.
-   
+
    In REGS, return the indices of the virtual concatenation of STRING1
    and STRING2 that matched the entire BUFP->buffer and its contained
    subexpressions.
-   
+
    Do not consider matching one past the index STOP in the virtual
    concatenation of STRING1 and STRING2.
 
@@ -3264,24 +3961,29 @@
 {
   int val;
   register char *fastmap = bufp->fastmap;
-  register char *translate = bufp->translate;
+  register RE_TRANSLATE_TYPE translate = bufp->translate;
   int total_size = size1 + size2;
   int endpos = startpos + range;
 
   /* Check for out-of-range STARTPOS.  */
   if (startpos < 0 || startpos > total_size)
     return -1;
-    
+
   /* Fix up RANGE if it might eventually take us outside
-     the virtual concatenation of STRING1 and STRING2.  */
-  if (endpos < -1)
-    range = -1 - startpos;
+     the virtual concatenation of STRING1 and STRING2.
+     Make sure we won't move STARTPOS below 0 or above TOTAL_SIZE.  */
+  if (endpos < 0)
+    range = 0 - startpos;
   else if (endpos > total_size)
     range = total_size - startpos;
 
   /* If the search isn't to be a backwards one, don't waste time in a
      search for a pattern that must be anchored.  */
-  if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0)
+  if (bufp->used > 0 && range > 0
+      && ((re_opcode_t) bufp->buffer[0] == begbuf
+	  /* `begline' is like `begbuf' if it cannot match at newlines.  */
+	  || ((re_opcode_t) bufp->buffer[0] == begline
+	      && !bufp->newline_anchor)))
     {
       if (startpos > 0)
 	return -1;
@@ -3304,10 +4006,10 @@
   if (fastmap && !bufp->fastmap_accurate)
     if (re_compile_fastmap (bufp) == -2)
       return -2;
-  
+
   /* Loop through the string, looking for a place to start matching.  */
   for (;;)
-    { 
+    {
       /* If a fastmap is supplied, skip quickly over characters that
          cannot be the start of a match.  If the pattern can match the
          null string, however, we don't need to skip characters; we want
@@ -3324,7 +4026,7 @@
                 lim = range - (size1 - startpos);
 
 	      d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
-   
+
               /* Written out as an if-else to avoid testing `translate'
                  inside the loop.  */
 	      if (translate)
@@ -3341,7 +4043,7 @@
 	  else				/* Searching backwards.  */
 	    {
 	      register char c = (size1 == 0 || startpos >= size1
-                                 ? string2[startpos - size1] 
+                                 ? string2[startpos - size1]
                                  : string1[startpos]);
 
 	      if (!fastmap[(unsigned char) TRANSLATE (c)])
@@ -3357,41 +4059,37 @@
       val = re_match_2_internal (bufp, string1, size1, string2, size2,
 				 startpos, regs, stop);
 #ifndef REGEX_MALLOC
-#ifdef C_ALLOCA
+# ifdef C_ALLOCA
       alloca (0);
+# endif
 #endif
-#endif
 
       if (val >= 0)
 	return startpos;
-        
+
       if (val == -2)
 	return -2;
 
     advance:
-      if (!range) 
+      if (!range)
         break;
-      else if (range > 0) 
+      else if (range > 0)
         {
-          range--; 
+          range--;
           startpos++;
         }
       else
         {
-          range++; 
+          range++;
           startpos--;
         }
     }
   return -1;
 } /* re_search_2 */
+#ifdef _LIBC
+weak_alias (__re_search_2, re_search_2)
+#endif
 
-/* Declarations and macros for re_match_2.  */
-
-static int bcmp_translate ();
-static boolean alt_match_null_string_p (),
-               common_op_match_null_string_p (),
-               group_match_null_string_p ();
-
 /* This converts PTR, a pointer into one of the search strings `string1'
    and `string2' into an offset from the beginning of that string.  */
 #define POINTER_TO_OFFSET(ptr)			\
@@ -3420,7 +4118,7 @@
 /* Test if at very beginning or at very end of the virtual concatenation
    of `string1' and `string2'.  If only one string, it's `string2'.  */
 #define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
-#define AT_STRINGS_END(d) ((d) == end2)	
+#define AT_STRINGS_END(d) ((d) == end2)
 
 
 /* Test if D points to a character which is word-constituent.  We have
@@ -3432,17 +4130,19 @@
            : (d) == string2 - 1 ? *(end1 - 1) : *(d))			\
    == Sword)
 
+/* Disabled due to a compiler bug -- see comment at case wordbound */
+#if 0
 /* Test if the character before D and the one at D differ with respect
    to being word-constituent.  */
 #define AT_WORD_BOUNDARY(d)						\
   (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)				\
    || WORDCHAR_P (d - 1) != WORDCHAR_P (d))
-
+#endif
 
 /* Free everything we malloc.  */
 #ifdef MATCH_MAY_ALLOCATE
-#define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
-#define FREE_VARIABLES()						\
+# define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
+# define FREE_VARIABLES()						\
   do {									\
     REGEX_FREE_STACK (fail_stack.stack);				\
     FREE_VAR (regstart);						\
@@ -3456,7 +4156,7 @@
     FREE_VAR (reg_info_dummy);						\
   } while (0)
 #else
-#define FREE_VARIABLES() ((void)0) /* Do nothing!  But inhibit gcc warning.  */
+# define FREE_VARIABLES() ((void)0) /* Do nothing!  But inhibit gcc warning. */
 #endif /* not MATCH_MAY_ALLOCATE */
 
 /* These values must meet several constraints.  They must not be valid
@@ -3483,17 +4183,35 @@
 {
   int result = re_match_2_internal (bufp, NULL, 0, string, size,
 				    pos, regs, size);
+# ifndef REGEX_MALLOC
+#  ifdef C_ALLOCA
   alloca (0);
+#  endif
+# endif
   return result;
 }
+# ifdef _LIBC
+weak_alias (__re_match, re_match)
+# endif
 #endif /* not emacs */
 
+static boolean group_match_null_string_p _RE_ARGS ((unsigned char **p,
+						    unsigned char *end,
+						register_info_type *reg_info));
+static boolean alt_match_null_string_p _RE_ARGS ((unsigned char *p,
+						  unsigned char *end,
+						register_info_type *reg_info));
+static boolean common_op_match_null_string_p _RE_ARGS ((unsigned char **p,
+							unsigned char *end,
+						register_info_type *reg_info));
+static int bcmp_translate _RE_ARGS ((const char *s1, const char *s2,
+				     int len, char *translate));
 
 /* re_match_2 matches the compiled pattern in BUFP against the
    the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
    and SIZE2, respectively).  We start matching at POS, and stop
    matching at STOP.
-   
+
    If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
    store offsets for the substring each group matched in REGS.  See the
    documentation for exactly how many groups we fill.
@@ -3513,9 +4231,16 @@
 {
   int result = re_match_2_internal (bufp, string1, size1, string2, size2,
 				    pos, regs, stop);
+#ifndef REGEX_MALLOC
+# ifdef C_ALLOCA
   alloca (0);
+# endif
+#endif
   return result;
 }
+#ifdef _LIBC
+weak_alias (__re_match_2, re_match_2)
+#endif
 
 /* This is a separate function so that we can force an alloca cleanup
    afterwards.  */
@@ -3541,7 +4266,7 @@
 
   /* Where we are in the data, and the end of the current string.  */
   const char *d, *dend;
-  
+
   /* Where we are in the pattern, and the end of the pattern.  */
   unsigned char *p = bufp->buffer;
   register unsigned char *pend = p + bufp->used;
@@ -3551,7 +4276,7 @@
   unsigned char *just_past_start_mem = 0;
 
   /* We use this to map every character in the string.  */
-  char *translate = bufp->translate;
+  RE_TRANSLATE_TYPE translate = bufp->translate;
 
   /* Failure point stack.  Each place that can handle a failure further
      down the line pushes a failure point on this stack.  It consists of
@@ -3566,24 +4291,24 @@
   fail_stack_type fail_stack;
 #endif
 #ifdef DEBUG
-  static unsigned failure_id = 0;
+  static unsigned failure_id;
   unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
 #endif
 
+#ifdef REL_ALLOC
   /* This holds the pointer to the failure stack, when
      it is allocated relocatably.  */
-#ifdef REL_ALLOC
   fail_stack_elt_t *failure_stack_ptr;
 #endif
 
   /* We fill all the registers internally, independent of what we
      return, for use in backreferences.  The number here includes
      an element for register zero.  */
-  unsigned num_regs = bufp->re_nsub + 1;
-  
+  size_t num_regs = bufp->re_nsub + 1;
+
   /* The currently active registers.  */
-  unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG;
-  unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+  active_reg_t lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+  active_reg_t highest_active_reg = NO_HIGHEST_ACTIVE_REG;
 
   /* Information on the contents of registers. These are pointers into
      the input strings; they record just what was matched (on this
@@ -3612,18 +4337,18 @@
      subexpression.  These two fields get reset each time through any
      loop their register is in.  */
 #ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global.  */
-  register_info_type *reg_info; 
+  register_info_type *reg_info;
 #endif
 
   /* The following record the register info as found in the above
-     variables when we find a match better than any we've seen before. 
+     variables when we find a match better than any we've seen before.
      This happens as we backtrack through the failure points, which in
      turn happens only if we have not yet matched the entire string. */
   unsigned best_regs_set = false;
 #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global.  */
   const char **best_regstart, **best_regend;
 #endif
-  
+
   /* Logically, this is `best_regend[0]'.  But we don't want to have to
      allocate space for that if we're not allocating space for anything
      else (see below).  Also, we never need info about register 0 for
@@ -3645,13 +4370,13 @@
 
 #ifdef DEBUG
   /* Counts the total number of registers pushed.  */
-  unsigned num_regs_pushed = 0; 	
+  unsigned num_regs_pushed = 0;
 #endif
 
   DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
-  
+
   INIT_FAIL_STACK ();
-  
+
 #ifdef MATCH_MAY_ALLOCATE
   /* Do not bother to initialize all the register variables if there are
      no groups in the pattern, as it takes a fair amount of time.  If
@@ -3670,8 +4395,8 @@
       reg_dummy = REGEX_TALLOC (num_regs, const char *);
       reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
 
-      if (!(regstart && regend && old_regstart && old_regend && reg_info 
-            && best_regstart && best_regend && reg_dummy && reg_info_dummy)) 
+      if (!(regstart && regend && old_regstart && old_regend && reg_info
+            && best_regstart && best_regend && reg_dummy && reg_info_dummy))
         {
           FREE_VARIABLES ();
           return -2;
@@ -3693,21 +4418,21 @@
       FREE_VARIABLES ();
       return -1;
     }
-    
+
   /* Initialize subexpression text positions to -1 to mark ones that no
      start_memory/stop_memory has been seen for. Also initialize the
      register information struct.  */
-  for (mcnt = 1; mcnt < num_regs; mcnt++)
+  for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
     {
-      regstart[mcnt] = regend[mcnt] 
+      regstart[mcnt] = regend[mcnt]
         = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
-        
+
       REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
       IS_ACTIVE (reg_info[mcnt]) = 0;
       MATCHED_SOMETHING (reg_info[mcnt]) = 0;
       EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
     }
-  
+
   /* We move `string1' into `string2' if the latter's empty -- but not if
      `string1' is null.  */
   if (size2 == 0 && string1 != NULL)
@@ -3732,7 +4457,7 @@
       end_match_2 = string2 + stop - size1;
     }
 
-  /* `p' scans through the pattern as `d' scans through the data. 
+  /* `p' scans through the pattern as `d' scans through the data.
      `dend' is the end of the input string that `d' points within.  `d'
      is advanced into the following input string whenever necessary, but
      this happens before fetching; therefore, at the beginning of the
@@ -3749,30 +4474,34 @@
       dend = end_match_2;
     }
 
-  DEBUG_PRINT1 ("The compiled pattern is: ");
+  DEBUG_PRINT1 ("The compiled pattern is:\n");
   DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend);
   DEBUG_PRINT1 ("The string to match is: `");
   DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
   DEBUG_PRINT1 ("'\n");
-  
+
   /* This loops over pattern commands.  It exits by returning from the
      function if the match is complete, or it drops through if the match
      fails at this starting point in the input data.  */
   for (;;)
     {
+#ifdef _LIBC
+      DEBUG_PRINT2 ("\n%p: ", p);
+#else
       DEBUG_PRINT2 ("\n0x%x: ", p);
+#endif
 
       if (p == pend)
 	{ /* End of pattern means we might have succeeded.  */
           DEBUG_PRINT1 ("end of pattern ... ");
-          
+
 	  /* If we haven't matched the entire string, and we want the
              longest match, try backtracking.  */
           if (d != end_match_2)
 	    {
 	      /* 1 if this match ends in the same string (string1 or string2)
 		 as the best previous match.  */
-	      boolean same_str_p = (FIRST_STRING_P (match_end) 
+	      boolean same_str_p = (FIRST_STRING_P (match_end)
 				    == MATCHING_IN_FIRST_STRING);
 	      /* 1 if this match is the best seen so far.  */
 	      boolean best_match_p;
@@ -3785,7 +4514,7 @@
 		best_match_p = !MATCHING_IN_FIRST_STRING;
 
               DEBUG_PRINT1 ("backtracking.\n");
-              
+
               if (!FAIL_STACK_EMPTY ())
                 { /* More failure points to try.  */
 
@@ -3794,16 +4523,16 @@
                     {
                       best_regs_set = true;
                       match_end = d;
-                      
+
                       DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
-                      
-                      for (mcnt = 1; mcnt < num_regs; mcnt++)
+
+                      for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
                         {
                           best_regstart[mcnt] = regstart[mcnt];
                           best_regend[mcnt] = regend[mcnt];
                         }
                     }
-                  goto fail;	       
+                  goto fail;
                 }
 
               /* If no failure points, don't restore garbage.  And if
@@ -3818,12 +4547,12 @@
                      strings `x-' and `y-z-', if the two strings are
                      not consecutive in memory.  */
                   DEBUG_PRINT1 ("Restoring best registers.\n");
-                  
+
                   d = match_end;
                   dend = ((d >= string1 && d <= end1)
 		           ? end_match_1 : end_match_2);
 
-		  for (mcnt = 1; mcnt < num_regs; mcnt++)
+		  for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
 		    {
 		      regstart[mcnt] = best_regstart[mcnt];
 		      regend[mcnt] = best_regend[mcnt];
@@ -3885,10 +4614,11 @@
 				  ? ((regoff_t) (d - string1))
 			          : ((regoff_t) (d - string2 + size1)));
                 }
-              
+
               /* Go through the first `min (num_regs, regs->num_regs)'
                  registers, since that is all we initialized.  */
-	      for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++)
+	      for (mcnt = 1; (unsigned) mcnt < MIN (num_regs, regs->num_regs);
+		   mcnt++)
 		{
                   if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt]))
                     regs->start[mcnt] = regs->end[mcnt] = -1;
@@ -3900,13 +4630,13 @@
 			= (regoff_t) POINTER_TO_OFFSET (regend[mcnt]);
                     }
 		}
-              
+
               /* If the regs structure we return has more elements than
                  were in the pattern, set the extra elements to -1.  If
                  we (re)allocated the registers, this is the case,
                  because we always allocate enough to have at least one
                  -1 at the end.  */
-              for (mcnt = num_regs; mcnt < regs->num_regs; mcnt++)
+              for (mcnt = num_regs; (unsigned) mcnt < regs->num_regs; mcnt++)
                 regs->start[mcnt] = regs->end[mcnt] = -1;
 	    } /* regs && !bufp->no_sub */
 
@@ -3915,8 +4645,8 @@
                         nfailure_points_pushed - nfailure_points_popped);
           DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
 
-          mcnt = d - pos - (MATCHING_IN_FIRST_STRING 
-			    ? string1 
+          mcnt = d - pos - (MATCHING_IN_FIRST_STRING
+			    ? string1
 			    : string2 - size1);
 
           DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
@@ -3952,7 +4682,8 @@
 	      do
 		{
 		  PREFETCH ();
-		  if (translate[(unsigned char) *d++] != (char) *p++)
+		  if ((unsigned char) translate[(unsigned char) *d++]
+		      != (unsigned char) *p++)
                     goto fail;
 		}
 	      while (--mcnt);
@@ -4006,7 +4737,7 @@
 	    p += 1 + *p;
 
 	    if (!not) goto fail;
-            
+
 	    SET_REGS_MATCHED ();
             d++;
 	    break;
@@ -4023,9 +4754,9 @@
 
           /* Find out if this group can match the empty string.  */
 	  p1 = p;		/* To send to group_match_null_string_p.  */
-          
+
           if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
-            REG_MATCH_NULL_STRING_P (reg_info[*p]) 
+            REG_MATCH_NULL_STRING_P (reg_info[*p])
               = group_match_null_string_p (&p1, pend, reg_info);
 
           /* Save the position in the string where we were the last time
@@ -4036,7 +4767,7 @@
           old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
                              ? REG_UNSET (regstart[*p]) ? d : regstart[*p]
                              : regstart[*p];
-	  DEBUG_PRINT2 ("  old_regstart: %d\n", 
+	  DEBUG_PRINT2 ("  old_regstart: %d\n",
 			 POINTER_TO_OFFSET (old_regstart[*p]));
 
           regstart[*p] = d;
@@ -4047,10 +4778,10 @@
 
 	  /* Clear this whenever we change the register activity status.  */
 	  set_regs_matched_done = 0;
-          
+
           /* This is the new highest active register.  */
           highest_active_reg = *p;
-          
+
           /* If nothing was active before, this is the new lowest active
              register.  */
           if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
@@ -4068,7 +4799,7 @@
            number, and the number of inner groups.  */
 	case stop_memory:
 	  DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
-             
+
           /* We need to save the string position the last time we were at
              this close-group operator in case the group is operated
              upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
@@ -4077,7 +4808,7 @@
           old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
                            ? REG_UNSET (regend[*p]) ? d : regend[*p]
 			   : regend[*p];
-	  DEBUG_PRINT2 ("      old_regend: %d\n", 
+	  DEBUG_PRINT2 ("      old_regend: %d\n",
 			 POINTER_TO_OFFSET (old_regend[*p]));
 
           regend[*p] = d;
@@ -4104,7 +4835,7 @@
               unsigned char r = *p - 1;
               while (r > 0 && !IS_ACTIVE (reg_info[r]))
                 r--;
-              
+
               /* If we end up at register zero, that means that we saved
                  the registers as the result of an `on_failure_jump', not
                  a `start_memory', and we jumped to past the innermost
@@ -4120,7 +4851,7 @@
               else
                 highest_active_reg = r;
             }
-          
+
           /* If just failed to match something this time around with a
              group that's operated on by a repetition operator, try to
              force exit from the ``loop'', and restore the register
@@ -4128,10 +4859,10 @@
              last match.  */
           if ((!MATCHED_SOMETHING (reg_info[*p])
                || just_past_start_mem == p - 1)
-	      && (p + 2) < pend)              
+	      && (p + 2) < pend)
             {
               boolean is_a_jump_n = false;
-              
+
               p1 = p + 2;
               mcnt = 0;
               switch ((re_opcode_t) *p1++)
@@ -4146,12 +4877,12 @@
 		    if (is_a_jump_n)
 		      p1 += 2;
                     break;
-                  
+
                   default:
                     /* do nothing */ ;
                 }
 	      p1 += mcnt;
-        
+
               /* If the next operation is a jump backwards in the pattern
 	         to an on_failure_jump right before the start_memory
                  corresponding to this stop_memory, exit from the loop
@@ -4165,26 +4896,27 @@
                      failed match, e.g., with `(a*)*b' against `ab' for
                      regstart[1], and, e.g., with `((a*)*(b*)*)*'
                      against `aba' for regend[3].
-                     
+
                      Also restore the registers for inner groups for,
                      e.g., `((a*)(b*))*' against `aba' (register 3 would
                      otherwise get trashed).  */
-                     
+
                   if (EVER_MATCHED_SOMETHING (reg_info[*p]))
 		    {
-		      unsigned r; 
-        
+		      unsigned r;
+
                       EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
-                      
+
 		      /* Restore this and inner groups' (if any) registers.  */
-                      for (r = *p; r < *p + *(p + 1); r++)
+                      for (r = *p; r < (unsigned) *p + (unsigned) *(p + 1);
+			   r++)
                         {
                           regstart[r] = old_regstart[r];
 
                           /* xx why this test?  */
                           if (old_regend[r] >= regstart[r])
                             regend[r] = old_regend[r];
-                        }     
+                        }
                     }
 		  p1++;
                   EXTRACT_NUMBER_AND_INCR (mcnt, p1);
@@ -4193,7 +4925,7 @@
                   goto fail;
                 }
             }
-          
+
           /* Move past the register number and the inner group count.  */
           p += 2;
           break;
@@ -4210,16 +4942,16 @@
 	    /* Can't back reference a group which we've never matched.  */
             if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
               goto fail;
-              
+
             /* Where in input to try to start matching.  */
             d2 = regstart[regno];
-            
+
             /* Where to stop matching; if both the place to start and
                the place to stop matching are in the same string, then
                set to the place to stop, otherwise, for now have to use
                the end of the first string.  */
 
-            dend2 = ((FIRST_STRING_P (regstart[regno]) 
+            dend2 = ((FIRST_STRING_P (regstart[regno])
 		      == FIRST_STRING_P (regend[regno]))
 		     ? regend[regno] : end_match_1);
 	    for (;;)
@@ -4243,17 +4975,17 @@
 
 		/* How many characters left in this segment to match.  */
 		mcnt = dend - d;
-                
+
 		/* Want how many consecutive characters we can match in
                    one shot, so, if necessary, adjust the count.  */
                 if (mcnt > dend2 - d2)
 		  mcnt = dend2 - d2;
-                  
+
 		/* Compare that many; failure if mismatch, else move
                    past them.  */
-		if (translate 
-                    ? bcmp_translate (d, d2, mcnt, translate) 
-                    : bcmp (d, d2, mcnt))
+		if (translate
+                    ? bcmp_translate (d, d2, mcnt, translate)
+                    : memcmp (d, d2, mcnt))
 		  goto fail;
 		d += mcnt, d2 += mcnt;
 
@@ -4269,7 +5001,7 @@
            `newline_anchor' is set, after newlines.  */
 	case begline:
           DEBUG_PRINT1 ("EXECUTING begline.\n");
-          
+
           if (AT_STRINGS_BEG (d))
             {
               if (!bufp->not_bol) break;
@@ -4290,7 +5022,7 @@
             {
               if (!bufp->not_eol) break;
             }
-          
+
           /* We have to ``prefetch'' the next character.  */
           else if ((d == end1 ? *string2 : *d) == '\n'
                    && bufp->newline_anchor)
@@ -4324,7 +5056,7 @@
            then the . fails against the \n.  But the next thing we want
            to do is match the \n against the \n; if we restored the
            string value, we would be back at the foo.
-           
+
            Because this is used only in specific cases, we don't need to
            check all the things that `on_failure_jump' does, to make
            sure the right things get saved on the stack.  Hence we don't
@@ -4334,16 +5066,20 @@
            case; that seems worse than this.  */
         case on_failure_keep_string_jump:
           DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
-          
+
           EXTRACT_NUMBER_AND_INCR (mcnt, p);
+#ifdef _LIBC
+          DEBUG_PRINT3 (" %d (to %p):\n", mcnt, p + mcnt);
+#else
           DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
+#endif
 
           PUSH_FAILURE_POINT (p + mcnt, NULL, -2);
           break;
 
 
 	/* Uses of on_failure_jump:
-        
+
            Each alternative starts with an on_failure_jump that points
            to the beginning of the next alternative.  Each alternative
            except the last ends with a jump that in effect jumps past
@@ -4359,14 +5095,18 @@
           DEBUG_PRINT1 ("EXECUTING on_failure_jump");
 
           EXTRACT_NUMBER_AND_INCR (mcnt, p);
+#ifdef _LIBC
+          DEBUG_PRINT3 (" %d (to %p)", mcnt, p + mcnt);
+#else
           DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt);
+#endif
 
           /* If this on_failure_jump comes right before a group (i.e.,
              the original * applied to a group), save the information
              for that group and all inner ones, so that if we fail back
              to this point, the group's information will be correct.
              For example, in \(a*\)*\1, we need the preceding group,
-             and in \(\(a*\)b*\)\2, we need the inner group.  */
+             and in \(zz\(a*\)b*\)\2, we need the inner group.  */
 
           /* We can't use `p' to check ahead because we push
              a failure point to `p + mcnt' after we do this.  */
@@ -4409,7 +5149,7 @@
                would have to backtrack because of (as in, e.g., `a*a')
                then we can change to pop_failure_jump, because we'll
                never have to backtrack.
-               
+
                This is not true in the case of alternatives: in
                `(a|ab)*' we do need to backtrack to the `ab' alternative
                (e.g., if the string was `ab').  But instead of trying to
@@ -4435,7 +5175,7 @@
 
 	    p1 = p + mcnt;
 	    /* p1[0] ... p1[2] are the `on_failure_jump' corresponding
-	       to the `maybe_finalize_jump' of this case.  Examine what 
+	       to the `maybe_finalize_jump' of this case.  Examine what
 	       follows.  */
 
             /* If we're at the end of the pattern, we can change.  */
@@ -4461,12 +5201,12 @@
                     DEBUG_PRINT3 ("  %c != %c => pop_failure_jump.\n",
                                   c, p1[5]);
                   }
-                  
+
 		else if ((re_opcode_t) p1[3] == charset
 			 || (re_opcode_t) p1[3] == charset_not)
 		  {
 		    int not = (re_opcode_t) p1[3] == charset_not;
-                    
+
 		    if (c < (unsigned char) (p1[4] * BYTEWIDTH)
 			&& p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
 		      not = !not;
@@ -4482,21 +5222,17 @@
 	      }
             else if ((re_opcode_t) *p2 == charset)
 	      {
-#ifdef DEBUG
-		register unsigned char c
-                  = *p2 == (unsigned char) endline ? '\n' : p2[2];
-#endif
-
+		/* We win if the first character of the loop is not part
+                   of the charset.  */
                 if ((re_opcode_t) p1[3] == exactn
-		    && ! ((int) p2[1] * BYTEWIDTH > (int) p1[4]
-			  && (p2[1 + p1[4] / BYTEWIDTH]
-			      & (1 << (p1[4] % BYTEWIDTH)))))
-                  {
-  		    p[-3] = (unsigned char) pop_failure_jump;
-                    DEBUG_PRINT3 ("  %c != %c => pop_failure_jump.\n",
-                                  c, p1[5]);
+ 		    && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
+ 			  && (p2[2 + p1[5] / BYTEWIDTH]
+ 			      & (1 << (p1[5] % BYTEWIDTH)))))
+		  {
+		    p[-3] = (unsigned char) pop_failure_jump;
+		    DEBUG_PRINT1 ("  No match => pop_failure_jump.\n");
                   }
-                  
+
 		else if ((re_opcode_t) p1[3] == charset_not)
 		  {
 		    int idx;
@@ -4556,7 +5292,7 @@
                actual values.  Otherwise, we will restore only one
                register from the stack, since lowest will == highest in
                `pop_failure_point'.  */
-            unsigned dummy_low_reg, dummy_high_reg;
+            active_reg_t dummy_low_reg, dummy_high_reg;
             unsigned char *pdummy;
             const char *sdummy;
 
@@ -4565,19 +5301,29 @@
                                dummy_low_reg, dummy_high_reg,
                                reg_dummy, reg_dummy, reg_info_dummy);
           }
+	  /* Note fall through.  */
+
+	unconditional_jump:
+#ifdef _LIBC
+	  DEBUG_PRINT2 ("\n%p: ", p);
+#else
+	  DEBUG_PRINT2 ("\n0x%x: ", p);
+#endif
           /* Note fall through.  */
 
-          
         /* Unconditionally jump (without popping any failure points).  */
         case jump:
-	unconditional_jump:
 	  EXTRACT_NUMBER_AND_INCR (mcnt, p);	/* Get the amount to jump.  */
           DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt);
 	  p += mcnt;				/* Do the jump.  */
+#ifdef _LIBC
+          DEBUG_PRINT2 ("(to %p).\n", p);
+#else
           DEBUG_PRINT2 ("(to 0x%x).\n", p);
+#endif
 	  break;
+
 
-	
         /* We need this opcode so we can detect where alternatives end
            in `group_match_null_string_p' et al.  */
         case jump_past_alt:
@@ -4594,7 +5340,7 @@
           DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n");
           /* It doesn't matter what we push for the string here.  What
              the code at `fail' tests is the value for the pattern.  */
-          PUSH_FAILURE_POINT (0, 0, -2);
+          PUSH_FAILURE_POINT (NULL, NULL, -2);
           goto unconditional_jump;
 
 
@@ -4607,12 +5353,12 @@
           DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n");
           /* See comments just above at `dummy_failure_jump' about the
              two zeroes.  */
-          PUSH_FAILURE_POINT (0, 0, -2);
+          PUSH_FAILURE_POINT (NULL, NULL, -2);
           break;
 
         /* Have to succeed matching what follows at least n times.
            After that, handle like `on_failure_jump'.  */
-        case succeed_n: 
+        case succeed_n:
           EXTRACT_NUMBER (mcnt, p + 2);
           DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
 
@@ -4623,18 +5369,26 @@
                mcnt--;
 	       p += 2;
                STORE_NUMBER_AND_INCR (p, mcnt);
-               DEBUG_PRINT3 ("  Setting 0x%x to %d.\n", p, mcnt);
+#ifdef _LIBC
+               DEBUG_PRINT3 ("  Setting %p to %d.\n", p - 2, mcnt);
+#else
+               DEBUG_PRINT3 ("  Setting 0x%x to %d.\n", p - 2, mcnt);
+#endif
             }
 	  else if (mcnt == 0)
             {
+#ifdef _LIBC
+              DEBUG_PRINT2 ("  Setting two bytes from %p to no_op.\n", p+2);
+#else
               DEBUG_PRINT2 ("  Setting two bytes from 0x%x to no_op.\n", p+2);
+#endif
 	      p[2] = (unsigned char) no_op;
               p[3] = (unsigned char) no_op;
               goto on_failure;
             }
           break;
-        
-        case jump_n: 
+
+        case jump_n:
           EXTRACT_NUMBER (mcnt, p + 2);
           DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
 
@@ -4643,13 +5397,18 @@
             {
                mcnt--;
                STORE_NUMBER (p + 2, mcnt);
-	       goto unconditional_jump;	     
+#ifdef _LIBC
+               DEBUG_PRINT3 ("  Setting %p to %d.\n", p + 2, mcnt);
+#else
+               DEBUG_PRINT3 ("  Setting 0x%x to %d.\n", p + 2, mcnt);
+#endif
+	       goto unconditional_jump;
             }
           /* If don't have to jump any more, skip over the rest of command.  */
-	  else      
-	    p += 4;		     
+	  else
+	    p += 4;
           break;
-        
+
 	case set_number_at:
 	  {
             DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
@@ -4657,22 +5416,63 @@
             EXTRACT_NUMBER_AND_INCR (mcnt, p);
             p1 = p + mcnt;
             EXTRACT_NUMBER_AND_INCR (mcnt, p);
+#ifdef _LIBC
+            DEBUG_PRINT3 ("  Setting %p to %d.\n", p1, mcnt);
+#else
             DEBUG_PRINT3 ("  Setting 0x%x to %d.\n", p1, mcnt);
+#endif
 	    STORE_NUMBER (p1, mcnt);
             break;
           }
 
-        case wordbound:
-          DEBUG_PRINT1 ("EXECUTING wordbound.\n");
-          if (AT_WORD_BOUNDARY (d))
+#if 0
+	/* The DEC Alpha C compiler 3.x generates incorrect code for the
+	   test  WORDCHAR_P (d - 1) != WORDCHAR_P (d)  in the expansion of
+	   AT_WORD_BOUNDARY, so this code is disabled.  Expanding the
+	   macro and introducing temporary variables works around the bug.  */
+
+	case wordbound:
+	  DEBUG_PRINT1 ("EXECUTING wordbound.\n");
+	  if (AT_WORD_BOUNDARY (d))
 	    break;
-          goto fail;
+	  goto fail;
 
 	case notwordbound:
-          DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
+	  DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
 	  if (AT_WORD_BOUNDARY (d))
 	    goto fail;
-          break;
+	  break;
+#else
+	case wordbound:
+	{
+	  boolean prevchar, thischar;
+
+	  DEBUG_PRINT1 ("EXECUTING wordbound.\n");
+	  if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
+	    break;
+
+	  prevchar = WORDCHAR_P (d - 1);
+	  thischar = WORDCHAR_P (d);
+	  if (prevchar != thischar)
+	    break;
+	  goto fail;
+	}
+
+      case notwordbound:
+	{
+	  boolean prevchar, thischar;
+
+	  DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
+	  if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
+	    goto fail;
+
+	  prevchar = WORDCHAR_P (d - 1);
+	  thischar = WORDCHAR_P (d);
+	  if (prevchar != thischar)
+	    goto fail;
+	  break;
+	}
+#endif
 
 	case wordbeg:
           DEBUG_PRINT1 ("EXECUTING wordbeg.\n");
@@ -4693,13 +5493,13 @@
  	  if (PTR_CHAR_POS ((unsigned char *) d) >= point)
   	    goto fail;
   	  break;
-  
+
   	case at_dot:
           DEBUG_PRINT1 ("EXECUTING at_dot.\n");
  	  if (PTR_CHAR_POS ((unsigned char *) d) != point)
   	    goto fail;
   	  break;
-  
+
   	case after_dot:
           DEBUG_PRINT1 ("EXECUTING after_dot.\n");
           if (PTR_CHAR_POS ((unsigned char *) d) <= point)
@@ -4749,7 +5549,7 @@
 	  SET_REGS_MATCHED ();
           d++;
 	  break;
-	  
+
 	case notwordchar:
           DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
 	  PREFETCH ();
@@ -4759,7 +5559,7 @@
           d++;
 	  break;
 #endif /* not emacs */
-          
+
         default:
           abort ();
 	}
@@ -4784,7 +5584,7 @@
           if (p < pend)
             {
               boolean is_a_jump_n = false;
-              
+
               /* If failed to a backwards jump that's part of a repetition
                  loop, need to pop this failure point and use the next one.  */
               switch ((re_opcode_t) *p)
@@ -4796,7 +5596,7 @@
                 case jump:
                   p1 = p + 1;
                   EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-                  p1 += mcnt;	
+                  p1 += mcnt;
 
                   if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
                       || (!is_a_jump_n
@@ -4827,10 +5627,10 @@
 
 
 /* We are passed P pointing to a register number after a start_memory.
-   
+
    Return true if the pattern up to the corresponding stop_memory can
    match the empty string, and false otherwise.
-   
+
    If we find the matching stop_memory, sets P to point to one past its number.
    Otherwise, sets P to an undefined byte less than or equal to END.
 
@@ -4844,20 +5644,20 @@
   int mcnt;
   /* Point to after the args to the start_memory.  */
   unsigned char *p1 = *p + 2;
-  
+
   while (p1 < end)
     {
       /* Skip over opcodes that can match nothing, and return true or
 	 false, as appropriate, when we get to one that can't, or to the
          matching stop_memory.  */
-      
+
       switch ((re_opcode_t) *p1)
         {
         /* Could be either a loop or a series of alternatives.  */
         case on_failure_jump:
           p1++;
           EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-          
+
           /* If the next operation is not a jump backwards in the
 	     pattern.  */
 
@@ -4871,7 +5671,7 @@
 
                  /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
                  /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
-                 /exactn/1/c						
+                 /exactn/1/c
 
                  So, we have to first go through the first (n-1)
                  alternatives and then deal with the last one separately.  */
@@ -4887,19 +5687,19 @@
                      is, including the ending `jump_past_alt' and
                      its number.  */
 
-                  if (!alt_match_null_string_p (p1, p1 + mcnt - 3, 
+                  if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
 				                      reg_info))
                     return false;
 
                   /* Move to right after this alternative, including the
 		     jump_past_alt.  */
-                  p1 += mcnt;	
+                  p1 += mcnt;
 
                   /* Break if it's the beginning of an n-th alternative
                      that doesn't begin with an on_failure_jump.  */
                   if ((re_opcode_t) *p1 != on_failure_jump)
                     break;
-		
+
 		  /* Still have to check that it's not an n-th
 		     alternative that starts with an on_failure_jump.  */
 		  p1++;
@@ -4924,14 +5724,14 @@
             } /* if mcnt > 0 */
           break;
 
-          
+
         case stop_memory:
 	  assert (p1[1] == **p);
           *p = p1 + 2;
           return true;
+
 
-        
-        default: 
+        default:
           if (!common_op_match_null_string_p (&p1, end, reg_info))
             return false;
         }
@@ -4944,7 +5744,7 @@
 /* Similar to group_match_null_string_p, but doesn't deal with alternatives:
    It expects P to be the first byte of a single alternative and END one
    byte past the last. The alternative can contain groups.  */
-   
+
 static boolean
 alt_match_null_string_p (p, end, reg_info)
     unsigned char *p, *end;
@@ -4952,12 +5752,12 @@
 {
   int mcnt;
   unsigned char *p1 = p;
-  
+
   while (p1 < end)
     {
-      /* Skip over opcodes that can match nothing, and break when we get 
+      /* Skip over opcodes that can match nothing, and break when we get
          to one that can't.  */
-      
+
       switch ((re_opcode_t) *p1)
         {
 	/* It's a loop.  */
@@ -4966,8 +5766,8 @@
           EXTRACT_NUMBER_AND_INCR (mcnt, p1);
           p1 += mcnt;
           break;
-          
-	default: 
+
+	default:
           if (!common_op_match_null_string_p (&p1, end, reg_info))
             return false;
         }
@@ -4978,8 +5778,8 @@
 
 
 /* Deals with the ops common to group_match_null_string_p and
-   alt_match_null_string_p.  
-   
+   alt_match_null_string_p.
+
    Sets P to one after the op and its arguments, if any.  */
 
 static boolean
@@ -5014,7 +5814,7 @@
       reg_no = *p1;
       assert (reg_no > 0 && reg_no <= MAX_REGNUM);
       ret = group_match_null_string_p (&p1, end, reg_info);
-      
+
       /* Have to set this here in case we're checking a group which
          contains a group and a back reference to it.  */
 
@@ -5024,7 +5824,7 @@
       if (!ret)
         return false;
       break;
-          
+
     /* If this is an optimized succeed_n for zero times, make the jump.  */
     case jump:
       EXTRACT_NUMBER_AND_INCR (mcnt, p1);
@@ -5036,7 +5836,7 @@
 
     case succeed_n:
       /* Get to the number of times to succeed.  */
-      p1 += 2;		
+      p1 += 2;
       EXTRACT_NUMBER_AND_INCR (mcnt, p1);
 
       if (mcnt == 0)
@@ -5049,7 +5849,7 @@
         return false;
       break;
 
-    case duplicate: 
+    case duplicate:
       if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
         return false;
       break;
@@ -5069,14 +5869,15 @@
 
 /* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
    bytes; nonzero otherwise.  */
-   
+
 static int
 bcmp_translate (s1, s2, len, translate)
-     unsigned char *s1, *s2;
+     const char *s1, *s2;
      register int len;
-     char *translate;
+     RE_TRANSLATE_TYPE translate;
 {
-  register unsigned char *p1 = s1, *p2 = s2;
+  register const unsigned char *p1 = (const unsigned char *) s1;
+  register const unsigned char *p2 = (const unsigned char *) s2;
   while (len)
     {
       if (translate[*p1++] != translate[*p2++]) return 1;
@@ -5090,10 +5891,10 @@
 /* re_compile_pattern is the GNU regular expression compiler: it
    compiles PATTERN (of length SIZE) and puts the result in BUFP.
    Returns 0 if the pattern was valid, otherwise an error string.
-   
+
    Assumes the `allocated' (and perhaps `buffer') and `translate' fields
    are set in BUFP on entry.
-   
+
    We call regex_compile to do the actual compilation.  */
 
 const char *
@@ -5103,40 +5904,49 @@
      struct re_pattern_buffer *bufp;
 {
   reg_errcode_t ret;
-  
+
   /* GNU code is written to assume at least RE_NREGS registers will be set
      (and at least one extra will be -1).  */
   bufp->regs_allocated = REGS_UNALLOCATED;
-  
+
   /* And GNU code determines whether or not to get register information
      by passing null for the REGS argument to re_match, etc., not by
      setting no_sub.  */
   bufp->no_sub = 0;
-  
+
   /* Match anchors at newline.  */
   bufp->newline_anchor = 1;
-  
+
   ret = regex_compile (pattern, length, re_syntax_options, bufp);
 
   if (!ret)
     return NULL;
-  return gettext (re_error_msgid[(int) ret]);
-}     
+  return gettext (re_error_msgid + re_error_msgid_idx[(int) ret]);
+}
+#ifdef _LIBC
+weak_alias (__re_compile_pattern, re_compile_pattern)
+#endif
 
 /* Entry points compatible with 4.2 BSD regex library.  We don't define
    them unless specifically requested.  */
 
-#ifdef _REGEX_RE_COMP
+#if defined _REGEX_RE_COMP || defined _LIBC
 
 /* BSD has one and only one pattern buffer.  */
 static struct re_pattern_buffer re_comp_buf;
 
 char *
+#ifdef _LIBC
+/* Make these definitions weak in libc, so POSIX programs can redefine
+   these names if they don't use our functions, and still use
+   regcomp/regexec below without link errors.  */
+weak_function
+#endif
 re_comp (s)
     const char *s;
 {
   reg_errcode_t ret;
-  
+
   if (!s)
     {
       if (!re_comp_buf.buffer)
@@ -5148,12 +5958,14 @@
     {
       re_comp_buf.buffer = (unsigned char *) malloc (200);
       if (re_comp_buf.buffer == NULL)
-        return gettext (re_error_msgid[(int) REG_ESPACE]);
+        return (char *) gettext (re_error_msgid
+				 + re_error_msgid_idx[(int) REG_ESPACE]);
       re_comp_buf.allocated = 200;
 
       re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
       if (re_comp_buf.fastmap == NULL)
-	return gettext (re_error_msgid[(int) REG_ESPACE]);
+	return (char *) gettext (re_error_msgid
+				 + re_error_msgid_idx[(int) REG_ESPACE]);
     }
 
   /* Since `re_exec' always passes NULL for the `regs' argument, we
@@ -5163,16 +5975,19 @@
   re_comp_buf.newline_anchor = 1;
 
   ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
-  
+
   if (!ret)
     return NULL;
 
   /* Yes, we're discarding `const' here if !HAVE_LIBINTL.  */
-  return (char *) gettext (re_error_msgid[(int) ret]);
+  return (char *) gettext (re_error_msgid + re_error_msgid_idx[(int) ret]);
 }
 
 
 int
+#ifdef _LIBC
+weak_function
+#endif
 re_exec (s)
     const char *s;
 {
@@ -5180,6 +5995,7 @@
   return
     0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
 }
+
 #endif /* _REGEX_RE_COMP */
 
 /* POSIX.2 functions.  Don't define these for Emacs.  */
@@ -5197,7 +6013,8 @@
        REG_EXTENDED bit in CFLAGS is set; otherwise, to
        RE_SYNTAX_POSIX_BASIC;
      `newline_anchor' to REG_NEWLINE being set in CFLAGS;
-     `fastmap' and `fastmap_accurate' to zero;
+     `fastmap' to an allocated space for the fastmap;
+     `fastmap_accurate' to zero;
      `re_nsub' to the number of subexpressions in PATTERN.
 
    PATTERN is the address of the pattern string.
@@ -5223,11 +6040,11 @@
 int
 regcomp (preg, pattern, cflags)
     regex_t *preg;
-    const char *pattern; 
+    const char *pattern;
     int cflags;
 {
   reg_errcode_t ret;
-  unsigned syntax
+  reg_syntax_t syntax
     = (cflags & REG_EXTENDED) ?
       RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
 
@@ -5235,24 +6052,23 @@
   preg->buffer = 0;
   preg->allocated = 0;
   preg->used = 0;
-  
-  /* Don't bother to use a fastmap when searching.  This simplifies the
-     REG_NEWLINE case: if we used a fastmap, we'd have to put all the
-     characters after newlines into the fastmap.  This way, we just try
-     every character.  */
-  preg->fastmap = 0;
-  
+
+  /* Try to allocate space for the fastmap.  */
+  preg->fastmap = (char *) malloc (1 << BYTEWIDTH);
+
   if (cflags & REG_ICASE)
     {
       unsigned i;
-      
-      preg->translate = (char *) malloc (CHAR_SET_SIZE);
+
+      preg->translate
+	= (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE
+				      * sizeof (*(RE_TRANSLATE_TYPE)0));
       if (preg->translate == NULL)
         return (int) REG_ESPACE;
 
       /* Map uppercase characters to corresponding lowercase ones.  */
       for (i = 0; i < CHAR_SET_SIZE; i++)
-        preg->translate[i] = ISUPPER (i) ? tolower (i) : i;
+        preg->translate[i] = ISUPPER (i) ? TOLOWER (i) : i;
     }
   else
     preg->translate = NULL;
@@ -5270,38 +6086,54 @@
 
   preg->no_sub = !!(cflags & REG_NOSUB);
 
-  /* POSIX says a null character in the pattern terminates it, so we 
+  /* POSIX says a null character in the pattern terminates it, so we
      can use strlen here in compiling the pattern.  */
   ret = regex_compile (pattern, strlen (pattern), syntax, preg);
-  
+
   /* POSIX doesn't distinguish between an unmatched open-group and an
      unmatched close-group: both are REG_EPAREN.  */
   if (ret == REG_ERPAREN) ret = REG_EPAREN;
-  
+
+  if (ret == REG_NOERROR && preg->fastmap)
+    {
+      /* Compute the fastmap now, since regexec cannot modify the pattern
+	 buffer.  */
+      if (re_compile_fastmap (preg) == -2)
+	{
+	  /* Some error occurred while computing the fastmap, just forget
+	     about it.  */
+	  free (preg->fastmap);
+	  preg->fastmap = NULL;
+	}
+    }
+
   return (int) ret;
 }
+#ifdef _LIBC
+weak_alias (__regcomp, regcomp)
+#endif
 
 
 /* regexec searches for a given pattern, specified by PREG, in the
    string STRING.
-   
+
    If NMATCH is zero or REG_NOSUB was set in the cflags argument to
    `regcomp', we ignore PMATCH.  Otherwise, we assume PMATCH has at
    least NMATCH elements, and we set them to the offsets of the
    corresponding matched substrings.
-   
+
    EFLAGS specifies `execution flags' which affect matching: if
    REG_NOTBOL is set, then ^ does not match at the beginning of the
    string; if REG_NOTEOL is set, then $ does not match at the end.
-   
+
    We return 0 if we find a match and REG_NOMATCH if not.  */
 
 int
 regexec (preg, string, nmatch, pmatch, eflags)
     const regex_t *preg;
-    const char *string; 
-    size_t nmatch; 
-    regmatch_t pmatch[]; 
+    const char *string;
+    size_t nmatch;
+    regmatch_t pmatch[];
     int eflags;
 {
   int ret;
@@ -5311,29 +6143,29 @@
   boolean want_reg_info = !preg->no_sub && nmatch > 0;
 
   private_preg = *preg;
-  
+
   private_preg.not_bol = !!(eflags & REG_NOTBOL);
   private_preg.not_eol = !!(eflags & REG_NOTEOL);
-  
+
   /* The user has told us exactly how many registers to return
      information about, via `nmatch'.  We have to pass that on to the
      matching routines.  */
   private_preg.regs_allocated = REGS_FIXED;
-  
+
   if (want_reg_info)
     {
       regs.num_regs = nmatch;
-      regs.start = TALLOC (nmatch, regoff_t);
-      regs.end = TALLOC (nmatch, regoff_t);
-      if (regs.start == NULL || regs.end == NULL)
+      regs.start = TALLOC (nmatch * 2, regoff_t);
+      if (regs.start == NULL)
         return (int) REG_NOMATCH;
+      regs.end = regs.start + nmatch;
     }
 
   /* Perform the searching operation.  */
   ret = re_search (&private_preg, string, len,
                    /* start: */ 0, /* range: */ len,
                    want_reg_info ? &regs : (struct re_registers *) 0);
-  
+
   /* Copy the register information to the POSIX structure.  */
   if (want_reg_info)
     {
@@ -5350,12 +6182,14 @@
 
       /* If we needed the temporary register info, free the space now.  */
       free (regs.start);
-      free (regs.end);
     }
 
   /* We want zero return to mean success, unlike `re_search'.  */
   return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
 }
+#ifdef _LIBC
+weak_alias (__regexec, regexec)
+#endif
 
 
 /* Returns a message corresponding to an error code, ERRCODE, returned
@@ -5372,30 +6206,38 @@
   size_t msg_size;
 
   if (errcode < 0
-      || errcode >= (sizeof (re_error_msgid) / sizeof (re_error_msgid[0])))
-    /* Only error codes returned by the rest of the code should be passed 
+      || errcode >= (int) (sizeof (re_error_msgid_idx)
+			   / sizeof (re_error_msgid_idx[0])))
+    /* Only error codes returned by the rest of the code should be passed
        to this routine.  If we are given anything else, or if other regex
        code generates an invalid error code, then the program has a bug.
        Dump core so we can fix it.  */
     abort ();
 
-  msg = gettext (re_error_msgid[errcode]);
+  msg = gettext (re_error_msgid + re_error_msgid_idx[errcode]);
 
   msg_size = strlen (msg) + 1; /* Includes the null.  */
-  
+
   if (errbuf_size != 0)
     {
       if (msg_size > errbuf_size)
         {
-          strncpy (errbuf, msg, errbuf_size - 1);
+#if defined HAVE_MEMPCPY || defined _LIBC
+	  *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
+#else
+          memcpy (errbuf, msg, errbuf_size - 1);
           errbuf[errbuf_size - 1] = 0;
+#endif
         }
       else
-        strcpy (errbuf, msg);
+        memcpy (errbuf, msg, msg_size);
     }
 
   return msg_size;
 }
+#ifdef _LIBC
+weak_alias (__regerror, regerror)
+#endif
 
 
 /* Free dynamically allocated space used by PREG.  */
@@ -5407,7 +6249,7 @@
   if (preg->buffer != NULL)
     free (preg->buffer);
   preg->buffer = NULL;
-  
+
   preg->allocated = 0;
   preg->used = 0;
 
@@ -5420,13 +6262,8 @@
     free (preg->translate);
   preg->translate = NULL;
 }
+#ifdef _LIBC
+weak_alias (__regfree, regfree)
+#endif
 
 #endif /* not emacs  */
-
-/*
-Local variables:
-make-backup-files: t
-version-control: t
-trim-versions-without-asking: nil
-End:
-*/
Index: zmailer/libsh/regex.h
diff -u zmailer/libsh/regex.h:1.4 zmailer/libsh/regex.h:1.7
--- zmailer/libsh/regex.h:1.4	Sat Jun 27 03:30:04 1998
+++ zmailer/libsh/regex.h	Mon Mar 12 11:12:34 2001
@@ -1,48 +1,62 @@
 /* Definitions for data structures and routines for the regular
    expression library, version 0.12.
+   Copyright (C) 1985,1989-1993,1995-1998, 2000 Free Software Foundation, Inc.
 
-   Copyright (C) 1985, 89, 90, 91, 92, 93, 95 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.  Its master source is NOT part of
+   the C library, however.  The master source lives in /gd/gnu/lib.
 
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
+   The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
-
-#ifndef __REGEXP_LIBRARY_H__
-#define __REGEXP_LIBRARY_H__
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _REGEX_H
+#define _REGEX_H 1
+
+/* Allow the use in C++ code.  */
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* POSIX says that <sys/types.h> must be included (by the caller) before
    <regex.h>.  */
 
-#if !defined (_POSIX_C_SOURCE) && !defined (_POSIX_SOURCE) && defined (VMS)
+#if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS
 /* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
    should be there.  */
-#include <stddef.h>
+# include <stddef.h>
 #endif
 
+/* The following two types have to be signed and unsigned integer type
+   wide enough to hold a value of a pointer.  For most ANSI compilers
+   ptrdiff_t and size_t should be likely OK.  Still size of these two
+   types is 2 for Microsoft C.  Ugh... */
+typedef long int s_reg_t;
+typedef unsigned long int active_reg_t;
 
 /* The following bits are used to determine the regexp syntax we
    recognize.  The set/not-set meanings are chosen so that Emacs syntax
    remains the value 0.  The bits are given in alphabetical order, and
    the definitions shifted by one from the previous bit; thus, when we
    add or remove a bit, only one other definition need change.  */
-typedef unsigned long reg_syntax_t;
+typedef unsigned long int reg_syntax_t;
 
 /* If this bit is not set, then \ inside a bracket expression is literal.
    If set, then such a \ quotes the following character.  */
-#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
+#define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
 
 /* If this bit is not set, then + and ? are operators, and \+ and \? are
-     literals. 
+     literals.
    If set, then \+ and \? are operators and + and ? are literals.  */
 #define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
 
@@ -58,7 +72,7 @@
         ^  is an anchor if it is at the beginning of a regular
            expression or after an open-group or an alternation operator;
         $  is an anchor if it is at the end of a regular expression, or
-           before a close-group or an alternation operator.  
+           before a close-group or an alternation operator.
 
    This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
    POSIX draft 11.2 says that * etc. in leading positions is undefined.
@@ -69,7 +83,7 @@
 /* If this bit is set, then special characters are always special
      regardless of where they are in the pattern.
    If this bit is not set, then special characters are special only in
-     some contexts; otherwise they are ordinary.  Specifically, 
+     some contexts; otherwise they are ordinary.  Specifically,
      * + ? and intervals are only special when not after the beginning,
      open-group, or alternation operator.  */
 #define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
@@ -91,7 +105,7 @@
 #define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
 
 /* If this bit is set, either \{...\} or {...} defines an
-     interval, depending on RE_NO_BK_BRACES. 
+     interval, depending on RE_NO_BK_BRACES.
    If not set, \{, \}, {, and } are literals.  */
 #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
 
@@ -116,7 +130,7 @@
    If not set, then \<digit> is a back-reference.  */
 #define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
 
-/* If this bit is set, then | is an alternation operator, and \| is literal. 
+/* If this bit is set, then | is an alternation operator, and \| is literal.
    If not set, then \| is an alternation operator, and | is literal.  */
 #define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
 
@@ -134,6 +148,18 @@
    without further backtracking.  */
 #define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
 
+/* If this bit is set, do not process the GNU regex operators.
+   If not set, then the GNU regex operators are recognized. */
+#define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
+
+/* If this bit is set, turn on internal regex debugging.
+   If not set, and debugging was on, turn it off.
+   This only works if regex.c is compiled -DDEBUG.
+   We define this bit always, so that all that's needed to turn on
+   debugging is to recompile regex.c; the calling code can always have
+   this bit set, and it won't affect anything in the normal case. */
+#define RE_DEBUG (RE_NO_GNU_OPS << 1)
+
 /* This global variable defines the particular regexp syntax to use (for
    some interfaces).  When a regexp is compiled, the syntax used is
    stored in the pattern buffer, so changing this does not affect
@@ -142,18 +168,24 @@
 
 /* Define combinations of the above bits for the standard possibilities.
    (The [[[ comments delimit what gets put into the Texinfo file, so
-   don't delete them!)  */ 
+   don't delete them!)  */
 /* [[[begin syntaxes]]] */
 #define RE_SYNTAX_EMACS 0
 
 #define RE_SYNTAX_AWK							\
-  (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL			\
-   | RE_NO_BK_PARENS            | RE_NO_BK_REFS				\
-   | RE_NO_BK_VBAR               | RE_NO_EMPTY_RANGES			\
-   | RE_UNMATCHED_RIGHT_PAREN_ORD)
+  (RE_BACKSLASH_ESCAPE_IN_LISTS   | RE_DOT_NOT_NULL			\
+   | RE_NO_BK_PARENS              | RE_NO_BK_REFS			\
+   | RE_NO_BK_VBAR                | RE_NO_EMPTY_RANGES			\
+   | RE_DOT_NEWLINE		  | RE_CONTEXT_INDEP_ANCHORS		\
+   | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
+
+#define RE_SYNTAX_GNU_AWK						\
+  ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG)	\
+   & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS))
 
 #define RE_SYNTAX_POSIX_AWK 						\
-  (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS)
+  (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS		\
+   | RE_INTERVALS	    | RE_NO_GNU_OPS)
 
 #define RE_SYNTAX_GREP							\
   (RE_BK_PLUS_QM              | RE_CHAR_CLASSES				\
@@ -189,13 +221,13 @@
   (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
 
 #define RE_SYNTAX_POSIX_EXTENDED					\
-  (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS			\
-   | RE_CONTEXT_INDEP_OPS  | RE_NO_BK_BRACES				\
-   | RE_NO_BK_PARENS       | RE_NO_BK_VBAR				\
-   | RE_UNMATCHED_RIGHT_PAREN_ORD)
+  (_RE_SYNTAX_POSIX_COMMON  | RE_CONTEXT_INDEP_ANCHORS			\
+   | RE_CONTEXT_INDEP_OPS   | RE_NO_BK_BRACES				\
+   | RE_NO_BK_PARENS        | RE_NO_BK_VBAR				\
+   | RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD)
 
-/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
-   replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added.  */
+/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is
+   removed and RE_NO_BK_REFS is added.  */
 #define RE_SYNTAX_POSIX_MINIMAL_EXTENDED				\
   (_RE_SYNTAX_POSIX_COMMON  | RE_CONTEXT_INDEP_ANCHORS			\
    | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES				\
@@ -207,9 +239,10 @@
    (erroneously) define this in other header files, but we want our
    value, so remove any previous define.  */
 #ifdef RE_DUP_MAX
-#undef RE_DUP_MAX
+# undef RE_DUP_MAX
 #endif
-#define RE_DUP_MAX ((1 << 15) - 1) 
+/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows.  */
+#define RE_DUP_MAX (0x7fff)
 
 
 /* POSIX `cflags' bits (i.e., information for `regcomp').  */
@@ -221,7 +254,7 @@
 /* If this bit is set, then ignore case when matching.
    If not set, then case is significant.  */
 #define REG_ICASE (REG_EXTENDED << 1)
- 
+
 /* If this bit is set, then anchors do not match at newline
      characters in the string.
    If not set, then anchors do match at newlines.  */
@@ -249,6 +282,10 @@
    `re_error_msg' table in regex.c.  */
 typedef enum
 {
+#ifdef _XOPEN_SOURCE
+  REG_ENOSYS = -1,	/* This will never happen for this implementation.  */
+#endif
+
   REG_NOERROR = 0,	/* Success.  */
   REG_NOMATCH,		/* Didn't find a match (for regexec).  */
 
@@ -260,7 +297,7 @@
   REG_EESCAPE,		/* Trailing backslash.  */
   REG_ESUBREG,		/* Invalid back reference.  */
   REG_EBRACK,		/* Unmatched left bracket.  */
-  REG_EPAREN,		/* Parenthesis imbalance.  */ 
+  REG_EPAREN,		/* Parenthesis imbalance.  */
   REG_EBRACE,		/* Unmatched \{.  */
   REG_BADBR,		/* Invalid contents of \{\}.  */
   REG_ERANGE,		/* Invalid range end.  */
@@ -279,6 +316,10 @@
    compiled, the `re_nsub' field is available.  All other fields are
    private to the regex routines.  */
 
+#ifndef RE_TRANSLATE_TYPE
+# define RE_TRANSLATE_TYPE char *
+#endif
+
 struct re_pattern_buffer
 {
 /* [[[begin pattern_buffer]]] */
@@ -288,10 +329,10 @@
   unsigned char *buffer;
 
 	/* Number of bytes to which `buffer' points.  */
-  unsigned long allocated;
+  unsigned long int allocated;
 
 	/* Number of bytes actually used in `buffer'.  */
-  unsigned long used;	
+  unsigned long int used;
 
         /* Syntax setting with which the pattern was compiled.  */
   reg_syntax_t syntax;
@@ -305,7 +346,7 @@
            comparing them, or zero for no translation.  The translation
            is applied to a pattern when it is compiled and to a string
            when it is matched.  */
-  char *translate;
+  RE_TRANSLATE_TYPE translate;
 
 	/* Number of subexpressions found by the compiler.  */
   size_t re_nsub;
@@ -335,7 +376,7 @@
   unsigned no_sub : 1;
 
         /* If set, a beginning-of-line anchor doesn't match at the
-           beginning of the string.  */ 
+           beginning of the string.  */
   unsigned not_bol : 1;
 
         /* Similarly for an end-of-line anchor.  */
@@ -367,7 +408,7 @@
    `re_match_2' returns information about at least this many registers
    the first time a `regs' structure is passed.  */
 #ifndef RE_NREGS
-#define RE_NREGS 30
+# define RE_NREGS 30
 #endif
 
 
@@ -390,11 +431,11 @@
 
 #if __STDC__
 
-#define _RE_ARGS(args) args
+# define _RE_ARGS(args) args
 
 #else /* not __STDC__ */
 
-#define _RE_ARGS(args) ()
+# define _RE_ARGS(args) ()
 
 #endif /* not __STDC__ */
 
@@ -407,13 +448,13 @@
    BUFFER.  Return NULL if successful, and an error string if not.  */
 extern const char *re_compile_pattern
   _RE_ARGS ((const char *pattern, size_t length,
-             regex_t *buffer));
+             struct re_pattern_buffer *buffer));
 
 
 /* Compile a fastmap for the compiled pattern in BUFFER; used to
    accelerate searches.  Return 0 if successful and -2 if was an
    internal error.  */
-extern int re_compile_fastmap _RE_ARGS ((regex_t *buffer));
+extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
 
 
 /* Search in the string STRING (with length LENGTH) for the pattern
@@ -422,29 +463,29 @@
    match, or -2 for an internal error.  Also return register
    information in REGS (if REGS and BUFFER->no_sub are nonzero).  */
 extern int re_search
-  _RE_ARGS ((regex_t *buffer, const char *str, int length, int start,
-	     int range, struct re_registers *regs));
+  _RE_ARGS ((struct re_pattern_buffer *buffer, const char *instring,
+            int length, int start, int range, struct re_registers *regs));
 
 
 /* Like `re_search', but search in the concatenation of STRING1 and
    STRING2.  Also, stop searching at index START + STOP.  */
 extern int re_search_2
-  _RE_ARGS ((struct re_pattern_buffer *buffer, const char *str1,
-             int length1, const char *str2, int length2,
+  _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
+             int length1, const char *string2, int length2,
              int start, int range, struct re_registers *regs, int stop));
 
 
 /* Like `re_search', but return how many characters in STRING the regexp
    in BUFFER matched, starting at position START.  */
 extern int re_match
-  _RE_ARGS ((regex_t *buffer, const char *str,
+  _RE_ARGS ((struct re_pattern_buffer *buffer, const char *instring,
              int length, int start, struct re_registers *regs));
 
 
 /* Relates to `re_match' as `re_search_2' relates to `re_search'.  */
-extern int re_match_2 
-  _RE_ARGS ((struct re_pattern_buffer *buffer, const char *str1,
-             int length1, const char *str2, int length2,
+extern int re_match_2
+  _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
+             int length1, const char *string2, int length2,
              int start, struct re_registers *regs, int stop));
 
 
@@ -464,23 +505,51 @@
   _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
              unsigned num_regs, regoff_t *starts, regoff_t *ends));
 
-#ifdef _REGEX_RE_COMP
+#if defined _REGEX_RE_COMP || defined _LIBC
+# ifndef _CRAY
 /* 4.2 bsd compatibility.  */
 extern char *re_comp _RE_ARGS ((const char *));
 extern int re_exec _RE_ARGS ((const char *));
+# endif
+#endif
+
+/* GCC 2.95 and later have "__restrict"; C99 compilers have
+   "restrict", and "configure" may have defined "restrict".  */
+#ifndef __restrict
+# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
+#  if defined restrict || 199901L <= __STDC_VERSION__
+#   define __restrict restrict
+#  else
+#   define __restrict
+#  endif
+# endif
+/* For now unconditionally define __restrict_arr to expand to nothing.
+   Ideally we would have a test for the compiler which allows defining
+   it to restrict.  */
+# define __restrict_arr
 #endif
 
 /* POSIX compatibility.  */
-extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
-extern int regexec
-  _RE_ARGS ((const regex_t *preg, const char *str, size_t nmatch,
-             regmatch_t pmatch[], int eflags));
-extern size_t regerror
-  _RE_ARGS ((int errcode, const regex_t *preg, char *errbuf,
-             size_t errbuf_size));
-extern void regfree _RE_ARGS ((regex_t *preg));
+extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
+			      const char *__restrict __pattern,
+			      int __cflags));
+
+extern int regexec _RE_ARGS ((const regex_t *__restrict __preg,
+			      const char *__restrict __string, size_t __nmatch,
+			      regmatch_t __pmatch[],
+			      int __eflags));
+
+extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
+				  char *__errbuf, size_t __errbuf_size));
+
+extern void regfree _RE_ARGS ((regex_t *__preg));
+
+
+#ifdef __cplusplus
+}
+#endif	/* C++ */
 
-#endif /* not __REGEXP_LIBRARY_H__ */
+#endif /* regex.h */
 
 /*
 Local variables:
Index: zmailer/libsh/zmsh.c
diff -u zmailer/libsh/zmsh.c:1.7 zmailer/libsh/zmsh.c:1.8
--- zmailer/libsh/zmsh.c:1.7	Thu Sep  9 03:10:23 1999
+++ zmailer/libsh/zmsh.c	Thu Mar  8 12:12:34 2001
@@ -22,6 +22,7 @@
 #include "splay.h"
 #include "sh.h"
 
+#include "libc.h"
 #include "libsh.h"
 
 struct cmddef commands[] = {
@@ -171,9 +172,9 @@
 		zshprofile(LOGIN_SCRIPT);
 	}
 	loadit = errflag = 0;
-	optind = 1;	/* not to be influenced by previous getopt()'s */
+	zoptind = 1;	/* Not to be influenced by previous zgetopt()'s. */
 	while (1) {
-		c = getopt(argc, (char**)argv, "CGILMOPRSYc:l:isaefhkntuvx");
+		c = zgetopt(argc, (char**)argv, "CGILMOPRSYc:l:isaefhkntuvx");
 		if (c == EOF)
 		  break;
 		switch (c) {
@@ -213,7 +214,7 @@
 				break;
 			}
 			setopt(c, 1);
-			zshprofile(optarg);
+			zshprofile(zoptarg);
 			break;
 		case 'l':	/* load the precompiled script, ignore optarg */
 		case 'i':	/* interactive shell */
@@ -245,13 +246,13 @@
 		exit(1);
 	}
 	if (!isset('s')) {
-		if (optind == argc) {
+		if (zoptind == argc) {
 			/* read commands from stdin */
 			setopt('s', 1);
-		} else if ((io = open(argv[optind], O_RDONLY, 0)) < 0) {
+		} else if ((io = open(argv[zoptind], O_RDONLY, 0)) < 0) {
 
 			fprintf(stderr, "%s: open(\"%s\"): %s\n",
-				progname, argv[optind],
+				progname, argv[zoptind],
 				strerror(errno));
 			exit(1);
 		} else if (io != 0) {
@@ -273,7 +274,7 @@
 	staticprot(& commandline); /* LispGC */
 	staticprot(& envarlist);   /* LispGC */
 
-	avcmd.argv = s_listify(argc-optind, &argv[optind]);
+	avcmd.argv = s_listify(argc-zoptind, &argv[zoptind]);
 
 	if (isset('s')) {
 		conscell *d = NULL;
@@ -299,8 +300,8 @@
 	/* we don't inherit IFS, enforced in envinit() */
 	v_set(IFS, DEFAULT_IFS);
 
-	if (isset('l') && argv[optind] != NULL)
-	  exit(leaux(-1, argv[optind], (struct stat *)NULL));
+	if (isset('l') && argv[zoptind] != NULL)
+	  exit(leaux(-1, argv[zoptind], (struct stat *)NULL));
 
 	stickymem = oval;
 }
Index: zmailer/man/smtpserver.8
diff -u zmailer/man/smtpserver.8:1.32 zmailer/man/smtpserver.8:1.33
--- zmailer/man/smtpserver.8:1.32	Tue Feb 20 20:27:02 2001
+++ zmailer/man/smtpserver.8	Fri Mar  2 12:03:01 2001
@@ -1,7 +1,7 @@
 '\" t
-.\" $Header: /home/mea/src/CVSROOT/zmailer/man/smtpserver.8,v 1.32 2001/02/20 18:27:02 mea Exp $
+.\" $Header: /home/mea/src/CVSROOT/zmailer/man/smtpserver.8,v 1.33 2001/03/02 10:03:01 mea Exp $
 .ds ]W "ZMailer 2.99"
-.TH SMTPSERVER 8 "13 Oct 2000"
+.TH SMTPSERVER 8 "2 Mar 2001"
 .SH NAME
 smtpserver \- zmailer SMTP server
 .SH SYNOPSIS
@@ -505,6 +505,10 @@
 #               # command line and a password from standard input.
 #               # Exit status 0 means successful authentication.
 #
+#PARAM  use-tcp-wrapper
+#               # If TCP-WRAPPER is configured in, uncommenting this
+#               # will activate its use to look service name:  smtp-receiver
+#
 # Disablers of some facility adverticements
 #PARAM  NoEHLO
 #PARAM  NoPIPELINING
@@ -655,7 +659,8 @@
 appears, default is to send the message into the freezer ("-1");
 .SH TCP\-WRAPPER AND SMTPSERVER
 If the ZMailer system is configured with \fItcp-wrapper\fR code,
-then service-id "\fCsmtp-receive\fR" is looked for all those addresses
+and ``PARAM use\-tcp\-wrapper'' is active in configuration,
+then service-id "\fCsmtp-receiver\fR" is looked for all those addresses
 that are allowed to feed SMTP email in.
 .P
 Usually this mode of operation is not used, and files
@@ -668,7 +673,7 @@
 \fC
    \fI/ETC/hosts.allow\fC
    mailq : ALL@1.2.3.0
-   smtp\-receive: ALL@ALL
+   smtp\-receiver: ALL@ALL
 
    \fI/ETC/hosts.deny\fC
    ALL : ALL@ALL\fR
Index: zmailer/packaging/rpm/README-RPM
diff -u zmailer/packaging/rpm/README-RPM:1.2 zmailer/packaging/rpm/README-RPM:1.4
--- zmailer/packaging/rpm/README-RPM:1.2	Tue Jun 13 08:34:04 2000
+++ zmailer/packaging/rpm/README-RPM	Mon Apr 23 14:24:32 2001
@@ -1,52 +1,64 @@
 
-* Howto make a RedHat rpm of ZMailer MTA
+ This spec has been tested on a Red Hat Linux release 6.2 x86 (Zoot)
+ plus all upgrades and a LiNUX kernel 2.2.18pre11-va2.0
+--
+* Howto make a RPM of ZMailer MTA
 
-  1. Get zmailer-spec.tar.gz from :
-      http://perso.wanadoo.es/xose/linux/zmailer-spec.tar.gz
+  1. Get zmailer-X.YY.ZZ-N.nosrc.rpm from
+      http://perso.wanadoo.es/xose
+
       This package is a posting to ZMailer mailing list and it's 
-      made by Xose Vazquez, xose@wanadoo.es
+      made by XosÉ Vázquez, xose@wanadoo.es
 
-  2. Open it 'tar xvfz zmailer-spec.tar.gz'
+  2. Install it:
 
-  3. Copy all the files into /usr/src/redhat/SOURCES directory.
+	# rpm -i zmailer-X.YY.ZZ-N.nosrc.rpm
+	
+      or decompress it:
+	
+	# rpm2cpio zmailer-X.YY.ZZ-N.nosrc.rpm | cpio -i -d
+      
+      and # mv *.spec /usr/src/redhat/SPECS ; mv * /usr/src/redhat/SOURCES
 
-  4. Get zmailer-x.yy.zz.tar.gz or the last version from :
+  3. Get zmailer-X.YY.ZZ.tar.gz from :
       ftp://ftp.funet.fi/pub/unix/mail/zmailer/src/
-      and copy it under /usr/src/redhat/SOURCES as well.
+      and copy it under /usr/src/redhat/SOURCES
+
+  4. Create your own rpm packages with the commands :
 
-      - If you get a new version, you need update the line 7 of
-        the zmailer.spec, "%define version" section.
+	# cd /usr/src/redhat/SPECS
 
-  5. Create your own rpm packages with commands:
+      - If you get a new version of zmailer, you need update the 
+	line 7 of the zmailer.spec, "%define version" section.
 
-	cd /usr/src/redhat/SOURCES
-	rpm -ba zmailer.spec
+	# rpm -ba zmailer.spec
 
-  6. rpm packages will be created under /usr/src/redhat/SRPMS (src) and
+  5. RPM packages will be created under /usr/src/redhat/SRPMS (src) and
       under /usr/src/redhat/RPMS/i386 (bin + doc)
 
-  7. Install ZMailer rpm packages into the system:
+  6. Install ZMailer rpm packages into the system:
 
-	rpm -ivh /usr/src/redhat/RPMS/i386/zmailer-x.yy.zz-n.i386.rpm
-	rpm -ivh /usr/src/redhat/RPMS/i386/zmailer-doc-x.yy.zz-n.i386.rpm
+	# rpm -ivh /usr/src/redhat/RPMS/i386/zmailer-X.YY.ZZ-N.i386.rpm
+	# rpm -ivh /usr/src/redhat/RPMS/i386/zmailer-doc-X.YY.ZZ-N.i386.rpm
 
-  8. Finish ZMailer configuration by editing the following:
+  7. Finish ZMailer configuration by editing the following:
+
         o /etc/mail.conf
         o /etc/zmailer/*
 
       For first time installations I'd recommend reading
-      /usr/doc/zmailer-x.yy.zz/* and /usr/doc/zmailer-doc-x.yy.zz/*  
+      /usr/doc/zmailer-X.YY.ZZ/* and /usr/doc/zmailer-doc-X.YY.ZZ/*
       documents.
 
 
 For more information about ZMailer just visit www.zmailer.org. For more
 information about rpm visit www.rpm.org.
   ------------------------------------------------------------------------
+
+Please e-mail me any corrections about this document: xose@wanadoo.es
 
-Please e-mail me any corrections about this document: jt@iki.fi and
-xose@wanadoo.es
+Get it the last version from  http://perso.wanadoo.es/xose
 
-Get it the last version from  http://perso.wanadoo.es/xose/linux/zmailer-spec.tar.gz
+This document come out has been updated at Fri Mar  2 10:04:09 CET 2001
+by XosÉ.
 
-This document come out has been updated Thu May 11 23:09:06 CEST 2000
-by xose.
Index: zmailer/packaging/rpm/zmailer-2.99.55-1.nosrc.rpm
Index: zmailer/packaging/rpm/zmailer-2.99.55-4.nosrc.rpm
Index: zmailer/packaging/rpm/zmailer.cron
diff -u zmailer/packaging/rpm/zmailer.cron:1.2 zmailer/packaging/rpm/zmailer.cron:1.3
--- zmailer/packaging/rpm/zmailer.cron:1.2	Tue Jun 13 08:34:04 2000
+++ zmailer/packaging/rpm/zmailer.cron	Fri Mar  2 21:32:20 2001
@@ -5,10 +5,10 @@
 ##
 
 # Resubmit deferred messages
-28 0,8,16 * * * root	. /etc/zmailer/zmailer.conf ; $MAILBIN/zmailer resubmit >> /dev/null
+28 0,8,16 * * * root	. /etc/zmailer/zmailer.conf ; $MAILBIN/zmailer resubmit > /dev/null
 
 # Cleanout public and postman directories
-7 4 * * *	root	. /etc/zmailer/zmailer.conf ; $MAILBIN/zmailer cleanup >> /dev/null
+7 4 * * *	root	. /etc/zmailer/zmailer.conf ; $MAILBIN/zmailer cleanup > /dev/null
 
 # Check if services still work
-#11 6,12,18,0	root	/usr/lib/zmailer/zmailcheck
+#11 6,12,18,0	root	. /etc/zmailer/zmailer.conf ; $MAILBIN/zmailcheck
Index: zmailer/packaging/rpm/zmailer.init
diff -u zmailer/packaging/rpm/zmailer.init:1.2 zmailer/packaging/rpm/zmailer.init:1.4
--- zmailer/packaging/rpm/zmailer.init:1.2	Tue Jun 13 08:34:04 2000
+++ zmailer/packaging/rpm/zmailer.init	Mon Apr 23 14:25:15 2001
@@ -11,32 +11,42 @@
 # pidfile: /var/spool/postoffice/.pid.scheduler .pid.smtpserver .pid.router
 
 # Source function library.
-. /etc/rc.d/init.d/functions
+if [ -f /etc/rc.d/init.d/functions ] ; then
+	. /etc/rc.d/init.d/functions
+	else
+		if [ -f /etc/init.d/functions ] ; then
+			. /etc/init.d/functions
+			else
+				exit 0
+		fi
+fi
 
 # Source networking configuration.
-. /etc/sysconfig/network
+if  [ -f  /etc/sysconfig/network ] ; then
+	. /etc/sysconfig/network
+	else
+		exit 0
+fi
 
-# Source zmailer configureation.
+# Check that networking is up.
+[ ${NETWORKING} = "no" ] && exit 0
+
+# Source zmailer configuration.
 if [ -f /etc/zmailer/zmailer.conf ] ; then
 	. /etc/zmailer/zmailer.conf
 else 
 	exit 0
 fi
 
-# Check that networking is up.
-[ ${NETWORKING} = "no" ] && exit 0
-
 [ -f $MAILBIN/zmailer ] || exit 0
 
-# See how we were called.
-case "$1" in
-  start)
+RETVAL=0
+
+start() {
 	# Start daemons.
-	# echo "Starting ZMailer: "
-	if ps auxw | egrep 'router|scheduler|smtpserver' | grep -v egrep \
-                                                     >> /dev/null ; then
+
+	if ( status scheduler || status router || status smtpserver ) | grep -v stop > /dev/null ; then
 		echo "Zmailer is running yet"
-	
 	else
 		if [ "${SMTPSERVER}" ]; then
 			$MAILBIN/zmailer smtp
@@ -44,34 +54,57 @@
 			$MAILBIN/zmailer bootclean
 			$MAILBIN/zmailer
 		fi
-	touch /var/lock/subsys/zmailer
+	RETVAL=$?
+	echo
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/zmailer
+	return $RETVAL
+
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	# Stop daemons.
-        # echo "Shutting down ZMalier: "
-	if [ ${MAILSERVER-NONE} = NONE -a -x $MAILBIN/zmailer ]; then
-		$MAILBIN/zmailer kill
+
+	if ( status scheduler || status router || status smtpserver ) | grep stop > /dev/null ; then
+		echo "Zmailer is not running"
+	else
+		if [ ${MAILSERVER-NONE} = NONE -a -x $MAILBIN/zmailer ]; then
+			$MAILBIN/zmailer kill
+		fi
+	RETVAL=$?
+        echo
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zmailer $POSTOFFICE/.pid.*
+	return $RETVAL
+
 	fi
-	rm -f /var/lock/subsys/zmailer
-	rm -f $POSTOFFICE/.pid.*
-	;;
-  restart|reload)
-        $0 stop
-        $0 start
+}
+
+# See how we were called.
+case "$1" in
+  start)
+        start
         ;;
+  stop)
+        stop
+        ;;
+  restart|reload)
+	stop
+	start
+	RETVAL=$?
+	;;
   status)
 	status router
 	status scheduler
 	status smtpserver
+	RETVAL=$?
         ;;
- logsync)
+  logsync)
         $MAILBIN/zmailer logsync
         ;;
   *)
-	echo "Usage: zmailer {start|stop|restart|reload|status|logsync}"
+	echo "Usage: $0 {start|stop|restart|reload|status|logsync}"
 	exit 1
 	;;
 esac
 
-exit 0
+exit $RETVAL
Index: zmailer/packaging/rpm/zmailer.logrotate
diff -u zmailer/packaging/rpm/zmailer.logrotate:1.2 zmailer/packaging/rpm/zmailer.logrotate:1.3
--- zmailer/packaging/rpm/zmailer.logrotate:1.2	Tue Jun 13 08:34:04 2000
+++ zmailer/packaging/rpm/zmailer.logrotate	Fri Mar  2 21:32:20 2001
@@ -1,9 +1,32 @@
 errors root@localhost
 compress
 
-/var/log/zmailer/* {
-    missingok
+/var/log/zmailer/router {
     postrotate
 	/etc/rc.d/init.d/zmailer logsync
+    endscript
+}
+
+/var/log/zmailer/scheduler {
+    postrotate
+        /etc/rc.d/init.d/zmailer logsync
+    endscript
+}
+
+/var/log/zmailer/scheduler.perflog {
+    postrotate
+        /etc/rc.d/init.d/zmailer logsync
+    endscript
+}
+
+/var/log/zmailer/smtpserver {
+    postrotate
+        /etc/rc.d/init.d/zmailer logsync
+    endscript
+}
+
+/var/log/zmailer/smtp {
+    postrotate
+        /etc/rc.d/init.d/zmailer logsync
     endscript
 }
Index: zmailer/packaging/rpm/zmailer.spec
diff -u zmailer/packaging/rpm/zmailer.spec:1.2 zmailer/packaging/rpm/zmailer.spec:1.4
--- zmailer/packaging/rpm/zmailer.spec:1.2	Tue Jun 13 08:34:04 2000
+++ zmailer/packaging/rpm/zmailer.spec	Mon Apr 23 14:25:15 2001
@@ -1,10 +1,10 @@
 #
-# Thu May 11 23:09:06 CEST 2000
+# Mon Apr 19 23:52:42 CEST 2001
 #
 
 %define name zmailer
-%define version 2.99.53pre1
-%define release 3
+%define version 2.99.55
+%define release 4
 
 Summary: Mailer for extreme performance demands, secure mail delivery agent.
 Name: %{name}
@@ -23,7 +23,8 @@
 Source5: README-RPM
 BuildRoot: /var/tmp/%{name}-%{version}-root
 Prereq: /sbin/chkconfig
-Conflicts: sendmail qmail postfix smail exim
+Conflicts: sendmail postfix qmail exim smail
+NoSource: 0
 
 %description
 This is a package that implements an internet message transfer agent
@@ -53,16 +54,18 @@
 Get the latest version of the Zmailer Manual from the zmailer web.
 
 %prep
+
 # unpack zmalier (and patch it).
 %setup -q 
 
 # build zmailer
 %build
 CFLAGS="$RPM_OPT_FLAGS" \
-	./configure --prefix=/usr/lib/zmailer \
+./configure --prefix=/usr \
+	--with-zconfig=/etc/zmailer/zmailer.conf \
+	--mandir=/usr/man \
 	--libdir=/usr/lib \
 	--includedir=/usr/include/zmailer \
-	--with-zconfig=/etc/zmailer/zmailer.conf \
 	--with-mailbox=/var/spool/mail \
 	--with-postoffice=/var/spool/postoffice \
 	--with-mailshare=/etc/zmailer \
@@ -71,72 +74,60 @@
 	--with-logdir=/var/log/zmailer \
         --with-sendmailpath=/usr/sbin/sendmail \
         --with-rmailpath=/usr/bin/rmail \
+	--with-vacationpath=/usr/bin/vacation \
         --with-system-malloc \
 	--with-ta-mmap
+
 # do you need ssl ?
+#	--with-openssl \
+#	--with-openssl-prefix=/usr \
 #	--with-openssl-include=/usr/include/openssl \
 #	--with-openssl-lib=/usr/lib \
 #
-# and ldap ?
-#	--with-ldap-include-dir=/usr/local/include \
-#	--with-ldap-library-dir=/usr/local/lib
-
-# Do you have SMP ?
-if [ -x /usr/bin/getconf ] ; then
-	NRPROC=$(/usr/bin/getconf _NPROCESSORS_ONLN)
-		if [ $NRPROC -eq 0 ] ; then
-			NRPROC=1
-		fi
-else
-	NRPROC=1
-fi
+# ldap ?
+#	--with-ldap-prefix=/usr \
+#	--with-ldap-include-dir=/usr/include/ldap \
+#	--with-ldap-library-dir=/usr/lib \
+#
+# IPv6 ?
+#	--with-ipv6 \
+#
+# whoson ?
+#	--with-whoson \
+#
+# and yp/nis ?
+#	--with-yp \
+#	--with-yp-lib=/usr/lib \
+#
+# look ./configure --help and doc/guides/configure for more options
 
-make -j $NRPROC
+make
+make -C man groff
+make -C man html
 
 %install
-#rm -rf $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_ROOT
 make install prefix=$RPM_BUILD_ROOT
 
 # install man pages
 make MANDIR=$RPM_BUILD_ROOT/usr/man -C man install
 
-# make install man do not create a man3 dir
-rm -rf $RPM_BUILD_ROOT/usr/man/man3
-mkdir -p $RPM_BUILD_ROOT/usr/man/man3
-install -m644 $RPM_BUILD_DIR/zmailer-%{version}/man/*.3 \
-        $RPM_BUILD_ROOT/usr/man/man3
-
 # doc stuff
 install -m644 $RPM_SOURCE_DIR/README-RPM \
 	$RPM_BUILD_DIR/zmailer-%{version}
 
-# ps man pages
-mkdir -p $RPM_BUILD_DIR/zmailer-%{version}/man-ps
-install -m644 $RPM_BUILD_DIR/zmailer-%{version}/man/*.ps \
-	$RPM_BUILD_DIR/zmailer-%{version}/man-ps
-
-# strip only binary files
-strip `file $RPM_BUILD_ROOT/usr/lib/zmailer/* | awk -F':' '/not stripped/ { print $1 }'`
-strip `file $RPM_BUILD_ROOT/usr/lib/zmailer/ta/* | awk -F':' '/not stripped/ { print $1 }'`
+# ps and html man pages
+for i in ps html ; do
+mkdir -p $RPM_BUILD_DIR/zmailer-%{version}/man-$i
+install -m644 $RPM_BUILD_DIR/zmailer-%{version}/man/*.$i \
+	$RPM_BUILD_DIR/zmailer-%{version}/man-$i
+done
 
 # install SYSV init stuff
 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
 install -m755 $RPM_SOURCE_DIR/zmailer.init \
         $RPM_BUILD_ROOT/etc/rc.d/init.d/zmailer
 
-for I in 0 1 6; do
-	mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc$I.d
-        ln -sf ../init.d/zmailer \
-		$RPM_BUILD_ROOT/etc/rc.d/rc$I.d/K30zmailer
-done
-for I in 2 3 4 5; do
-	mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc$I.d
-        ln -sf ../init.d/zmailer \
-		$RPM_BUILD_ROOT/etc/rc.d/rc$I.d/S80zmailer 
-done
-
-touch $RPM_BUILD_ROOT/etc/mail.conf
-
 # install log rotation stuff
 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
 install -m644 $RPM_SOURCE_DIR/zmailer.logrotate \
@@ -151,29 +142,14 @@
 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
 install -m644 $RPM_SOURCE_DIR/zmailer.pam \
 	$RPM_BUILD_ROOT/etc/pam.d/smtpauth-login
-
-# OBSOLETE, now we run post-install.sh, this is the BEST ?
-# post-install.sh break the %files and when you make
-#  rpm -i(after rpm -e) or -U show errors
-
-# config files
-#
-#for I in aliases fqdnaliases localnames routes smtp-policy.relay \
-#	smtp-policy.src ; do 
-#ln -sf proto/$I \
-#	$RPM_BUILD_ROOT/etc/zmailer/db/$I
-#done
-#
-#for I in scheduler.conf sm.conf smtpserver.conf ; do
-#ln -sf proto/$I \
-#	$RPM_BUILD_ROOT/etc/zmailer/$I
-#done 
-
-#mv $RPM_BUILD_ROOT/etc/zmailer/cf/proto/* \
-#	$RPM_BUILD_ROOT/etc/zmailer/cf/
-#ln -sf cf/TELE-FI.cf \
-#	$RPM_BUILD_ROOT/etc/zmailer/router.cf
 
+# change zmailer.h file, --includedir= in zmailer don't work ok
+if ! [ -f $RPM_BUILD_ROOT/usr/include/zmailer/zmailer.h ]  ; then
+	mkdir -p $RPM_BUILD_ROOT/usr/include/zmailer
+	install -m644 $RPM_BUILD_ROOT/usr/include/zmailer.h \
+	  $RPM_BUILD_ROOT/usr/include/zmailer/zmailer.h
+fi
+	
 # zmailer control script in the PATH is more coooooool :-)
 ln -sf ../lib/zmailer/zmailer $RPM_BUILD_ROOT/usr/sbin/zmailer
 
@@ -187,31 +163,54 @@
 	$RPM_BUILD_ROOT/usr/bin/$I
 done
 
+touch $RPM_BUILD_ROOT/etc/mail.conf
+
 %pre
 # ####################
 # pre-install section
 
+# get source zmailer configuration.
+if [ -f /etc/zmailer/zmailer.conf ] ; then
+        . /etc/zmailer/zmailer.conf
+fi
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
 # is zmailer running ?
-if ps auxw | egrep 'router|scheduler|smtpserver' | grep -v egrep \
-	>> /dev/null ; then
-	/usr/lib/zmailer/zmailer kill
-	echo "1" > /var/run/.zmailer_was_run
+
+if ( status scheduler || status router || status smtpserver ) | grep -v stop 2> /dev/null ; then
+	if [ -f $MAILBIN/zmailer ] ; then
+		$MAILBIN/zmailer kill
+		$MAILBIN/zmailer bootclean
+	else 
+		for i in scheduler router smtpserver ; do 
+		killproc $i > /dev/null
+		rm -rf /var/spool/postoffice/.pid.* 2> /dev/null
+		done
+	fi
+	echo "running" > /var/run/.zmailer_was_run
 fi
 
+# make zmailer group
+
+if ! grep -q "^zmailer:" /etc/group ; then
+        # Use 'mail' group for zmailer...
+        echo "zmailer:x:12:root,daemon,uucp" >> /etc/group
+fi
+
 %post
 # #####################
 # post-install section
 
+# put SYSV init stuff
+/sbin/chkconfig --add zmailer
+
 # get source zmailer configuration.
 . /etc/zmailer/zmailer.conf
 
-/sbin/chkconfig --add zmailer
-
 # mail.conf stuff
-if ( [ -s /etc/mail.conf ] && grep -c '^hostname' /etc/mail.conf ) >> /dev/null ; then
-	:
-else
-#	mv -f /etc/mail.conf /etc/mail.conf.rpmsave
+if ! ( [ -s /etc/mail.conf ] && grep -c '^hostname' /etc/mail.conf ) > /dev/null ; then
 	echo "# Where am I?" > /etc/mail.conf
 	[ -z "`hostname -d`" ] || echo "orgdomain=`hostname -d`" >> /etc/mail.conf
 	echo "# Who am I?" >> /etc/mail.conf
@@ -220,100 +219,123 @@
 	[ -z "`hostname -f`" ] || echo "hostname=`hostname -f`" >> /etc/mail.conf
 fi
 
-# make zmailer group
-if grep -c "^zmailer:" /etc/group >> /dev/null ; then
-        :
-else
-        # Use 'mail' group for zmailer...
-        echo "zmailer::12:root,daemon,uucp" >> /etc/group
-fi
+ln -sf /etc/mail.conf /etc/zmailer/mail.conf
 
 # port to mailer transport queue
-if grep -c "^mailq" /etc/services >> /dev/null ; then
-        :
-else
+if ! grep -q "^mailq" /etc/services > /dev/null ; then
         echo "mailq           174/tcp                         # Mailer transport queue" >> /etc/services
 fi
 
-# post-install.sh break the %files and when you make
-# rpm -i or -U zmailer, you get a pile of errors.
-# I don't know if the best solution is run post-install.sh
-# or made by hand like in "config files"
-echo " "
-$MAILBIN/post-install.sh -OLDSTYLE
-
-echo "localhost" > /etc/zmailer/db/localnames
-echo "`hostname -f`" >> /etc/zmailer/db/localnames
-echo "`hostname`" >> /etc/zmailer/db/localnames
-echo "`hostname -d`" >> /etc/zmailer/db/localnames
-echo "localhost.`hostname -d`" >> /etc/zmailer/db/localnames
-
 (cd /etc/ && ln -sf zmailer/db/aliases .)
+
+# run post-install script
+# rebuild the zmailer aliases database, recreates the FQDN alias map,
+# smtp-policy-db builder, create the postoffice dir ....... and more.
+$MAILBIN/post-install -OLDSTYLE
+
+# SECURITY NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+# plain text passwd !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+chown root:root /etc/zmailer/scheduler.auth
+chmod 600 /etc/zmailer/scheduler.auth
+
+if ! ( [ -f /etc/zmailer/db/localnames ] && \
+        grep -c "^localhost" /etc/zmailer/db/localnames ) > /dev/null ; then
+        echo "localhost" >> /etc/zmailer/db/localnames
+        echo "`hostname -f`" >> /etc/zmailer/db/localnames
+        echo "`hostname`" >> /etc/zmailer/db/localnames
+        echo "`hostname -d`" >> /etc/zmailer/db/localnames
+        echo "localhost.`hostname -d`" >> /etc/zmailer/db/localnames
+fi
 
-# rebuild the zmailer aliases database
-$MAILBIN/newaliases
-# recreates the FQDN alias map
-$MAILBIN/newfqdnaliases
+$MAILBIN/zmailer newdb > /dev/null
+$MAILBIN/policy-builder.sh -n > /dev/null
 
 # notices
 echo " "  
-echo "     If you are running PROCMAIL as your local delivery agent"
-echo "     read /usr/doc/zmailer-doc-%{version}/doc/guides/procmail "
-echo " "
-echo "     Read the /usr/doc/zmailer-%{version}/README-RPM file."
-echo " "
-echo "     If you need docs, install the zmailer-doc-%{version} file"
-echo " "
-echo "     Visit the www.zmailer.org site to get a new version of"
-echo "     the Zmailer Manual and take a look to the news"
-echo " "
-echo "     A mailing list is avaliable at nic.funet.fi"
+echo "       If you are running PROCMAIL as your local delivery agent"
+echo "       read /usr/doc/zmailer-doc-%{version}/doc/guides/procmail."
+echo "       If you need docs, install the zmailer-doc-%{version}."
+echo "       Visit the www.zmailer.org site to get a new version of"
+echo "       the Zmailer Manual and take a look to the news."
+echo "       A mailing list is avaliable at zmailer@nic.funet.fi"
+echo "       Use <mailserver@nic.funet.fi> to subscribe yourself to"
+echo "       the list by sending it a message with body content:"
+echo "                subscribe zmailer Your Name"
 echo " "
 
 # Yes, it was running. Startup zmailer again
-if [ -s /var/run/.zmailer_was_run ] >> /dev/null ; then
+if [ -s /var/run/.zmailer_was_run ] > /dev/null ; then
         /etc/rc.d/init.d/zmailer start
-        rm -f /var/run/.zmailer_was_run
 fi
+rm -f /var/run/.zmailer_was_run
 
 %preun
 # ######################
 # pre-uninstall section
 
+# get source zmailer configuration.
+. /etc/zmailer/zmailer.conf
+
 # stop zmailer if it is running
-if ps auxw | egrep 'router|scheduler|smtpserver' | grep -v egrep \
-        >> /dev/null ; then
-        /usr/lib/zmailer/zmailer kill
+if ( /etc/rc.d/init.d/zmailer status | grep -v stop ) > /dev/null ; then
+        $MAILBIN/zmailer kill
+	$MAILBIN/zmailer bootclean
 fi
-
-# delete the pid files
-for i in scheduler smtpserver router ; do
-	if [ -f /var/spool/postoffice/.pid.$i ] ; then
-		rm -f /var/spool/postoffice/.pid.$i
-	fi
-done
 
+# delete SYSV init stuff
 /sbin/chkconfig --del zmailer
 
+# delete zmailer group
+groupdel zmailer || : #"WARNING: failed to remove group zmailer"
+
 %postun
 # ######################
 # post-uninstall section
 
 echo " "
-echo "     Look at /var/log/zmailer/ to delete the zmailer logs,"
-echo "     /var/spool/postoffice/ where are the zmailer big work"
-echo "     dirs and /etc/zmailer where are the config files"
+echo "     Look at /var/log/zmailer to delete the zmailer logs,"
+echo "     /var/spool/postoffice where are the zmailer big work"
+echo "     dirs and /etc/zmailer where are the config files."
+echo "     Look for the zmailer group in /etc/group and delete it."
 echo " "
 
 %clean
-#rm -rf $RPM_BUILD_ROOT
-#rm -rf /usr/src/redhat/BUILD/zmailer-%{version}
+rm -rf $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_DIR/zmailer-%{version}
 
 %changelog
 
+* Mon Apr 16 2001 Xose Vazquez <xose@wanadoo.es>
+
+- minor changes for Zmailer-2.99.55
+- bugs in Zmailer-2.99.55 :
+- --includedir= in configure don't work
+- /etc/mail.conf don't work, made a link to /etc/zmailer/mail.conf
+- make -j x, it is like linux kernel ;-) , broken
+
+* Fri Feb 23 2001 Xose Vazquez <xose@wanadoo.es>
+
+- new version for Zmailer-2.99.55
+
+* Sat Dec 16 2000 Xose Vazquez <xose@wanadoo.es>
+
+- minor changes for Zmailer-2.99.54patch1
+
+* Sat Dec 2 2000 Xose Vazquez <xose@wanadoo.es>
+
+- new version for Zmailer-2.99.54
+
+* Wed Jul 19 2000 Xose Vazquez <xose@wanadoo.es>
+
+- new version for Zmailer-2.99.53
+
+* Fri Jun 30 2000 Xose Vazquez <xose@wanadoo.es>
+
+- minor changes
+
 * Sat Apr 1 2000 Xose Vazquez <xose@wanadoo.es>
 
-- New version for Zmailer-2.99.53, too many changes.
+- new version for Zmailer-2.99.53pre1, too many changes.
 
 * Wed Oct 13 1999 Xose Vazquez <xose@ctv.es>
 
@@ -322,72 +344,60 @@
 
 * Fri Aug 6  1999 Xose Vazquez <xose@ctv.es>
 
-- split zmailer, the doc is a independent rpm
+- split zmailer, the doc is an independent rpm
 
 * Thu Jul 29 1999 Xose Vazquez <xose@ctv.es>
 
 - based on zmailer-%{version}/contrib/zmailer49.spec
 - this is the first version, is all ok ?
 
+# ##################
+# package files
 
 %files
 %defattr(-,root,root)
 
-#/etc/aliases
 /etc/mail.conf
 
-%attr(644,root,root)/etc/pam.d/smtpauth-login
-%config %attr(755,root,root) /etc/cron.d/zmailer
-%config /etc/logrotate.d/zmailer
-%config /etc/rc.d/init.d/zmailer
-%config(missingok) /etc/rc.d/rc0.d/K30zmailer
-%config(missingok) /etc/rc.d/rc1.d/K30zmailer
-%config(missingok) /etc/rc.d/rc2.d/S80zmailer
-%config(missingok) /etc/rc.d/rc3.d/S80zmailer
-%config(missingok) /etc/rc.d/rc4.d/S80zmailer
-%config(missingok) /etc/rc.d/rc5.d/S80zmailer
-%config(missingok) /etc/rc.d/rc6.d/K30zmailer
-%config(noreplace) /etc/zmailer/cf/*
-%config(noreplace) /etc/zmailer/db/*
-/etc/zmailer/forms
-/etc/zmailer/fqlists
-/etc/zmailer/lists
-%config(noreplace) /etc/zmailer/proto/*
-
-#%config(noreplace) /etc/zmailer/router.cf
-#%config(noreplace) /etc/zmailer/scheduler.conf
-#%config(noreplace) /etc/zmailer/sm.conf
-#%config(noreplace) /etc/zmailer/smtpserver.conf
-
-%config /etc/zmailer/vacation.msg
-%config /etc/zmailer/zmailer.conf
-/usr/bin/*
+/etc/pam.d/smtpauth-login
+/etc/cron.d/zmailer
+/etc/logrotate.d/zmailer
+/etc/rc.d/init.d/zmailer
+
+%config(missingok) /etc/zmailer/cf/proto/*
+%config(missingok) /etc/zmailer/db/proto/*
+%config(missingok) /etc/zmailer/forms/proto/*
+%dir /etc/zmailer/fqlists
+%dir /etc/zmailer/lists
+%config(missingok) /etc/zmailer/proto/*
+/etc/zmailer/vacation.msg
+/etc/zmailer/zmailer.conf
+
+/usr/bin/mailq
+/usr/bin/newaliases
+/usr/bin/rmail
+/usr/bin/vacation
 
-#/usr/include/zmailer/zmailer.h
-#/usr/lib/libzmailer.a
+/usr/include/zmailer/zmailer.h
 
+/usr/lib/libzmailer.a
 /usr/lib/sendmail
 /usr/lib/zmailer
-/usr/man/*/*
-/usr/sbin/*
 
+/usr/man
+
+/usr/sbin/sendmail
+/usr/sbin/zmailer
+
 %dir /var/log/zmailer
-%attr(2755,root,root) %dir /var/spool/postoffice/
-%attr(700,root,root) /var/spool/postoffice/TLSclntcache/
-%attr(700,root,root) /var/spool/postoffice/TLSsrvrcache/
-%attr(750,root,root) /var/spool/postoffice/deferred/
-%attr(750,root,root) /var/spool/postoffice/freezer/
-%attr(750,root,root) /var/spool/postoffice/postman/
-%attr(1777,root,root) /var/spool/postoffice/public/
-%attr(750,root,root) %dir /var/spool/postoffice/queue/
-%attr(755,root,root)  /var/spool/postoffice/queue/*
-%attr(1777,root,root) /var/spool/postoffice/router/
-%attr(755,root,root) /var/spool/postoffice/transport/
+%attr(2755,root,root) %dir /var/spool/postoffice
 
 %doc ChangeLog INSTALL MANIFEST Overview README* TODO contrib/README.debian
+
+# ##################
+# doc package files
 
-#doc package files
 %files doc
-%doc doc/* man-ps
+%doc doc/* man-ps man-html
 
 # EOF
Index: zmailer/proto/newdbprocessor.in
diff -u zmailer/proto/newdbprocessor.in:1.8 zmailer/proto/newdbprocessor.in:1.11
--- zmailer/proto/newdbprocessor.in:1.8	Tue Feb 20 18:51:31 2001
+++ zmailer/proto/newdbprocessor.in	Fri May  4 14:28:02 2001
@@ -2,7 +2,6 @@
 
 #  NEWDB processor in all wraps..
 #
-# FIXME: rpriv subfield processing!
 
 # -----------------------------------------------------------------------
 #    newdbprocessor()  -- converts DB configuration to ZMSH scripts
@@ -14,7 +13,7 @@
 #|              dbpriv control data (or "-")
 #|                  newdb_compile_options (-a for aliases!)
 #|                     dbfile (or "-")
-#|                         dbflags (or "-") ...
+#|                         dbflags (or "-") ... (until end of line)
 #|
 #| The  dbtype  can be "magic" '$DBTYPE', or any other valid database
 #| type for the Router.  Somewhat magic treatment (newdb runs) are
@@ -34,18 +33,20 @@
 #| userdb          $DBTYPE  root:0:644 -la $MAILVAR/db/userdb         -lm
 #|
 #|Security insensitive ones ("dbpriv" need not be defined!)
-#| fqdnaliasesldap ldap     -    -   $MAILVAR/db/fqdnalias.ldap -lm -e 2000 -s 9000
-#| fullnamemap     $DBTYPE  -    -l  $MAILVAR/db/fullnames      -lm
-#| mboxmap         $DBTYPE  -    -l  $MAILSHARE/db/mboxmap      -lm
-#| expired         $DBTYPE  -    -l  $MAILVAR/db/expiredaccts   -lm
-#| iproutesdb      $DBTYPE  -    -l  $MAILVAR/db/iproutes       -lm -d longestmatch
-#| routesdb        $DBTYPE  -    -l  $MAILVAR/db/routes         -lm%
-#| thishost        $DBTYPE  -    -l  $MAILVAR/db/localnames     -lm
-#| thishost        unordered -   -   $MAILVAR/db/localnames     -l
-#| thishost        bind,mxlocal - -  -                          -l
-#| otherservers    unordered -   -   $MAILVAR/db/otherservers   -lm -d pathalias
-#| newsgroup       $DBTYPE  -    -l  $MAILVAR/db/active         -lm
-#
+#| fqdnaliasesldap ldap  - -   $MAILVAR/db/fqdnalias.ldap -lm -e 2000 -s 9000
+#| fullnamemap     $DBTYPE  -    -l  $MAILVAR/db/fullnames    -lm
+#| mboxmap         $DBTYPE  -    -l  $MAILSHARE/db/mboxmap    -lm
+#| expired         $DBTYPE  -    -l  $MAILVAR/db/expiredaccts -lm
+#| iproutesdb      $DBTYPE  -    -l  $MAILVAR/db/iproutes     -lmd longestmatch
+#| routesdb        $DBTYPE  -    -l  $MAILVAR/db/routes       -lm%:d pathalias
+#| thishost        $DBTYPE  -    -l  $MAILVAR/db/localnames   -lmd pathalias
+#| thishost        unordered -   -   $MAILVAR/db/localnames   -l
+#| thishost        bind,mxlocal - -  -                        -l
+#| otherservers    unordered -   -   $MAILVAR/db/otherservers -lmd pathalias
+#| newsgroup       $DBTYPE  -    -l  $MAILVAR/db/active       -lm
+#|
+#| anyname         NONE    -  -  -  -
+#|
 #
 
 # --------------------
@@ -83,8 +84,11 @@
 $DBTYPE = $ZENV{'DBTYPE'};
 
 
-open(INFN, "< $infn") || die "Can't open file '$infn' for reading";
+open(INFN, "< ".$infn) || die "Can't open file '$infn' for reading";
 
+#
+# Collect all relation names, and lines with them for latter processing
+#
 while (<INFN>) {
 
 	next unless(m/^[0-9a-zA-Z]/);
@@ -110,14 +114,10 @@
     $rnum=1;
     @tnf=(); # trunc the "file"
 
-    push(@ofn,  "# ZMSH init script for relation: ${rel}",
-		"",
-		"# ---boilerplate head" );
-
     $oo='';
     # --- construct each relation, and binding at lookup, generate the db
     foreach $inp (@inps) {
-	($rname,$rtype,$rpriv,$rndbopt, $rdbfile, $rdbflags) = split(' ',$inp,6);
+	($rname,$rtype,$rpriv,$rndbopt,$rdbfile,$rdbflags) = split(' ',$inp,6);
 	next unless ( $rel eq $rname );
 
 	$rn="${rel}_$rnum";
@@ -157,8 +157,11 @@
 		} elsif ($DBTYPE eq 'btree') {
 			@dbfiles = ($fn.".db");
 		# } else {
-			# LDAP/BIND/ORDERED/UNORDERED ...
+			# LDAP/BIND/ORDERED/UNORDERED/INCORE ...
 		}
+	} elsif ($rtype eq 'NONE') {
+		$rdbexttst = '';
+		$rdbtype   = 'NONE';
 	} elsif ($rtype eq 'ndbm') {
 		$rdbexttst = '.pag';
 		$rdbtype   = $rtype;
@@ -214,70 +217,117 @@
 		$rdbext    = '';
 		$rdbtype   = $rtype;
 		@dbfiles = ($fn);
-	} elsif ($rtype =~ '^bind') {
+	} elsif ($rtype =~ '^bind[,/]') { # Has subtypes
 		$rdbexttst = '';
 		$rdbext    = '';
 		$rdbtype   = $rtype;
 		@dbfiles = ($fn);
+	} elsif ($rtype =~ '^yp[,/]') { # Has subtypes
+		$rdbexttst = '';
+		$rdbext    = '';
+		$rdbtype   = $rtype;
+		@dbfiles = ($fn);
+	} elsif ($rtype eq 'incore') {
+		$rdbexttst = '';
+		$rdbext    = '';
+		$rdbtype   = $rtype;
+		@dbfiles = ($fn);
+
+		if ($rdbfile ne '-') {
+
+		    ##
+		    ## Convert input file ($fn) into incore format, store
+		    ## the data into the @ofn array (after 'relation') with
+		    ## 'pushd(@ofn, "db add relname keyname \"value\"")'
+		    ##
+
+		    if (open(RDBFILE, "< ". $rdbfile)) {
+			while (<RDBFILE>) {
+			    chomp;
+			    next if (m/^[ \t]*\#/o);  # Comment line
+			    next if (m/^[ \t]*\$/o);  # Blank line
+
+			    local($key,$data) = split(' ', $_, 2);
+
+			    $key  =~ s{\\}{\\\\}go; # Double backslashes
+			    $key  =~ s{"}{\\"}go;   # Backslash quotes
+			    $data =~ s{\\}{\\\\}go;
+			    $data =~ s{"}{\\"}go;
+
+			    pushd(@ofn, 'db add '.$rel.' "'.$data.'"');
+			}
+			close(RDBFILE);
+		    }
+
+		}
+
 	} else {
 		$rdbexttst = '.dat';
 		$rdbext    = '.dat';
 	}
 
-	local($optset) = ' $o1 $o2 $o3 $o4 $o5 $o6 $o7 $o8 $o9';
-	if (!($rdbflags =~ /\%/)) {
+	local($optset) = ' $o1 $o2 $o3 $o4 $o5 $o6 $o7 $o8 $o9 $o10 $o11 $o12 $o13 $o14 $o15 $o16 $o17 $o18 $o19';
+	if ((!($rdbflags =~ /:/)) &&
+	    (!($rdbflags =~ /\%/))) {
 	    $optset = '';
 	}
 
+	if ($rtype ne 'NONE') {
+
 
-	if ($rpriv eq '-') {
-	    # ---- No privilege things collected -----
-	    push(@tfn,
+	    if ($rdbfile eq '-') {
+		unshift(@ofn, "	relation $rdbflags -t $rtype $rn");
+	    } else {
+		unshift(@ofn, "	relation $rdbflags -t $rtype -f $rdbfile$rdbext $rn");
+	    }
+
+	    if ($rpriv eq '-') {
+		# ---- No privilege things collected -----
+		push(@tfn,
 "	if a=\"\$($rn \$key ".$optset.")\"; then
 	    return \"\$a\"
 	fi");
 
-	} else {
-	    # ---- privilege things to collect ----
-	    # rpriv is a colon separated duplet/triplet:
-	    # ... FIXME! Implement!
-
-	    local(@priv) = split(/:/,$rpriv);
-	    local($fmask) = '644';
-
-	    if (defined $priv[1] && @dbfiles) {
-		local($pw0,$pw1,$pw2,$pw3) = getpwnam($priv[0]);
-		local($gr0,$gr1,$gr2,$gr3) = getgrnam($priv[1]);
-		$priv[0] = $pw2 if (defined $pw2);
-		$priv[1] = $gr2 if (defined $gr2);
+	    } else {
+		# ---- privilege things to collect ----
+		# rpriv is a colon separated duplet/triplet:
+
+		local(@priv) = split(/:/,$rpriv);
+		local($fmask) = '644';
+
+		if (defined $priv[1] && @dbfiles) {
+		    local($pw0,$pw1,$pw2,$pw3) = getpwnam($priv[0]);
+		    local($gr0,$gr1,$gr2,$gr3) = getgrnam($priv[1]);
+		    $priv[0] = $pw2 if (defined $pw2);
+		    $priv[1] = $gr2 if (defined $gr2);
 
-		chown $priv[0],$priv[1], @dbfiles;
-	    }
-	    if (defined $priv[2] && @dbfiles) {
-		$fmask = $priv[2];
-		chmod oct($priv[2]), @dbfiles;
-	    }
+		    chown $priv[0],$priv[1], @dbfiles;
+		}
+		if (defined $priv[2] && @dbfiles) {
+		    $fmask = $priv[2];
+		    chmod oct($priv[2]), @dbfiles;
+		}
 
-	    push(@tfn,
+		push(@tfn,
 "	if a=\"\$($rn \$key ".$optset.")\"; then
 	    priv=\"\$(filepriv -M $fmask $rdbfile$rdbexttst \\
 			    \$(db owner $rn))\" &&
 	    return \"\$a\"
 	fi");
-	}
-
-	if ($rdbfile eq '-') {
-	    push(@ofn, "	relation $rdbflags -t $rtype $rn");
-	} else {
-	    push(@ofn, "	relation $rdbflags -t $rtype -f $rdbfile$rdbext $rn");
+	    }
 	}
     } # --- foreach $inp (@inps) ....
 
 
+    # --- put out head..
+    unshift(@ofn,  "# ZMSH init script for relation: ${rel}",
+		    "",
+		    "# ---boilerplate head" );
+
     # --- put out tails, and complete..
     push(@ofn, "# boilerplate tail---
 
-${rel}(key, o1, o2, o3, o4, o5, o6, o7, o8, o9) {
+${rel}(key, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15, o16, o17, o18, o19) {
     local a");
 
     push(@ofn, @tfn);
Index: zmailer/proto/smtpserver.conf.in
diff -u zmailer/proto/smtpserver.conf.in:1.34 zmailer/proto/smtpserver.conf.in:1.37
--- zmailer/proto/smtpserver.conf.in:1.34	Tue Oct 31 19:49:50 2000
+++ zmailer/proto/smtpserver.conf.in	Thu Mar  8 12:12:34 2001
@@ -1,80 +1,84 @@
 #
 # smtpserver.conf - autogenerated edition
 #
-#PARAM maxsize              10000000	# Same as -M -option
+#PARAM maxsize              10000000    # Same as -M -option
 #PARAM min-availspace           5000    # Minimum free in POSTOFFICE after
 #                                       # message has arrived; in KILOBYTES.
-#PARAM max-error-recipients        3	# More than this is probably SPAM!
+#PARAM max-error-recipients        3    # More than this is probably SPAM!
 #PARAM max-unknown-commands       10    # Max unknown cmds before we hung up
 #
-#PARAM MaxSameIpSource		  10    # Max simultaneous connections
-#					# from any IP source address
+#PARAM MaxSameIpSource            10    # Max simultaneous connections
+#                                       # from any IP source address
 #PARAM MaxParallelConnections    800    # Max simultaneous connections
 #                                       # in total to the server
-#PARAM TcpRcvBufferSize        32000	# Should not need to set!
-#PARAM TcpXmitBufferSize       32000	# Should not need to set!
+#PARAM TcpRcvBufferSize        32000    # Should not need to set!
+#PARAM TcpXmitBufferSize       32000    # Should not need to set!
 #
-#PARAM ListenQueueSize		  10	# listen(2) parameter
+#PARAM ListenQueueSize            10    # listen(2) parameter
 #
-#PARAM RcptLimitCount          10000	# Max number of recipients for one
-#					# MAIL FROM session. Minimum: 100
+#PARAM RcptLimitCount          10000    # Max number of recipients for one
+#                                       # MAIL FROM session. Minimum: 100
 #PARAM sum-sizeoption-value
 #
-#PARAM BindPort	                  25	# Binding port
-#PARAM BindAddress         [0.0.0.0]	# Binding address - for multihomers..
-#PARAM BindAddress       [IPv6.0::0]	# and here is for IPv6 - NO SPACES!
+#PARAM BindPort                   25    # Binding port
+#PARAM BindAddress         [0.0.0.0]    # Binding address - for multihomers..
+#PARAM BindAddress       [IPv6.0::0]    # and here is for IPv6 - NO SPACES!
 #PARAM BindAddress            eth0:2    # Addresses of that interface
 #
 # Enables of some commands:
-#PARAM	DEBUGcmd
-#PARAM	EXPNcmd
-#PARAM	VRFYcmd
-#PARAM	enable-router	# This is a security decission for you.
-#			# This is needed for EXPN/VRFY and interactive
-#			# processing of MAIL FROM and RCPT TO addresses.
-#			# However it also may allow external user entrance
-#			# to ZMailer router shell environment with suitably
-#			# pervert input, if quotation rules are broken in
-#			# the scripts.
-#
-#PARAM	smtp-auth	# enable if you want to allow SMTP to autenticate
-#			# with the default code against system  /etc/passwd
-#			# (or whatever source  getpwnam() uses for it..)
+#PARAM  DEBUGcmd
+#PARAM  EXPNcmd
+#PARAM  VRFYcmd
+#PARAM  enable-router   # This is a security decission for you.
+#                       # This is needed for EXPN/VRFY and interactive
+#                       # processing of MAIL FROM and RCPT TO addresses.
+#                       # However it also may allow external user entrance
+#                       # to ZMailer router shell environment with suitably
+#                       # pervert input, if quotation rules are broken in
+#                       # the scripts.
+#
+#PARAM  smtp-auth       # enable if you want to allow SMTP to autenticate
+#                       # with the default code against system  /etc/passwd
+#                       # (or whatever source  getpwnam() uses for it..)
 #
-#PARAM  AUTH-LOGIN-also-without-TLS
-#			# Enable, if the "AUTH LOGIN" is to be allowed to
-#			# be used without running under SSL/TLS security
-#			# envelope.
-#
-#PARAM  MSA-mode	# Message Submission Agent mode. Require
-#			# successful user authentication during SMTP
-#			# sessions initiated from outside of the trusted
-#			# networks or the networks with relaying enabled
-#			# (see "fulltrustnet" and "relaycustnet" in
-#			# smtp-policy.src file).
-#
 #PARAM  SMTP-auth-pipe /path/to/program
-#			# External authentication program. The
-#			# authenticator should read a username from
-#			# command line and a password from standard input.
-#			# Exit status 0 means successful authentication.
+#                       # External authentication program. The
+#                       # authenticator should read a username from
+#                       # command line and a password from standard input.
+#                       # Exit status 0 means successful authentication.
+#
+#PARAM  AUTH-LOGIN-also-without-TLS
+#                       # Enable, if the "AUTH LOGIN" is to be allowed to
+#                       # be used without running under SSL/TLS security
+#                       # envelope.
+#
+#PARAM  MSA-mode        # Message Submission Agent mode. Require
+#                       # successful user authentication during SMTP
+#                       # sessions initiated from outside of the trusted
+#                       # networks or the networks with relaying enabled
+#                       # (see "fulltrustnet" and "relaycustnet" in
+#                       # smtp-policy.src file).
+#
+#PARAM  use-tcp-wrapper
+#               # If TCP-WRAPPER is configured in, uncommenting this
+#               # will activate its use to look service name:  smtp-receiver
 #
 # Disablers of some facility adverticements
 #PARAM  NoEHLO
-#PARAM	NoPIPELINING
-#PARAM	No8BITMIME
-#PARAM	NoCHUNKING
+#PARAM  NoPIPELINING
+#PARAM  No8BITMIME
+#PARAM  NoCHUNKING
 #PARAM  NoDSN
 #PARAM  NoETRN
 PARAM  no-multiline-replies # except to EHLO (Bloody M$ RFC821/AppE violators)
 #
 # HDR220 metatags:
-#  %% -- '%' character
-#  %H -- SS->myhostname
-#  %I -- '+IDENT' if 'identflg' is set
-#  %V -- VersionNumb
-#  %T -- curtime string
-#  %X -- xlatelang parameter
+#  %%  =  '%' character
+#  %H  =  myhostname
+#  %I  =  '+IDENT' if 'identflg' is set
+#  %V  =  VersionNumb
+#  %T  =  curtime string
+#  %X  =  xlatelang parameter
 #
 #PARAM hdr220 %H ZMailer ESMTP-server %V running at Yoyodyne Propulsion Inc
 #PARAM hdr220 %H ESMTP (NO UCE)(NO UBE) our local time is now %T
@@ -84,7 +88,7 @@
 # "EHLO is to be done blindly, server responses are not to be studied for
 #  any possible 'ESMTP' keyword!"
 #
-PARAM help -------------------------------------------------------------
+PARAM help =============================================================
 PARAM help  This mail-server is at Yoyodyne Propulsion Inc.
 PARAM help  Our telephone number is: +1-234-567-8900, and
 PARAM help  telefax number is: +1-234-567-8999
@@ -93,12 +97,12 @@
 PARAM help  Questions regarding our email service should be sent via
 PARAM help  email to address  <postmaster@OURDOMAIN>
 PARAM help  Reports about abuse are to be sent to: <abuse@OURDOMAIN>
-PARAM help -------------------------------------------------------------
+PARAM help =============================================================
 #
 # Uncomment following for not to strip incoming addresses of format:
 # <@aa,@bb:cc@dd> into non-source-routed base form: <cc@dd>
 #
-#PARAM	allowsourceroute # DON'T ENABLE UNLESS YOU USE ROUTER BASED
+#PARAM  allowsourceroute # DON'T ENABLE UNLESS YOU USE ROUTER BASED
 #                        # POLICY ANALYSIS!
 #
 # The policy database:  (NOTE: See  'makedb'  for its default suffixes!)
@@ -106,7 +110,7 @@
 PARAM  policydb   $DBTYPE  $MAILVAR/db/smtp-policy
 #
 # External program for received message content analysis:
-#PARAM  contentfilter	$MAILBIN/smtp-contentfilter
+#PARAM  contentfilter   $MAILBIN/smtp-contentfilter
 
 #
 #PARAM  tarpit 0 0   # No "tarpit" for 4XX/5XX reply codes
@@ -118,28 +122,28 @@
 # See  doc/guides/openssl,  or:
 # http://www.aet.tu-cottbus.de/personen/jaenicke/pfixtls/doc/setup.html
 #
-#PARAM	use-tls
-#PARAM	tls-CAfile	$MAILVAR/db/smtpserver-CAcert.pem
-#PARAM	tls-cert-file	$MAILVAR/db/smtpserver-cert.pem
-#PARAM	tls-key-file	$MAILVAR/db/smtpserver-key.pem
+#PARAM  use-tls
+#PARAM  tls-CAfile      $MAILVAR/db/smtpserver-CAcert.pem
+#PARAM  tls-cert-file   $MAILVAR/db/smtpserver-cert.pem
+#PARAM  tls-key-file    $MAILVAR/db/smtpserver-key.pem
 #  # If system default SSL-session-cache is to be used ?
 #PARAM  tls-use-scache
 #PARAM  tls-scache-timeout 3600 # (cache timeout in seconds)
 #  # Then some futher thoughs that may materialize some time..
-#PARAM tls-loglevel	0
-#PARAM tls-ccert-vd	0
-#PARAM tls-ask-cert	0
+#PARAM tls-loglevel     0
+#PARAM tls-ccert-vd     0
+#PARAM tls-ask-cert     0
 #PARAM tls-require-cert 0
 ##PARAM tls-CApath ... (somewhen: ways to verify client's certificates)
-##PARAM tls-enforce-tls	1
+##PARAM tls-enforce-tls 1
 
 # Elements to be added into "Received:" header's initial comment part:
 #
-#PARAM rcvd-ident	# The ident lookup result (or even admitting it)
-#PARAM rcvd-whoson	# Likewise for "whoson"
-#PARAM rcvd-auth-user	# Authenticated Username
-#PARAM rcvd-tls-mode	# Cipher, or not
-#PARAM rcvd-tls-peer	# Client Certificate reference
+#PARAM rcvd-ident       # The ident lookup result (or even admitting it)
+#PARAM rcvd-whoson      # Likewise for "whoson"
+#PARAM rcvd-auth-user   # Authenticated Username
+#PARAM rcvd-tls-mode    # Cipher, or not
+#PARAM rcvd-tls-peer    # Client Certificate reference
 
 # A load-balanced server cluster may want to communicate
 # the ETRN request to cluster components, here is how:
@@ -153,16 +157,16 @@
 
 #
 #
-# HELO/EHLO-pattern	style-flags (Remember: 'ftve' set needs enable-router!)
+# HELO/EHLO-pattern     style-flags (Remember: 'ftve' set needs enable-router!)
 #               [max loadavg]
 #
-localhost	    999	ftveR
-some.host.domain    999	!NO EMAIL ACCEPTED FROM YOUR MACHINE
+localhost           999 ftveR
+some.host.domain    999 !NO EMAIL ACCEPTED FROM YOUR MACHINE
 # If the host presents itself as:  HELO [1.2.3.4], be lenient to it..
 # The syntax below is due to these patterns being SH-GLOB style patterns
 # where the brackets are special characters.
-\[*\]		    999	ve
+\[*\]               999 ve
 # Per default demant strict syntactic adherence, including fully
 # qualified addresses for  MAIL FROM, and RCPT TO.  To be lenient
 # on that detail, remove the "R" from "veR" string below:
-*		    999	veR
+*                   999 veR
Index: zmailer/proto/zmailer.sh.in
diff -u zmailer/proto/zmailer.sh.in:1.13 zmailer/proto/zmailer.sh.in:1.14
--- zmailer/proto/zmailer.sh.in:1.13	Mon Jan 15 16:29:13 2001
+++ zmailer/proto/zmailer.sh.in	Mon Mar 12 11:12:34 2001
@@ -5,7 +5,7 @@
 #       Copyright 1990 by Rayan S. Zachariassen, all rights reserved.
 #       This will be free software, but only when it is finished.
 #
-#       Some hacking by Matti Aarnio, Copyright 1990-2000
+#       Some hacking by Matti Aarnio, Copyright 1990-2001
 #       Modified for Debian by Christoph Lameter 1997
 #
 
@@ -15,7 +15,7 @@
 
 checkfreeze () {
     if [ -f $POSTOFFICE/.freeze ]; then
-	echo "Sorry, Zmailer is frozen, won't start anything until thawed !"
+	echo "Sorry, ZMailer is frozen, won't start anything until thawed !"
 	echo "* CHECK THAT FREEZE CONDITION ISN'T DUE TO E.G. MAINTENANCE *"
 	exit 2
     fi
@@ -76,7 +76,7 @@
 # set up the default arguments
 if [ "$1" = "start" -o "$1" = "reload" -o $# = 0 ]; then
         set -$- router scheduler smtpserver
-        echoo "Starting Zmailer mail server: "
+        echoo "Starting ZMailer mail server: "
 fi
 
 umask 022
@@ -237,11 +237,11 @@
             case $op in
                 kill|stop|kills|killr)
                     KILL="-TERM"
-                    echoo "Stopping Zmailer services: "
+                    echoo "Stopping ZMailer services: "
                     ;;
                 nuke)
                     KILL="-KILL"
-                    echoo "Aborting Zmailer services: "
+                    echoo "Aborting ZMailer services: "
                     ;;
             esac
             ;;
Index: zmailer/proto/cf/aliases.cf
diff -u zmailer/proto/cf/aliases.cf:1.39 zmailer/proto/cf/aliases.cf:1.40
--- zmailer/proto/cf/aliases.cf:1.39	Tue Jan 23 01:35:11 2001
+++ zmailer/proto/cf/aliases.cf	Thu Mar  8 11:13:32 2001
@@ -607,7 +607,7 @@
 		    return (((hold "$defer" "$address" $attr)))
 
 	    ssift "$user" in # No 'homedir' for this user ? Has a '+' in it ?
-	    (.+)\+.+
+	    ([^+]+)\+.+
 		# Try expanding 'user+', and then plain 'user'
 		key="\1+"
 		if $(didexpand 'aliases+') && a="$(aliases "\1+")"; then
@@ -627,7 +627,7 @@
 		fi
 		# For a "user+" there is no homedirectory, try plusless below
 		;;
-	    (.+)\+(.*)
+	    ([^+]+)\+(.*)
 		# It was 'user+', try now plain 'user' for
 		# aliases, and .forward
 		key="\1"
Index: zmailer/proto/cf/fqdnalias.cf
diff -u zmailer/proto/cf/fqdnalias.cf:1.23 zmailer/proto/cf/fqdnalias.cf:1.24
--- zmailer/proto/cf/fqdnalias.cf:1.23	Tue Feb 20 18:51:31 2001
+++ zmailer/proto/cf/fqdnalias.cf	Mon Mar 12 11:12:34 2001
@@ -97,7 +97,7 @@
 	case "$(get $A type)" in
 	sender)
 		if $(didexpand userdbmailname) && 
-		   a="$(userdb "$lcaddress:mailname" "$user")" ; then
+		   a="$(userdb "$lcaddress:mailname" -- "$user")" ; then
 
 		  db add expansions "$key.userdbmailname" 1
 		  nattr=$(newattribute $A privilege $priv)
@@ -132,7 +132,7 @@
 
 	# key="$lcaddress"
 	if $(didexpand fqdnaliases) &&
-	   a="$(fqdnaliases "$lcaddress" "$user")" ; then
+	   a="$(fqdnaliases "$lcaddress" -- "$user")" ; then
 		db add expansions "$key.fqdnaliases" 1
 		nattr=$(newattribute $A privilege $priv)
 		$(zapDSNnotify $nattr) ## FIXME!FIXME!
@@ -145,7 +145,7 @@
 	fi
 
 	if $(didexpand fqdnaliasesldap) &&
-	   a="$(fqdnaliasesldap "$lcaddress" "$user")" ; then
+	   a="$(fqdnaliasesldap "$lcaddress" -- "$user")" ; then
 		db add expansions "$key.fqdnaliasesldap" 1
 		nattr=$(newattribute $A privilege $nobodypriv)
 		$(zapDSNnotify $nattr) ## FIXME!FIXME!
@@ -181,7 +181,7 @@
 
 	    fi
 	    if $(didexpand fqdnaliasesldap) &&
-	       a="$(fqdnaliasesldap "$key" "$user")" ; then
+	       a="$(fqdnaliasesldap "$key" -- "$user")" ; then
 		db add expansions "$key.fqdnaliasesldap" 1
 		nattr=$(newattribute $A privilege $nobodypriv)
 		$(zapDSNnotify $nattr) ## FIXME!FIXME!
@@ -271,7 +271,7 @@
 	#
 	key="$athost"
 	if $(didexpand fqdnaliases) &&
-	   a="$(fqdnaliases "$key" "$user")" ; then
+	   a="$(fqdnaliases "$key" -- "$user")" ; then
 		db add expansions "$key.fqdnaliases" 1
 		nattr=$(newattribute $A privilege $priv) &&
 		$(zapDSNnotify $nattr) ## FIXME!FIXME!
@@ -283,7 +283,7 @@
 		return $a
 	fi
 	if $(didexpand fqdnaliasesldap) &&
-	   a="$(fqdnaliasesldap "$key" "$user")" ; then
+	   a="$(fqdnaliasesldap "$key" -- "$user")" ; then
 		db add expansions "$key.fqdnaliasesldap" 1
 		nattr=$(newattribute $A privilege $nobodypriv) &&
 		$(zapDSNnotify $nattr) ## FIXME!FIXME!
Index: zmailer/proto/cf/p-routes.cf
diff -u zmailer/proto/cf/p-routes.cf:1.1.1.1 zmailer/proto/cf/p-routes.cf:1.3
--- zmailer/proto/cf/p-routes.cf:1.1.1.1	Tue Feb 10 23:01:49 1998
+++ zmailer/proto/cf/p-routes.cf	Fri May  4 14:28:02 2001
@@ -10,6 +10,15 @@
 routes_neighbour (domain, address, A) {
 	local tmp
 
+	# We have Alternate default-lookup for cases of locally generated
+	# ERROR MESSAGES -- for case where the dot (.) leads to error!
+	# and we want to reply with DIFFERENT address, thus:  '.:ERROR' key.
+
+	$(iserrormsg) &&
+		tmp=$(routesdb "$domain" -: '.:ERROR') &&
+			tmp=$(routes_spec "$tmp" "$address" $A) &&
+				return $tmp
+
 	tmp=$(routesdb "$domain") &&
 		tmp=$(routes_spec "$tmp" "$address" $A) &&
 			return $tmp
Index: zmailer/proto/cf/rrouter.cf
diff -u zmailer/proto/cf/rrouter.cf:1.20 zmailer/proto/cf/rrouter.cf:1.21
--- zmailer/proto/cf/rrouter.cf:1.20	Thu Feb  8 03:09:03 2001
+++ zmailer/proto/cf/rrouter.cf	Thu Mar  8 12:12:34 2001
@@ -77,7 +77,11 @@
 #	 handle special cases.....
 #	\\(.+)	return (((local - "$address" $A))) ;;
 	@	# handle <> form ???
-		tmp=(local user postmaster $A)
+		if [ "$(get $A type)" = sender ]; then
+			tmp=(error user postmaster $A)
+		else
+			tmp=(local user postmaster $A)
+		fi
 		return $(routeuser $tmp "$plustail" "")
 		;;
 
Index: zmailer/proto/db/dbases.conf
diff -u zmailer/proto/db/dbases.conf:1.10 zmailer/proto/db/dbases.conf:1.12
--- zmailer/proto/db/dbases.conf:1.10	Tue Feb 20 18:51:31 2001
+++ zmailer/proto/db/dbases.conf	Mon Mar 12 11:12:34 2001
@@ -17,7 +17,7 @@
 #|              dbpriv control data (or "-")
 #|                  newdb_compile_options (-a for aliases!)
 #|                     dbfile (or "-")
-#|                         dbflags (or "-") ...
+#|                         dbflags (or "-") ... (until end of line)
 #|
 #| The  dbtype  can be "magic" '$DBTYPE', or any other valid database
 #| type for the Router.  Somewhat magic treatment (newdb runs) are
@@ -27,6 +27,10 @@
 #| it is in system local filesystem (for performance reasons.)  E.g.
 #| one can place one of e.g. aliases files to some persons directory.
 #|
+#| At  dbflags  (until end of the line), characters ':' and '%' have special
+#| meaning as their existence generates lookup routines which pass user's
+#| optional parameters.  See documentation about 'dblookup'.
+#|
 
 #|Example:
 #|
@@ -34,25 +38,47 @@
 #| aliases         $DBTYPE  0:0:644    -la $MAILVAR/db/aliases        -lm
 #| aliases         $DBTYPE  root:0:644 -la $MAILVAR/db/aliases-2      -lm
 #| fqdnaliases     $DBTYPE  root:0:644 -la $MAILVAR/db/fqdnaliases    -lm
-#| userdb          $DBTYPE  root:0:644 -la $MAILVAR/db/userdb         -lm
+#| userdb          $DBTYPE  root:0:644 -l  $MAILVAR/db/userdb         -lm
 #|
 #|Security insensitive ones ("dbpriv" need not be defined!)
-#| fqdnaliasesldap ldap     -    -   $MAILVAR/db/fqdnalias.ldap -lm -e 2000 -s 9000
-#| fullnamemap     $DBTYPE  -    -l  $MAILVAR/db/fullnames      -lm
-#| mboxmap         $DBTYPE  -    -l  $MAILSHARE/db/mboxmap      -lm
-#| expired         $DBTYPE  -    -l  $MAILVAR/db/expiredaccts   -lm
-#| iproutesdb      $DBTYPE  -    -l  $MAILVAR/db/iproutes       -lm -d longestmatch
-#| routesdb        $DBTYPE  -    -l  $MAILVAR/db/routes         -lm -d pathalias
-#| thishost        $DBTYPE  -    -l  $MAILVAR/db/localnames     -lm -d pathalias
-#| thishost        unordered -   -   $MAILVAR/db/localnames     -l  -d pathalias
-#| thishost        bind,mxlocal - -  -                          -l  -d pathalias
-#| otherservers    unordered -   -   $MAILVAR/db/otherservers   -lm -d pathalias
-#| newsgroup       $DBTYPE  -    -l  $MAILVAR/db/active         -lm
-
-
-aliases		$DBTYPE	0:0:644    -la $MAILVAR/db/aliases		-lm
-fqdnaliases	$DBTYPE	root:0:644 -la $MAILVAR/db/fqdnaliases		-lm%
-userdb		$DBTYPE	root:0:644 -la $MAILVAR/db/userdb		-lm
+#| fqdnaliasesldap ldap   -  -   $MAILVAR/db/fqdnalias.ldap -lm -e 2000 -s 9000
+#| fullnamemap     $DBTYPE  -    -l  $MAILVAR/db/fullnames    -lm
+#| mboxmap         $DBTYPE  -    -l  $MAILSHARE/db/mboxmap    -lm
+#| expired         $DBTYPE  -    -l  $MAILVAR/db/expiredaccts -lm
+#| iproutesdb      $DBTYPE  -    -l  $MAILVAR/db/iproutes     -lmd longestmatch
+#| routesdb        $DBTYPE  -    -l  $MAILVAR/db/routes       -lm%:d pathalias
+#| thishost        $DBTYPE  -    -l  $MAILVAR/db/localnames   -lm%d  pathalias
+#| thishost        unordered -   -   $MAILVAR/db/localnames   -ld    pathalias
+#| thishost        bind,mxlocal - -  -                        -ld    pathalias
+#| otherservers    unordered -   -   $MAILVAR/db/otherservers -lmd   pathalias
+#| newsgroup       $DBTYPE  -    -l  $MAILVAR/db/active       -lm
+
+
+aliases		$DBTYPE	0:0:644    -la $MAILVAR/db/aliases	-lm
+fqdnaliases	$DBTYPE	root:0:644 -la $MAILVAR/db/fqdnaliases	-lm%
+userdb		$DBTYPE	root:0:644 -l  $MAILVAR/db/userdb	-lm
+
+routesdb	$DBTYPE	-   -l  $MAILVAR/db/routes	-lm%:d pathalias
+thishost	$DBTYPE -   -l  $MAILVAR/db/localnames	-lm%d  pathalias
+
+#| =================================================================
+#|    Set of boilerplate tail-keepers, these lookups fail ALWAYS.
+#| These are given because if user ever removes any of the relations
+#| mentioned above, the generated "RELATIONNAME.zmsh" script won't
+#| just magically disappear!
+#| =================================================================
+
+aliases		NONE - - - -
+expired		NONE - - - -
+fqdnaliasesldap	NONE - - - -
+fqdnaliases	NONE - - - -
+fullnamemap	NONE - - - -
+iproutesdb	NONE - - - -
+newsgroup	NONE - - - -
+otherservers	NONE - - - -
+routesdb	NONE - - - -
+thishost	NONE - - - -
+userdb		NONE - - - -
 
-routesdb	$DBTYPE	-	   -l  $MAILVAR/db/routes		-lm% -d pathalias
-thishost	$DBTYPE -	   -l  $MAILVAR/db/localnames		-lm -d pathalias
+#| NOTE:  mboxmap  MUST NOT exist at all if its secondary-effects
+#|        are to be avoided!
Index: zmailer/proto/db/routes
diff -u zmailer/proto/db/routes:1.4 zmailer/proto/db/routes:1.5
--- zmailer/proto/db/routes:1.4	Fri Nov 17 16:47:24 2000
+++ zmailer/proto/db/routes	Thu Mar  8 12:12:34 2001
@@ -4,6 +4,14 @@
 #	name	channel!next_destination
 # A leading . on the name indicates that all subdomains match as well
 #
+# We have TWO different fallback lookup tags:
+#       .:ERROR  for cases where ERROR MESSAGES we generated are being routed
+#       .        for general case
+#
+# This dictomy is due to need to route everything by explicite tables,
+# EXCEPT in case of errors when '.' maps to 'error!something'
+# ("We know to whom we route, others get error report back.")
+#
 # To generate runtime BINARY database of this source, issue command:
 #   $MAILBIN/newdb $MAILSHARE/db/routes
 # or in this directory with usual configuration:
@@ -36,4 +44,11 @@
 #	myself       local!
 #	news.domain  usenet!
 #	uunode.dom   uucp!uunode
+#
+#	# Usual ISP smart-host setup
+#	.	smtpx!ISP.smtp.gw
+#
+#	# Not so usual - fallback to error, except for error messages
+#	.:ERROR	smtp!
+#	.	error!notourcustomer
 #
Index: zmailer/proto/forms/delivery
diff -u zmailer/proto/forms/delivery:1.2 zmailer/proto/forms/delivery:1.3
--- zmailer/proto/forms/delivery:1.2	Wed Mar  1 17:29:21 2000
+++ zmailer/proto/forms/delivery	Tue Apr  3 14:45:38 2001
@@ -7,5 +7,5 @@
 
 Some explanations/translations for these reports
 can be found at:
-      http://www.zmailer.org/reports.html
+      http://www.zmailer.org/delivery-report-decoding.html
 
Index: zmailer/router/db.c
diff -u zmailer/router/db.c:1.24 zmailer/router/db.c:1.26
--- zmailer/router/db.c:1.24	Tue Feb 20 18:51:31 2001
+++ zmailer/router/db.c	Mon Mar 12 11:12:34 2001
@@ -82,6 +82,7 @@
 #define	DB_MODCHECK	0x04
 #define DB_NEG_CACHE	0x08
 #define DB_PERCENTSUBST	0x10
+#define DB_DEFAULTKEY	0x20
 
 
 struct db_kind {
@@ -228,7 +229,8 @@
 	int c, errflg, set_cache_size, dbtest;
 	spkey_t symid;
 	memtypes oval;
-	char *cp, *dbtyp;
+	char *cp;
+	const char *dbtyp;
 
 	if (spt_files == NULL)          spt_files          = sp_init();
 	if (spt_files->symbols == NULL) spt_files->symbols = sp_init();
@@ -236,12 +238,12 @@
 	errflg = 0;
 	dbtyp = NULL;
 	set_cache_size = 0;
-	optind = 1;
+	zoptind = 1;
 	dbtest = 0;
-	proto_config
-		= db_kinds[sizeof db_kinds/(sizeof (struct db_kind))-1].config;
+	proto_config=db_kinds[sizeof(db_kinds)/(sizeof(db_kinds[0]))-1].config;
+
 	while (1) {
-		c = getopt(argc, (char*const*)argv, "CbilmnNpud:f:s:L:t:Te:%");
+		c = zgetopt(argc,(char*const*)argv,":%CbilmnNpud:f:s:L:t:Te:");
 		if (c == EOF)
 			break;
 		switch (c) {
@@ -249,11 +251,11 @@
 			proto_config.postproc = Boolean;
 			break;
 		case 'd':	/* driver routine */
-			if (strcmp(optarg, "pathalias.nodot") == 0)
+			if (STREQ(zoptarg, "pathalias.nodot"))
 				proto_config.driver = find_nodot_domain;
-			else if (strcmp(optarg, "pathalias") == 0)
+			else if (STREQ(zoptarg, "pathalias"))
 				proto_config.driver = find_domain;
-			else if (strcmp(optarg, "longestmatch") == 0)
+			else if (STREQ(zoptarg, "longestmatch"))
 				proto_config.driver = find_longest_match;
 			else
 				++errflg;
@@ -261,7 +263,7 @@
 		case 'f':	/* file name */
 			oval = stickymem;
 			stickymem = MEM_PERM;
-			proto_config.file = strsave(optarg);
+			proto_config.file = strsave(zoptarg);
 			stickymem = oval;
 			break;
 		case 'i':	/* indirect reference postprocessor */
@@ -283,13 +285,13 @@
 			proto_config.postproc = Pathalias;
 			break;
 		case 's':	/* cache size */
-			proto_config.cache_size = atoi(optarg);
+			proto_config.cache_size = atoi(zoptarg);
 			set_cache_size = 1;
 			break;
 		case 't':	/* database type */
-			dbtyp = optarg;
-			if ((cp = strchr(optarg, ',')) != NULL
-			    || (cp = strchr(optarg, '/')) != NULL) {
+			dbtyp = zoptarg;
+			if ((cp = strchr(zoptarg, ',')) ||
+			    (cp = strchr(zoptarg, '/'))    ) {
 				*cp++ = '\0';
 				oval = stickymem;
 				stickymem = MEM_PERM;
@@ -302,7 +304,7 @@
 			dbtest = 1;
 			break;
 		case 'e':	/* expiry - cache data time to live */
-			proto_config.ttl = atol(optarg);
+			proto_config.ttl = atol(zoptarg);
 			break;
 		case 'u':	/* map all keys to uppercase */
 			proto_config.flags |= DB_MAPTOUPPER;
@@ -310,6 +312,9 @@
 		case '%':
 			proto_config.flags |= DB_PERCENTSUBST;
 			break;
+		case ':':
+			proto_config.flags |= DB_DEFAULTKEY;
+			break;
 		case 'F':	/* find routine */
 		case 'S':	/* search routine */
 		default:
@@ -317,22 +322,17 @@
 			break;
 		}
 	}
-	if (errflg || optind != argc - 1 || dbtyp == NULL) {
-		fprintf(stderr,
-		"Usage: %s -t dbtype[,subtype] [-f file -e# -s# -bilmnNpu -d driver] name\n",
-			argv[0]);
-		fprintf(stderr,
-		       "       %s -T -t dbtype dummyname\n", argv[0]);
-		fprintf(stderr,
-			"      dbtypes: ");
+	if (errflg || zoptind != argc - 1 || dbtyp == NULL) {
+		int first = 1;
+		fprintf(stderr, "Usage: %s -t dbtype[,subtype] [-f file -e# -s# -bilmnNpu -d driver] name\n", argv[0]);
+		fprintf(stderr, "       %s -T -t dbtype dummyname\n", argv[0]);
+		fprintf(stderr, "       dbtypes: ");
 		for (dbkp = &db_kinds[0];
-		     dbkp < &db_kinds[(sizeof db_kinds)/sizeof (struct db_kind)];
+		     dbkp < &db_kinds[sizeof(db_kinds)/sizeof(db_kinds[0])];
 		     ++dbkp) {
-		  if (dbkp->name != NULL) {
-		    if (dbkp == &db_kinds[0])
-		      fprintf(stderr,  "%s", dbkp->name);
-		    else
-		      fprintf(stderr, ",%s", dbkp->name);
+		  if (dbkp->name) {
+		    if (!first) fprintf(stderr, ","); first = 0;
+		    fprintf(stderr,  "%s", dbkp->name);
 		  }
 		}
 		fprintf(stderr,"\n");
@@ -345,13 +345,13 @@
 		return 2;
 	}
 	for (dbkp = &db_kinds[0];
-	     dbkp < &db_kinds[(sizeof db_kinds)/sizeof (struct db_kind)];
+	     dbkp < &db_kinds[sizeof(db_kinds)/sizeof(db_kinds[0])];
 	     ++dbkp) {
-		if (dbkp->name == NULL || strcmp(dbkp->name, dbtyp) == 0)
+		if (!dbkp->name  ||  STREQ(dbkp->name, dbtyp))
 			break;
 	}
 	/* the -1 in the following compensates for the terminating null entry */
-	if (dbkp >= &db_kinds[((sizeof db_kinds)/sizeof (struct db_kind))-1]) {
+	if (dbkp >= &db_kinds[(sizeof(db_kinds)/sizeof(db_kinds[0]))-1]) {
 	  if (!dbtest)
 	    fprintf(stderr,
 		    "relation: I don't know about the %s database type!\n",
@@ -361,24 +361,24 @@
 	if (dbtest)
 	  return 0;
 
-	symid = symbol(argv[optind]); /* Database name symbol  */
+	symid = symbol(argv[zoptind]); /* Database name symbol  */
 	if (sp_lookup(symid, spt_databases) != NULL) {
 		fprintf(stderr, "%s: %s is already a defined database!\n",
-				argv[0], argv[optind]);
+				argv[0], argv[zoptind]);
 		return 4;
 	}
 	if (spt_builtins != NULL && sp_lookup(symid, spt_builtins) != NULL) {
 		fprintf(stderr, "%s: %s is already a built in function!\n",
-				argv[0], argv[optind]);
+				argv[0], argv[zoptind]);
 		return 5;
 	}
 	if (spt_funclist != NULL && sp_lookup(symid, spt_funclist) != NULL) {
 		fprintf(stderr, "%s: %s is already a defined function!\n",
-				argv[0], argv[optind]);
+				argv[0], argv[zoptind]);
 		return 6;
 	}
 	if (proto_config.postproc == Indirect &&
-	    dbkp->config.owner != owner_seq) {
+	    dbkp->config.owner    != owner_seq) {
 		fprintf(stderr,
 			"%s: Indirect (-i) postprocessor can be used only with {un,}ordered databases!\n%s  Tried to use with: -t %s\n",
 			argv[0], argv[0], dbtyp);
@@ -386,19 +386,19 @@
 	}
 
 
-	if (dbkp->config.lookup == search_core
-	    || dbkp->config.lookup == search_header) {
+	if (dbkp->config.lookup == search_core ||
+	    dbkp->config.lookup == search_header) {
 		/* The database name is used as a key by the incore routines */
 		oval = stickymem;
 		stickymem = MEM_PERM;
-		proto_config.file = strsave(argv[optind]);
+		proto_config.file = strsave(argv[zoptind]);
 		stickymem = oval;
 		/* and the subtype is used to stash the splay tree */
 		proto_config.subtype = (char*) sp_init();
 	} else {
-		if (proto_config.file == NULL)
-			proto_config.file = dbkp->config.file;
-		if (proto_config.subtype == NULL)
+		if (! proto_config.file)
+			proto_config.file    = dbkp->config.file;
+		if (! proto_config.subtype)
 			proto_config.subtype = dbkp->config.subtype;
 	}
 	if (proto_config.flags == 0)
@@ -494,8 +494,8 @@
 
 	dbip = (struct db_info *)spl->data;
 	cp = NULL;
-	for (dbkp = &db_kinds[0];
-	     dbkp < &db_kinds[(sizeof db_kinds)/sizeof (struct db_kind)];
+	for (dbkp = &db_kinds[0] ;
+	     dbkp < &db_kinds[sizeof(db_kinds)/sizeof(db_kinds[0])] ;
 	     ++dbkp) {
 		if (dbkp->config.lookup == dbip->lookup) {
 			cp = dbkp->name;
@@ -504,8 +504,10 @@
 	}
 	printf(" %s", cp);
 	i = strlen(cp);
-	if (dbip->lookup != search_core && dbip->lookup != search_header
-	    && dbip->postproc != Indirect && dbip->subtype != NULL) {
+	if (dbip->lookup   != search_core   &&
+	    dbip->lookup   != search_header &&
+	    dbip->postproc != Indirect      &&
+	    dbip->subtype  != NULL) {
 		printf(",%s", dbip->subtype);
 		i += 1 + strlen(dbip->subtype);
 	}
@@ -513,32 +515,49 @@
 
 	printf("%*s", i, " ");
 	
-	for (i = 0, cachep = dbip->cfirst;
-	     cachep; cachep = cachep->next) ++i;
+	for (i = 0, cachep = dbip->cfirst ;
+	     cachep ; cachep = cachep->next) ++i;
 
 	printf("%4d/%-4d ", i, dbip->cache_size);
-	printf("%4d   ", (int)dbip->ttl);
+	printf("%4d ", (int)dbip->ttl);
 
 	i = 0;
 	if (dbip->flags & DB_MAPTOLOWER)
 		putchar('l'), ++i;
 	if (dbip->flags & DB_MAPTOUPPER)
-		putchar('U'), ++i;
+		putchar('u'), ++i;
+	if (dbip->flags & DB_MODCHECK)
+		putchar('m'), ++i;
+	if (dbip->flags & DB_NEG_CACHE)
+		putchar('N'), ++i;
+	if (dbip->flags & DB_PERCENTSUBST)
+		putchar('%'), ++i;
+	if (dbip->flags & DB_DEFAULTKEY)
+		putchar(':'), ++i;
 	switch (dbip->postproc) {
-	case NonNull: putchar('n'), ++i; break;
-	case Boolean: putchar('B'), ++i; break;
+	case NonNull:   putchar('n'), ++i; break;
+	case Boolean:   putchar('b'), ++i; break;
 	case Pathalias: putchar('p'), ++i; break;
-	case Indirect: putchar('@'), ++i; break;
+	case Indirect:  putchar('i'), ++i; break;
 	default: break;
 	}
+	if (dbip->driver == find_nodot_domain) {
+	  printf("{pa}");  i += 4;
+	} else if (dbip->driver == find_domain) {
+	  printf("{pa.}"); i += 5;
+	} else if (dbip->driver == find_longest_match) {
+	  printf("{lm}");  i += 4;
+	}
+	
 	if (i == 0)
 		putchar('-'), ++i;
-	i = (i > 2) ? 1 : 3 - i;
+	i = (i > 4) ? 1 : 5 - i;
 
 	printf("%*s", i, " ");
 	
-	if (dbip->lookup != search_core && dbip->lookup != search_header
-	    && dbip->file != NULL) {
+	if (dbip->lookup != search_core   &&
+	    dbip->lookup != search_header &&
+	    dbip->file   != NULL) {
 		printf("%s", dbip->file);
 		if (dbip->postproc == Indirect)
 			printf(" -> %s", dbip->subtype);
@@ -561,7 +580,7 @@
 	if (argc == 2 && (argv[1][0] == 'i' || argv[1][0] == 't')) {
 		/* print an index/toc of the databases */
 
-		printf("#DBname   Type{lookup,sub} cache{inuse/max} ttl Flgs File/param\n");
+		printf("#DBname Type{lookup,sub} cache{inuse/max} ttl Flgs File/param\n");
 
 		sp_scan(iclistdbs, (struct spblk *)NULL, spt_databases);
 		return 0;
@@ -610,10 +629,10 @@
 		}
 	}
 
-	si.file = dbip->file;
-	si.key  = argv[3];
+	si.file    = dbip->file;
+	si.key     = argv[3];
 	si.subtype = dbip->subtype;
-	si.ttl  = dbip->ttl;
+	si.ttl     = dbip->ttl;
 
 	switch (argv[1][0]) {
 	case 'a':	/* add db key value */
@@ -707,21 +726,23 @@
  */
 
 conscell *
-db(dbname, argv10)
-	const char *dbname, *argv10[];
+db(dbname, argc, argv20)
+	const char *dbname, *argv20[];
+	const int argc;
 {
 	register int keylen;
 	conscell *l, *ll, *tmp;
 	struct spblk *spl;
 	struct db_info *dbip;
 	char *realkey;
-	const char *key = argv10[0];
+	const char *key = argv20[0];
 	search_info si;
 	struct cache *cache;
 	unsigned long khash;
 	char kbuf[BUFSIZ];	/* XX: */
 	int slen;
 	GCVARS3;
+	int zoptind = 1;
 
 	now = time(NULL);
 
@@ -768,19 +789,41 @@
 	si.key     = key;
 	si.subtype = dbip->subtype;
 	si.ttl     = dbip->ttl;
-	si.argv10  = argv10;
+	si.argv20  = argv20;
 	si.argv1   = NULL;
+	si.defaultkey = NULL;
+	si.flags   = dbip->flags;
 
-	if ((dbip->flags & DB_MODCHECK)
-	    && dbip->modcheckp != NULL && (*dbip->modcheckp)(&si)) {
-		if (dbip->close != NULL) {
-			cacheflush(dbip);
-			(*dbip->close)(&si,"db modcheck");
-			if (dbip->postproc == Indirect) {
-				si.file = dbip->subtype;
-				(*dbip->close)(&si,"db modcheck indirect");
-				si.file = dbip->file;
-			}
+	zoptind = 1;
+	/* Recognize options:
+	   -: defaultval
+	   -- end of options
+	   Rest will be alike sendmail $@ "options"
+	*/
+	while (argv20[zoptind] && zoptind < argc) {
+	  if (STREQ("--",argv20[zoptind])) {
+	    ++zoptind;
+	    break;
+	  }
+	  if (STREQ("-:",argv20[zoptind])) {
+	    ++zoptind;
+	    si.defaultkey = argv20[zoptind];
+	    ++zoptind;
+	    continue;
+	  }
+	  /* ?? Other options ?? */
+	  break;
+	}
+
+	if ((dbip->flags & DB_MODCHECK) &&
+	    dbip->modcheckp  &&  (*dbip->modcheckp)(&si) &&
+	    dbip->close) {
+		cacheflush(dbip);
+		(*dbip->close)(&si,"db modcheck");
+		if (dbip->postproc == Indirect) {
+			si.file = dbip->subtype;
+			(*dbip->close)(&si,"db modcheck indirect");
+			si.file = dbip->file;
 		}
 	}
 	/* look for the desired result in the cache first */
@@ -820,7 +863,7 @@
 			   match also strings in case sensitive manner. */
 
 			if (cache->keyhash == khash &&
-			    strcmp(cache->key, key) == 0) { /* CACHE HIT! */
+			    STREQ(cache->key, key)) { /* CACHE HIT! */
 
 				/* Move this entry to the head
 				   of the LRU list */
@@ -852,10 +895,8 @@
 	  fflush(stderr);
 	}
 
-	if ((dbip->driver == NULL &&
-	     (l = (*dbip->lookup)(&si)) != NULL) ||
-	    (dbip->driver != NULL &&
-	     (l = (*dbip->driver)(dbip->lookup, &si)))) {
+	if ((!dbip->driver  && (l = (*dbip->lookup)(&si))) ||
+	    ( dbip->driver  && (l = (*dbip->driver)(dbip->lookup, &si)))) {
 
 		switch (dbip->postproc) {
 		case Boolean:
@@ -913,7 +954,7 @@
 	}
 	if (!deferit && dbip->cache_size > 0) {
 		/* insert new cache entry at head of cache */
-		if (dbip->cfree == NULL) {
+		if (! dbip->cfree ) {
 
 			/* No free slots */
 
@@ -968,7 +1009,7 @@
 	UNGCPRO3;
  post_subst:
 
-	if (ll && dbip->flags & DB_PERCENTSUBST) {
+	if (ll && (dbip->flags & DB_PERCENTSUBST)) {
 	  char *buf, *b;
 	  const char *p, *s;
 	  int i;
@@ -985,18 +1026,21 @@
 	  for (;*p;++p) {
 	    if (*p == '%' && ('0' <= p[1] && p[1] <= '9')) {
 	      ++p;
+	      s = NULL;
 	      switch (*p) {
 	      case '0':
 		s = si.key;
 		break;
 	      case '1':
 		s = si.argv1;
-		if (!s) s = si.argv10[1];
+		if (!s && zoptind < argc) s = si.argv20[zoptind];
 		break;
 	      default:
 		i = (*p - '0');
-		if (si.argv1) --i;
-		s = si.argv10[i];
+		if (si.argv1)
+		  --i;
+		if (zoptind+i < argc)
+		  s = si.argv20[zoptind+i];
 		break;
 	      }
 	      if (s)
@@ -1020,18 +1064,21 @@
 	    for (p = ll->cstring; *p; ++p) {
 	      if (*p == '%' && ('0' <= p[1] && p[1] <= '9')) {
 		++p;
+		s = NULL;
 		switch (*p) {
 		case '0':
 		  s = si.key;
 		  break;
 		case '1':
 		  s = si.argv1;
-		  if (!s) s = si.argv10[1];
+		  if (!s && zoptind < argc) s = si.argv20[zoptind];
 		  break;
 		default:
 		  i = (*p - '1');
-		  if (si.argv1) --i;
-		  s = si.argv10[i];
+		  if (si.argv1)
+		    --i;
+		  if (zoptind+i < argc)
+		    s = si.argv20[zoptind+i];
 		  break;
 		}
 		if (s)
@@ -1084,7 +1131,7 @@
 {
 	struct cache *cache, *cnext;
 
-	if (dbip == NULL || dbip->cache_size == 0 || dbip->cache == NULL)
+	if (!dbip || (dbip->cache_size == 0) || (! dbip->cache) )
 		return;
 
 	/* flush cache */
@@ -1146,7 +1193,7 @@
 		return NULL;
 	}
 	for (dbkp = &db_kinds[0];
-	     dbkp < &db_kinds[(sizeof db_kinds)/sizeof (struct db_kind)];
+	     dbkp < &db_kinds[sizeof(db_kinds)/sizeof(db_kinds[0])];
 	     ++dbkp) {
 		if (dbkp->config.lookup == dbip->lookup)
 			return dbkp->name;
@@ -1240,6 +1287,10 @@
 #endif
 	/* Still failed ?  Try to look for "." */
 	sip->key = ".";
+
+	if (sip->defaultkey)
+	  sip->key = sip->defaultkey;
+
 	l = (*lookupfn)(sip);
 	if (l) {
 		if (sip->argv1) free((void*)sip->argv1);
@@ -1377,6 +1428,10 @@
 		}
 		/* Still failed ?  Try to look for "." */
 		sip->key = ".";
+
+		if (sip->defaultkey)
+		  sip->key = sip->defaultkey;
+
 		l = (*lookupfn)(sip);
 		if (l) {
 			if (sip->argv1) free((void*)sip->argv1);
Index: zmailer/router/functions.c
diff -u zmailer/router/functions.c:1.54 zmailer/router/functions.c:1.56
--- zmailer/router/functions.c:1.54	Tue Feb 20 18:51:31 2001
+++ zmailer/router/functions.c	Mon Mar 12 11:12:34 2001
@@ -44,6 +44,7 @@
 #define ARGCV __((int argc, const char *argv[]))
 static int run_hostname    ARGCV;
 static int run_whataddress ARGCV;
+static int run_iserrormsg  ARGCV;
 static int run_erraddrlog  ARGCV;
 
 static conscell *run_dblookup __((conscell *avl, conscell *il));
@@ -102,6 +103,7 @@
 {	"trace",	run_trace,	NULL,	NULL,	0	},
 {	"untrace",	run_trace,	NULL,	NULL,	0	},
 {	"hostname",	run_hostname,	NULL,	NULL,	0	},
+{	"iserrormsg",	run_iserrormsg,	NULL,	NULL,	0	},
 {	"sender",	run_whataddress,NULL,	NULL,	0	},
 {	"recipient",	run_whataddress,NULL,	NULL,	0	},
 {	"erraddron",	run_erraddrlog,	NULL,	NULL,	0	},
@@ -209,14 +211,14 @@
 	debug = (strncmp(*argv, "un", 2) != 0);
 	while (--argc > 0) {
 		++argv;
-		if (strcmp(*argv, "off") == 0 || strcmp(*argv, "all") == 0) {
+		if (STREQ(*argv, "off")  ||  STREQ(*argv, "all")) {
 			for (dbi = &buggers[0]; dbi->name != NULL; ++dbi)
 			    if (dbi->indicator)
 				*(dbi->indicator) = (**argv == (debug?'a':'o'));
 			continue;
 		} else {
 			for (dbi = &buggers[0]; dbi->name != NULL; ++dbi) {
-				if (strcmp(*argv, dbi->name) == 0) {
+				if (STREQ(*argv, dbi->name)) {
 					if (dbi->indicator == NULL)
 					  debug = !debug; /* except */
 					else
@@ -308,6 +310,18 @@
 }
 
 /*
+ * $(iserrormsg dummyargs)  returns a flag 
+ */
+
+static int
+run_iserrormsg(argc, argv)
+	int argc;
+	const char *argv[];
+{
+	return !isErrorMsg;
+}
+
+/*
  * this is like accton(), but for logging errors in addresses.
  */
 
@@ -348,21 +362,21 @@
 	conscell *avl, *il; /* Inputs gc protected */
 {
 	conscell *l;
-	const char *argv10[10];
+	const char *argv20[20];
 	int i;
 
-	memset(argv10, 0, sizeof(argv10));
+	memset(argv20, 0, sizeof(argv20));
 
 	il = cdar(avl);
 	if (il == NULL || !STRING(il)) {
-		fprintf(stderr, "Usage: %s key [up_to_9_substitution_elements]\n", car(avl)->string);
+		fprintf(stderr, "Usage: %s key [up_to_19_substitution_elements_or_options]\n", car(avl)->string);
 		return NULL;
 	}
 	i = 0;
-	for (; il && i < 9 && STRING(il); il = cdr(il))
-	  argv10[i++] = il->string;
+	for (; il && i < 19 && STRING(il); il = cdr(il))
+	  argv20[i++] = il->string;
 
-	l = db(car(avl)->string, argv10);
+	l = db(car(avl)->string, i, argv20);
 	if (l == NULL)
 		return NULL;
 	return l;
@@ -485,10 +499,10 @@
 
 	verbose = 0;
 	indexfile = NULL;
-	optind = 1;
+	zoptind = 1;
 	errflg = 0;
 	while (1) {
-		c = getopt(argc, (char*const*)argv, "vo:t");
+		c = zgetopt(argc, (char*const*)argv, "vo:t");
 		if (c == EOF)
 			break;
 		switch (c) {
@@ -496,7 +510,7 @@
 			++verbose;
 			break;
 		case 'o':
-			indexfile = optarg;
+			indexfile = zoptarg;
 			break;
 		case 't':
 			tabsep = 1;
@@ -506,7 +520,7 @@
 			break;
 		}
 	}
-	if (errflg || optind != argc - 1) {
+	if (errflg || zoptind != argc - 1) {
 		fprintf(stderr,
 			"Usage: %s [ -v ] [ -o indexoutputfile ] aliasfile\n",
 			argv[0]);
@@ -514,9 +528,9 @@
 	}
 
 	e = (struct envelope *)tmalloc(sizeof (struct envelope));
-	if ((e->e_fp = fopen(argv[optind], "r")) == NULL) {
+	if ((e->e_fp = fopen(argv[zoptind], "r")) == NULL) {
 		c = errno;
-		fprintf(stderr, "%s: open(\"%s\"): ", argv[0], argv[optind]);
+		fprintf(stderr, "%s: open(\"%s\"): ", argv[0], argv[zoptind]);
 		errno = c;
 		perror("");
 		status = PERR_BADOPEN;
@@ -524,7 +538,7 @@
 		setvbuf(e->e_fp, buf, _IOFBF, sizeof buf);
 		osiop = siofds[FILENO(e->e_fp)];
 		siofds[FILENO(e->e_fp)] = NULL;
-		e->e_file = argv[optind];
+		e->e_file = argv[zoptind];
 		status = makeLetter(e, 1);	/* Parse the aliases database
 						   as if all entries were of
 						   same syntax as "To:" et.al.
@@ -593,7 +607,7 @@
 		size = ftell(stdout);
 		if (size - prevsize > maxsize)
 			maxsize = size - prevsize;
-		if (*cp == *(h->h_pname) && strcmp(cp, h->h_pname) == 0) {
+		if (*cp == *(h->h_pname) && STREQ(cp, h->h_pname)) {
 			fprintf(stderr, "%s: multiple definitions of '%s'.\n",
 					argv[0], h->h_pname);
 			cp = ":";
@@ -718,7 +732,7 @@
 	for (lc = l; lc && cdr(lc); pl = &cddr(lc),lc = *pl) {
 	  if (!STRING(lc))
 	    return 0; /* ?? */
-	  if (strcmp("DSN",lc->string)==0) {
+	  if (STREQ("DSN",lc->string)) {
 	    lc = cdr(lc);
 	    if (!lc || !STRING(lc))
 	      return 0;
@@ -887,7 +901,7 @@
 	for (lc = l; lc && cdr(lc); pl = &cddr(lc),lc = *pl) {
 	  if (!STRING(lc))
 	    return 0; /* ?? */
-	  if (strcmp("DSN",lc->string)==0) {
+	  if (STREQ("DSN",lc->string)) {
 	    lc = cdr(lc);
 	    if (!lc || !STRING(lc))
 	      return 0;
@@ -1035,15 +1049,14 @@
 	errflag = 0;
 	erroraddress = NULL;
 	comment = "list";
-	optind = 1;
+	zoptind = 1;
 
 	while (il != NULL && STRING(il) && il->string[0] == '-' &&
 	       cdr(il) != NULL && STRING(cdr(il))) {
 	  switch( il->string[1] ) {
 	    case 'c':
 	      comment = (char*)cdr(il)->string;
-	      if (strchr(comment,'\n') != NULL ||
-		  strchr(comment,'\r') != NULL)
+	      if (strchr(comment,'\n') || strchr(comment,'\r'))
 		errflag = 1;
 	      break;
 	    case 'p':
@@ -1051,25 +1064,21 @@
 	      break;
 	    case 'e':
 	      erroraddress = (char*)cdr(il)->string;
-	      if (strchr(erroraddress,'\n') != NULL ||
-		  strchr(erroraddress,'\r') != NULL)
+	      if (strchr(erroraddress,'\n') || strchr(erroraddress,'\r'))
 		errflag = 1;
 	      break;
 	    case 'E':
 	      if (errors_to != olderrors)
 		free(errors_to);
 	      errors_to = strdup((char*)cdr(il)->string);
-	      if (strchr(errors_to,'\n') != NULL ||
-		  strchr(errors_to,'\r') != NULL)
+	      if (strchr(errors_to,'\n') || strchr(errors_to,'\r'))
 		errflag = 1;
 	      break;
 	    case 'N':
 	      notary = (char *)cdr(il)->string;
-	      if (strchr(notary,'\n') != NULL ||
-		  strchr(notary,'\r') != NULL)
+	      if (strchr(notary,'\n') || strchr(notary,'\r'))
 		errflag = 1;
-	      if (strcmp(notary,"-")==0)
-		no_dsn = 1;
+	      if (STREQ(notary,"-")) no_dsn = 1;
 	      break;
 	    default:
 	      errflag = 1;
@@ -1203,7 +1212,7 @@
 		  ++errcount;
 		  if (hs.h_stamp == BadHeader) {
 		    if (erroraddress != NULL) {
-		      if (!iserrmessage()) {
+		      if (!isErrChannel) {
 			if (mfp == NULL) {
 			  if ((mfp = mail_open(MSG_RFC822)) != NULL) {
 			    osiop = siofds[FILENO(mfp)];
@@ -1548,23 +1557,23 @@
 	errflag = 0;
 	erroraddress = NULL;
 	comment = "list";
-	optind = 1;
+	zoptind = 1;
 
 	while (1) {
-		c = getopt(argc, (char*const*)argv, "c:e:E:");
+		c = zgetopt(argc, (char*const*)argv, "c:e:E:");
 		if (c == EOF)
 			break;
 		switch (c) {
 		case 'c':
-			comment = optarg;
+			comment = zoptarg;
 			break;
 		case 'e':
-			erroraddress = optarg;
+			erroraddress = zoptarg;
 			break;
 		case 'E':
 			if (errors_to != old_errorsto)
 			  free(errors_to);
-			errors_to = (void*)strdup(optarg);
+			errors_to = (void*)strdup(zoptarg);
 			break;
 		default:
 			++errflag;
@@ -1676,7 +1685,7 @@
 		  ++errcount;
 		  if (hs.h_stamp == BadHeader) {
 		    if (erroraddress != NULL) {
-		      if (!iserrmessage()) {
+		      if (!isErrChannel) {
 			if (mfp == NULL) {
 			  if ((mfp = mail_open(MSG_RFC822)) != NULL) {
 			    osiop = siofds[FILENO(mfp)];
@@ -1852,7 +1861,7 @@
 	time_t dnow;
 
 	time(&dnow);
-	if (argc == 2 && strcmp(argv[1], "-s") == 0)
+	if (argc == 2 && STREQ(argv[1], "-s"))
 		printf("%ld\n", dnow);
 	else
 		printf("%s", rfc822date(&dnow));
@@ -2113,7 +2122,7 @@
 	else
 		++cp;
 	if (argc > 2 && (len = strlen(cp) - strlen(argv[2])) > 0) {
-		if (strcmp(cp + len, argv[2]) == 0) {
+		if (STREQ(cp + len, argv[2])) {
 			while (len-- > 0)
 				putchar(*cp++);
 			putchar('\n');
@@ -2132,26 +2141,26 @@
 	int c;
 	int prio = LOG_INFO;
 	int errflg = 0;
-	optind = 1;
+	zoptind = 1;
 
-	while ((c = getopt(argc, (char*const*)argv, "p:")) != EOF) {
+	while ((c = zgetopt(argc, (char*const*)argv, "p:")) != EOF) {
 		switch (c) {
 		case 'p':	/* priority */
-			if(!strcmp(optarg, "debug")) {
+			if(STREQ(zoptarg, "debug")) {
 				prio = LOG_DEBUG;
-			} else if(!strcmp(optarg, "info")) {
+			} else if(STREQ(zoptarg, "info")) {
 				prio = LOG_INFO;
-			} else if(!strcmp(optarg, "notice")) {
+			} else if(STREQ(zoptarg, "notice")) {
 				prio = LOG_NOTICE;
-			} else if(!strcmp(optarg, "warning")) {
+			} else if(STREQ(zoptarg, "warning")) {
 				prio = LOG_WARNING;
-			} else if(!strcmp(optarg, "err")) {
+			} else if(STREQ(zoptarg, "err")) {
 				prio = LOG_ERR;
-			} else if(!strcmp(optarg, "crit")) {
+			} else if(STREQ(zoptarg, "crit")) {
 				prio = LOG_CRIT;
-			} else if(!strcmp(optarg, "alert")) {
+			} else if(STREQ(zoptarg, "alert")) {
 				prio = LOG_ALERT;
-			} else if(!strcmp(optarg, "emerg")) {
+			} else if(STREQ(zoptarg, "emerg")) {
 				prio = LOG_EMERG;
 			} else {
 				++errflg;
@@ -2163,11 +2172,11 @@
 		}
 	}
 
-	if (errflg || optind != argc - 1) {
+	if (errflg || zoptind != argc - 1) {
 		fprintf(stderr, "Usage: %s [-p prio] string\n", argv[0]);
 		return 1;
 	}
-	zsyslog((prio, "%s", argv[optind]));
+	zsyslog((prio, "%s", argv[zoptind]));
 	return 0;
 }
 
@@ -2179,11 +2188,11 @@
 	char *cp;
 	int c, flag, errflg, action = 0;
 
-	optind = 1;
+	zoptind = 1;
 	errflg = 0;
 
 	while (1) {
-		c = getopt(argc, (char*const*)argv, "ulp");
+		c = zgetopt(argc, (char*const*)argv, "ulp");
 		if (c == EOF)
 			break;
 		switch (c) {
@@ -2197,7 +2206,7 @@
 			break;
 		}
 	}
-	if (errflg || optind != argc - 1) {
+	if (errflg || zoptind != argc - 1) {
 		fprintf(stderr, "Usage: %s [ -u | -l | -p ] string\n",
 				argv[0]);
 		return 1;
@@ -2205,14 +2214,14 @@
 
 	switch (action) {
 	case 'u':
-		strupper((char*)argv[optind]);
+		strupper((char*)argv[zoptind]);
 		break;
 	case 'l':
-		strlower((char*)argv[optind]);
+		strlower((char*)argv[zoptind]);
 		break;
 	case 'p':
 		flag = 1;
-		for (cp = (char*)argv[optind]; *cp != '\0'; ++cp) {
+		for (cp = (char*)argv[zoptind]; *cp != '\0'; ++cp) {
 			if (isascii(*cp) && isalnum(*cp)) {
 				if (flag && islower(*cp))
 					*cp = toupper(*cp);
@@ -2224,7 +2233,7 @@
 		}
 		break;
 	}
-	printf("%s\n", argv[optind]);
+	printf("%s\n", argv[zoptind]);
 	return 0;
 }
 
@@ -2287,7 +2296,7 @@
 		} else
 			flag = 1;
 		for (j = 0; j < (sizeof fyitable / sizeof fyitable[0]); ++j) {
-			if (cistrcmp(argv[i], fyitable[j].fyiname) == 0) {
+			if (CISTREQ(argv[i], fyitable[j].fyiname)) {
 				fyitable[j].fyisave = flag;
 				j = -1;
 				break;
@@ -2362,31 +2371,31 @@
 	/* We remove quotes when they are not needed, and add them when
 	   they really are needed! */
 
-	optind = 1;
+	zoptind = 1;
 	while (1) {
-	  c = getopt(argc, (char*const*)argv, "s:a:");
+	  c = zgetopt(argc, (char*const*)argv, "s:a:");
 	    
 	  if (c == EOF) break;
 	  switch (c) {
 	  case 's':
-	    spc = *optarg; /* First char only */
+	    spc = *zoptarg; /* First char only */
 	    break;
 	  case 'a':
-	    appstr = optarg;
+	    appstr = zoptarg;
 	    break;
 	  default:
 	    ++errflg;
 	    break;
 	  }
 	}
-	if (errflg || optind != argc - 1) {
+	if (errflg || zoptind != argc - 1) {
 	  fprintf(stderr,
 		  "Usage: %s [ -s SPCCHR ] [ -a APPENDSTR ] string\n",
 		  argv[0]);
 	  return 1;
 	}
 
-	s = argv[optind];
+	s = argv[zoptind];
 
 	mustquote = rfc822_mustquote(s, spc);
 	/* A bitset:
Index: zmailer/router/prototypes.h
diff -u zmailer/router/prototypes.h:1.12 zmailer/router/prototypes.h:1.14
--- zmailer/router/prototypes.h:1.12	Fri Feb 16 03:12:31 2001
+++ zmailer/router/prototypes.h	Thu Mar  8 12:12:34 2001
@@ -72,7 +72,7 @@
 extern int	run_relation __((int argc, const char *argv[]));
 extern struct sptree *icdbspltree __((const char *name));
 extern int	run_db __((int argc, const char *argv[]));
-extern conscell	  *db     __((const char *dbname, const char *argv10[]));
+extern conscell	  *db     __((const char *dbname, const int argc, const char *argv10[]));
 extern const char *dbfile __((const char *dbname));
 extern void	   dbfree __((void));
 extern const char *dbtype __((const char *dbname));
@@ -112,6 +112,8 @@
 extern void	dumpHeader __((struct header *h));
 extern int	isSenderAddr;
 extern int	isRecpntAddr;
+extern int	isErrorMsg;
+extern int	isErrChannel;
 extern void	squirrel __((struct envelope *e, const char *keyword, const char *text));
 extern struct header	*erraddress __((struct envelope *e));
 extern void	defer __((struct envelope *e, const char *why));
@@ -120,7 +122,6 @@
 extern conscell	*pickaddress __((conscell *l));
 extern int	thesender __((struct envelope *e, struct address *a));
 extern conscell	*makequad __((void));
-extern int	iserrmessage __((void));
 extern int	sequencer __((struct envelope *e, const char *file));
 
 /* File: rfc822hdrs.c */
@@ -165,7 +166,7 @@
 extern int   do_hdr_warning;
 
 /* File: rtsyslog.c */
-extern void rtsyslog __(( time_t msgmtime, long msgino, const char *from, const char *smtprelay, int size, int nrcpts, const char *msgid ));
+extern void rtsyslog __(( time_t msgmtime, long msgino, const char *from, const char *smtprelay, const int size, const int nrcpts, const char *msgid, const time_t starttime ));
 
 extern int	main __((int argc, const char *argv[]));
 extern int	login_to_uid __((const char *name));
Index: zmailer/router/rfc822.c
diff -u zmailer/router/rfc822.c:1.50 zmailer/router/rfc822.c:1.54
--- zmailer/router/rfc822.c:1.50	Mon Jan 15 17:12:08 2001
+++ zmailer/router/rfc822.c	Tue Apr  3 14:45:38 2001
@@ -79,14 +79,13 @@
 	return l;
 }
 
-struct envelope *qate;
-
-int
-iserrmessage()
+static int
+iserrmessage(e)
+     struct envelope *e;
 {
-	return (qate      &&   qate->e_from_trusted   &&
-		(QCHANNEL(qate->e_from_trusted)->cstring == NULL ||
-		 CISTREQ(QCHANNEL(qate->e_from_trusted)->cstring, "error")));
+	return (e   &&   e->e_from_trusted   &&
+		(QCHANNEL(e->e_from_trusted)->cstring == NULL ||
+		 CISTREQ(QCHANNEL(e->e_from_trusted)->cstring, "error")));
 }
 
 
@@ -123,7 +122,8 @@
 #if 0
 	{
 	  int c;
-	  while ((c = getopt(argc, argv, "")) != EOF) {
+	  zoptind = 1;
+	  while ((c = zgetopt(argc, argv, "")) != EOF) {
 	    switch (c) {
 	    default:
 	      ++errflg;
@@ -131,7 +131,7 @@
 	    }
 	  }
 	}
-	if (errflg || optind != (argc - 1))
+	if (errflg || zoptind != (argc - 1))
 #endif
 	if (argc != 2)
 	  {
@@ -139,7 +139,7 @@
 		return PERR_USAGE;
 	}
 
-	/* file = argv[optind]; */
+	/* file = argv[zoptind]; */
 	file = argv[1];
 
 #ifdef	XMEM
@@ -152,7 +152,6 @@
 	/* XXX: If this tmalloc() fails, we crash! */
 	memset(e, 0, sizeof(*e)); /* Lots of pointers, etc here! */
 	GCPRO2(e->e_from_trusted, e->e_from_resolved);
-	qate = e;
 
 	if ((e->e_fp = fopen(file, "r")) == NULL) {
 	  fprintf(stderr, "router: cannot open %s\n", file);
@@ -256,17 +255,17 @@
 	e->e_msgOffset = 0;
 	e->e_nowtime = now = time(NULL);
 	if (efstat(FILENO(e->e_fp), &(e->e_statbuf)) < 0) {
-#ifdef	HAVE_ST_BLKSIZE
+#ifdef	HAVE_STRUCT_STAT_ST_BLKSIZE
 		e->e_statbuf.st_blksize = 0;
-#endif	/* !HAVE_ST_BLKSIZE */
+#endif	/* !HAVE_STRUCT_STAT_ST_BLKSIZE */
 		e->e_statbuf.st_mtime = e->e_nowtime;
 	}
 	e->e_localtime = *(localtime(&(e->e_statbuf.st_mtime)));
-#ifdef	HAVE_ST_BLKSIZE
+#ifdef	HAVE_STRUCT_STAT_ST_BLKSIZE
 	initzline((int)e->e_statbuf.st_blksize);
-#else	/* !HAVE_ST_BLKSIZE */
+#else	/* !HAVE_STRUCT_STAT_ST_BLKSIZE */
 	initzline(4096);
-#endif	/* !HAVE_ST_BLKSIZE */
+#endif	/* !HAVE_STRUCT_STAT_ST_BLKSIZE */
 
 	inheader = 0;
 	while ((n = zgetline(e->e_fp)) > !octothorp) {
@@ -495,9 +494,16 @@
  * can find out whether they are dealing with a sender or recipient address.
  * The variables are accessed through C coded config file functions.
  */
-int	isSenderAddr = 0;
-int	isRecpntAddr = 0;
+int	isSenderAddr;
+int	isRecpntAddr;
 
+/*
+ * Routing can sometimes want to have different view of the world when
+ * the message is _internally_ tagged with an 'errormsg' envelope header.
+ */
+int	isErrorMsg;
+int	isErrChannel;
+
 
 #define FindEnvelope(X)	\
 	for (h = e->e_eHeaders; h != NULL; h = h->h_next) \
@@ -619,10 +625,10 @@
 	if (h == NULL) {
 		/* everything else failed, so use the owner of the file */
 		if (!e->e_trusted)
-			h = mkSender(e, uidpwnam(e->e_statbuf.st_uid), 1);
+/*ROUTER*/		h = mkSender(e, uidpwnam(e->e_statbuf.st_uid), 1);
 #if	0
 		else
-			h = mkSender(e, POSTMASTER, 1);
+/*ROUTER*/		h = mkSender(e, POSTMASTER, 1);
 #endif
 	}
 	return h;
@@ -665,7 +671,7 @@
 {
 	const char *s = cs->cstring;
 
-	return (s == NULL || *s == '\0' || strcmp(s, "-") == 0);
+	return ( !s || *s == '\0' || STREQ(s, "-") );
 	/* actually we should also check for localhostness, but lets not
 	   get carried away... */
 }
@@ -920,7 +926,7 @@
 		h = NULL;
 	if (h  &&  !flag  &&  !e->e_trusted) {
 		/* make sure the pretty login is valid. see thesender() */
-		l = router(h->h_contents.a, e->e_statbuf.st_uid, "sender", NULL);
+/*ROUTER*/	l = router(h->h_contents.a, e->e_statbuf.st_uid, "sender", NULL);
 		if (l) {
 			l = pickaddress(l);
 			flag = (QUSER(l) == NULL || !nullhost(QHOST(l)));
@@ -968,7 +974,7 @@
 	}
 	*ppp = NULL;
 	if (l == NULL && !e->e_trusted) {
-		l = router(sh->h_contents.a, e->e_statbuf.st_uid, "sender", NULL);
+/*ROUTER*/	l = router(sh->h_contents.a, e->e_statbuf.st_uid, "sender", NULL);
 		if (l)
 			e->e_from_trusted = pickaddress(l);
 	}
@@ -1132,7 +1138,7 @@
 {
 	conscell *l; /* Var life ends after return.. no GC protection */
 
-	l = router(a, e->e_statbuf.st_uid, "sender", NULL);
+/*ROUTER*/ l = router(a, e->e_statbuf.st_uid, "sender", NULL);
 	if (l == NULL)
 		return 0;
 	e->e_from_resolved = pickaddress(l);
@@ -1216,8 +1222,11 @@
 	const char     *senderstr;
 	char subdirhash[8];
 	struct notary *DSN;
+	time_t start_now;
 	GCVARS5;
 
+	time(&start_now);
+
 	if (schedulersubdirhash < 0) {
 	  const char *s = getzenv("SCHEDULERDIRHASH");
 	  if (s && ((s[0] == '1' || s[0] == '2') && s[1] == 0))
@@ -1456,10 +1465,10 @@
 			h = copySender(e);
 		} else {
 			dprintf("Generate a sender based on owner of file\n");
-			h = mkSender(e, uidpwnam(e->e_statbuf.st_uid), 0);
+/*ROUTER*/		h = mkSender(e, uidpwnam(e->e_statbuf.st_uid), 0);
 		}
 		if (h == NULL)
-			h = mkSender(e, POSTMASTER, 1);
+/*ROUTER*/		h = mkSender(e, POSTMASTER, 1);
 		/* assert h != NULL */
 		h->h_next = e->e_eHeaders;
 		e->e_eHeaders = h;
@@ -1473,12 +1482,12 @@
 		dprintf("A sender was specified in the envelope\n");
 		if (!e->e_trusted) {
 			dprintf("Replace the sender based on owner of file\n");
-			h = mkSender(e, uidpwnam(e->e_statbuf.st_uid), 0);
+/*ROUTER*/		h = mkSender(e, uidpwnam(e->e_statbuf.st_uid), 0);
 		} else {
 			dprintf("Provide a full name for the originator\n");
 			/* ensure there is a fullnamemap entry */
 			login_to_uid(t->t_pname);
-			h = mkSender(e, t->t_pname, 0);
+/*ROUTER*/		h = mkSender(e, t->t_pname, 0);
 		}
 		h->h_next = e->e_eHeaders;
 		e->e_eHeaders = h;
@@ -1507,8 +1516,17 @@
 	dprintf("Originating channel determination\n");
 	def_uid = nobody;
 
+	isErrorMsg   = 0;
+	isErrChannel = 0;
+
 	if (e->e_trusted) {
 		/* The sender uid is known */
+
+		/* Is it perhaps an ERROR MESSAGE ? */
+		FindEnvelope(eErrorMsg);
+		if (h) isErrorMsg = 1;
+
+		/* Does it have CHANNEL ?  Is it "ERROR" ? */ 
 		FindEnvelope(eChannel);
 		if (h) {
 			dprintf("A channel was specified\n");
@@ -1529,6 +1547,9 @@
 				 */
 				optsave(FYI_NOCHANNEL, e);
 			}
+			if (iserrmessage(e))
+			  isErrChannel = 1;
+
 		}
 
 		h = rcvdhdr; /* FindEnvelopeLast(eRcvdFrom); */
@@ -1564,29 +1585,48 @@
 			  if (h == NULL || h->h_stamp == BadHeader)
 			    FindHeader("from",!e->e_resent);
 			  if (h == NULL || h->h_stamp == BadHeader)
-			    h = mkSender(e,uidpwnam(e->e_statbuf.st_uid),0);
+			    /* BAD input, must try to do something.. */
+/*ROUTER*/		    h = mkSender(e,uidpwnam(e->e_statbuf.st_uid),0);
 			}
 			if (h == NULL)
 				abort(); /* Failed to make sender header */
 
-			/* This conscell lifetime is limited.. */
-			l = router(h->h_contents.a,
+			if (isErrChannel) {
+			    char *ss = (char*)tmalloc(10);
+			    strcpy(ss, "from <>");
+
+			    h = makeHeader(spt_eheaders, ss, 4);
+			    h->h_lines = makeToken(ss+5,2);
+			    h->h_lines->t_type = Line;
+			    h->h_contents = hdr_scanparse(e, h, 0, 0);
+			    /* And now we bend the result beyond any
+			       recognition.. */
+			    h->h_contents.a->a_tokens->p_type     =  anAddress;
+			    h->h_contents.a->a_tokens->p_tokens->t_len  = 2;
+			    h->h_contents.a->a_tokens->p_tokens->t_type = Atom;
+			    h->h_contents.a->a_tokens->p_tokens->t_next = NULL;
+			    h->h_stamp = hdr_type(h);
+			}
+
+			/* This conscell lifetime is limited, no GC protect. */
+/*ROUTER*/		l = router(h->h_contents.a,
 				   e->e_statbuf.st_uid, "sender", NULL);
+
 			if (l == NULL) {
 			  /* From: <>,  and no envelope 'from' .. */
-			  h = mkSender(e,uidpwnam(e->e_statbuf.st_uid),0);
+/*ROUTER*/		  h = mkSender(e,uidpwnam(e->e_statbuf.st_uid),0);
 			  if (h == NULL)
 			    abort(); /* Can't make Sender header ?? */
-			  l = router(h->h_contents.a,
+/*ROUTER*/		  l = router(h->h_contents.a,
 				     e->e_statbuf.st_uid, "sender", NULL);
 			}
 			if (l) {
-				/*
-				 * In case the router returns several addresses,
-				 * we pick one at random to use for sender priv
-				 * determination.
-				 */
-				e->e_from_resolved = pickaddress(l);
+			  /*
+			   * In case the router returns several addresses,
+			   * we pick one at random to use for sender priv
+			   * determination.
+			   */
+			  e->e_from_resolved = pickaddress(l);
 			}
 		}
 		if (nullhost(QHOST(e->e_from_resolved)) &&
@@ -1617,7 +1657,7 @@
 		}
 		if (h && h->h_contents.a) {
 			/* a Sender: was given */
-			if (!thesender(e, h->h_contents.a)) {
+/*ROUTER*/			if (!thesender(e, h->h_contents.a)) {
 				/* but it is fake, so correct it */
 				dprintf("The Sender: is not the sender\n");
 				set_pname(e, h, "Fake-Sender");
@@ -1625,12 +1665,12 @@
 				h = NULL;
 		} else if (nh  &&  nh->h_contents.a) {
 			/* only a From: was given */
-			if (!thesender(e, nh->h_contents.a)) {
+/*ROUTER*/		if (!thesender(e, nh->h_contents.a)) {
 			  /* but it is fake, so add a Sender: */
 			  dprintf("The From: is not the sender\n");
 			  if (h) {
 			    /* use our empty Sender: */
-			    ph = mkSender(e,uidpwnam(e->e_statbuf.st_uid),0);
+/*ROUTER*/		    ph = mkSender(e,uidpwnam(e->e_statbuf.st_uid),0);
 			    h->h_contents.a = ph->h_contents.a;
 			    h = NULL;
 			  } else
@@ -1639,7 +1679,7 @@
 			  h = NULL;
 		}
 		if (h) {
-		  InsertHeader(h,mkSender(e, uidpwnam(e->e_statbuf.st_uid),0));
+/*ROUTER*/	  InsertHeader(h,mkSender(e, uidpwnam(e->e_statbuf.st_uid),0));
 		  set_pname(e, nh, "Sender");
 		}
 	}
@@ -1753,33 +1793,25 @@
 			dprintf(" none available!\n");
 			optsave(FYI_NOSENDER, e);
 		} else {
-			FindEnvelope(eChannel);
-			if (h) {
-			  if ((ap = h->h_contents.a) != NULL
-			      && (p = ap->a_tokens) != NULL
-			      && (p->p_tokens != NULL)) {
-			    t = p->p_tokens;
-			    if (TOKENLEN(t) == 5 &&
-				strncmp(t->t_pname,"error",5)==0) {
-
-			      char *ss = (char*)tmalloc(10);
-			      strcpy(ss, "From: <>");
-
-			      nh = makeHeader(spt_headers, ss, 4);
-			      nh->h_lines = makeToken(ss+5,3);
-			      nh->h_lines->t_type = Line;
-			      nh->h_contents = hdr_scanparse(e, nh, 0, 0);
-			      nh->h_stamp = hdr_type(nh);
-			      FindHeader("to",e->e_resent);
-			      if (h == NULL) {
-				for (h = e->e_headers; h != NULL; h = h->h_next)
-				  if (CISTREQ(h->h_pname, "subject"))
-				    break;
-			      }
-			      InsertHeader(h, nh);
-			      dprintf(" nope (added)!\n");
+			if (isErrChannel) {
+
+			    char *ss = (char*)tmalloc(10);
+			    strcpy(ss, "From: <>");
+
+			    nh = makeHeader(spt_headers, ss, 4);
+			    nh->h_lines = makeToken(ss+5,3);
+			    nh->h_lines->t_type = Line;
+			    nh->h_contents = hdr_scanparse(e, nh, 0, 0);
+			    nh->h_stamp = hdr_type(nh);
+			    FindHeader("to",e->e_resent);
+			    if (h == NULL) {
+			      for (h = e->e_headers; h != NULL; h = h->h_next)
+				if (CISTREQ(h->h_pname, "subject"))
+				  break;
 			    }
-			  }
+			    InsertHeader(h, nh);
+			    dprintf(" nope (added)!\n");
+
 			} else {
 
 			  /* We make a copy of eFrom envelope header
@@ -1847,7 +1879,7 @@
 	errors_to = NULL;
 	senderstr = NULL;
 	if (e->e_from_trusted) {
-	  if (CISTREQ("error",QCHANNEL(e->e_from_trusted)->cstring)) {
+	  if (isErrChannel) {
 	    senderstr = "<>"; /* From "BOX" -- from an error channel! */
 	  } else {
 	    senderstr = QUSER(e->e_from_trusted)->cstring;
@@ -1883,7 +1915,7 @@
 			DSN = NULL;
 		}
 		for (a = h->h_contents.a; a != NULL; a = a->a_next) {
-			l = router(a, def_uid, "recipient", senderstr);
+/*ROUTER*/		l = router(a, def_uid, "recipient", senderstr);
 			if (l == NULL)
 				continue;
 
@@ -2045,6 +2077,7 @@
 	}
 
 	isSenderAddr = isRecpntAddr = 0;
+
 	dprintf("Make sure Date, From, To, are in the header\n");
 	FindHeader("date",e->e_resent);
 	if (h == NULL)
@@ -2098,6 +2131,9 @@
 		fchmod(FILENO(ofp), 0460);
 	}
 
+	fprintf(ofp, "%c%c0x%08lx\n",
+		_CF_FORMAT, _CFTAG_NORMAL, (long)_CF_FORMAT_KNOWN_SET);
+
 	FindEnvelope(eVerbose);
 	if (h  &&  h->h_contents.a  &&  h->h_contents.a->a_tokens) {
 		if (h->h_contents.a->a_tokens->p_tokens    &&
@@ -2126,9 +2162,6 @@
 	} else
 		vfp = NULL;
 
-	fprintf(ofp, "%c%c0x%08lx\n",
-		_CF_FORMAT, _CFTAG_NORMAL, (long)_CF_FORMAT_KNOWN_SET);
-
 	fprintf(ofp, "%c%c%s\n",
 		_CF_MESSAGEID, _CFTAG_NORMAL, file);
 	fprintf(ofp, "%c%c%d\n",
@@ -2152,7 +2185,7 @@
 	 * to your disk space.
 	 */
 
-	if (!iserrmessage()) {
+	if (!isErrChannel) {
 #if 1
                 if (errors_to) {        /* [mea@utu.fi] Stupid, but workable.. */
                         putc(_CF_ERRORADDR, ofp);
@@ -2242,7 +2275,7 @@
 			ofperrors |= ferror(ofp);
 			if (ofperrors) break; /* Sigh.. */
 
-			if (!iserrmessage() && nsp->errto &&
+			if (!isErrChannel && nsp->errto &&
 			    nsp->errto->string) {
 				/* print envelope sender address */
 				putc(_CF_ERRORADDR, ofp);
@@ -2418,7 +2451,7 @@
 
 	rtsyslog(e->e_statbuf.st_mtime, (long)e->e_statbuf.st_ino,
 		 fromaddr, smtprelay, (int) e->e_statbuf.st_size,
-		 nrcpts, msgidstr);
+		 nrcpts, msgidstr, start_now);
 
 #ifndef	USE_ALLOCA
 	free(ofpname);
@@ -2467,9 +2500,8 @@
 		&& LIST(x)) {	    /* ... and it is a list */
 	      /* Find the 'privilege' item */
 	      for (x = car(x); x != NULL; x = cddr(x)) {
-		if (STRING(x)
-		    && strcmp((char *)x->string,
-			      "privilege") == 0) {
+		if (STRING(x) &&
+		    STREQ((char *)x->string, "privilege")) {
 		  x = cdr(x);
 		  break;
 		}
@@ -2523,10 +2555,10 @@
 	    }
 	    if (cdr(l))
 	      putc(' ', fp);
-	  } else if (channel && strcmp(channel,"error")!=0)
+	  } else if (channel && !STREQ(channel,"error"))
 	    fprintf(stderr, "Malformed %s\n", comment);
 	}
-	if ((cfflag == _CF_SENDER) && channel && strcmp(channel,"error") == 0)
+	if ((cfflag == _CF_SENDER) && channel && STREQ(channel,"error"))
 		user = ""; /* error channel source address -> no user! */
 
 	if (!privilege) {
@@ -2602,7 +2634,7 @@
 	for (x = cadr(info); x != NULL; x = cddr(x)) {
 	  if (!STRING(x))
 	    return NULL; /* error in data */
-	  if (strcmp((char *)x->string,"ERR") == 0) {
+	  if (STREQ((char *)x->string,"ERR")) {
 	    x = cdr(x);
 	    break;
 	  }
Index: zmailer/router/rfc822hdrs.c
diff -u zmailer/router/rfc822hdrs.c:1.20 zmailer/router/rfc822hdrs.c:1.22
--- zmailer/router/rfc822hdrs.c:1.20	Wed Mar 29 22:37:40 2000
+++ zmailer/router/rfc822hdrs.c	Mon Mar 12 11:12:34 2001
@@ -273,8 +273,8 @@
 		cp = h->h_descriptor->hdr_name + e->e_resent;
 		for (cpp = prio_list; *cpp != NULL; ++cpp) {
 			/* printf("comparing '%s' and '%s'\n", *cpp, cp); */
-			if (**cpp == *cp && strcmp(*cpp, cp) == 0
-			    && (cpp - prio_list) < minval) {
+			if (**cpp == *cp  &&  STREQ(*cpp, cp) &&
+			    (cpp - prio_list) < minval) {
 				best = h;
 				minval = cpp - prio_list;
 			}
@@ -566,7 +566,7 @@
 			if (pp)
 			  col = printLAddress(fp, pp, col, 8, 0);
 			else
-			  fprintf(fp, "(nil??)"), col += 7;
+			  fprintf(fp, "(nil?\?)"), col += 7;
 		    }
 		    hadspc = 0;
 		}
Index: zmailer/router/rfc822test.c
diff -u zmailer/router/rfc822test.c:1.2 zmailer/router/rfc822test.c:1.3
--- zmailer/router/rfc822test.c:1.2	Sat Mar 18 22:57:17 2000
+++ zmailer/router/rfc822test.c	Thu Mar  8 12:12:34 2001
@@ -6,10 +6,9 @@
 #include "hostenv.h"
 #include "mailer.h"
 #include <ctype.h>
+#include "libc.h"
 #include "libz.h"
 
-extern int optind;
-extern char *optarg;
 char *progname = "rfc822test";
 int D_alloc = 0;
 
@@ -38,10 +37,10 @@
 
 	entry_pt = AddressList;
 	tracefp = NULL;
-	while ((c = getopt(argc, argv, "e:T")) != EOF) {
+	while ((c = zgetopt(argc, argv, "e:T")) != EOF) {
 		switch (c) {
 		case 'e':
-			entry_pt = (HeaderSemantics)atoi(optarg);
+			entry_pt = (HeaderSemantics)atoi(zoptarg);
 			break;
 		case 'T':
 			tracefp = stdout;
Index: zmailer/router/router.c
diff -u zmailer/router/router.c:1.25 zmailer/router/router.c:1.26
--- zmailer/router/router.c:1.25	Tue Feb 20 18:51:31 2001
+++ zmailer/router/router.c	Thu Mar  8 12:12:34 2001
@@ -55,7 +55,6 @@
 int	router_id = 0;
 int	deferit;
 int	deferuid;
-int	origoptind;
 int	savefile = 0;
 const char * zshopts = "-O";
 int	nosyslog = 1;
@@ -100,7 +99,7 @@
 		progname = argv[0];
 	else
 		++progname;
-	origoptind = optind;	/* needed for reuse of getopt() */
+
 	logfn = config = NULL;
 	errflg = daemonflg = killflg = interactiveflg = version = 0;
 	tac = 0;
@@ -108,7 +107,7 @@
 
 
 	while (1) {
-		c = getopt(argc, (char*const*)argv, "m:n:dikf:o:t:L:P:r:sSVwW");
+		c = zgetopt(argc, (char*const*)argv, "m:n:dikf:o:t:L:P:r:sSVwW");
 		if (c == EOF)
 			break;
 	  
@@ -120,7 +119,7 @@
 #ifdef	XMEM
 			{ /* Rewritten to be portable...  Storing to
 			     fileno()" is not guaranteed to success.. */
-			  int fd = open(optarg, O_RDWR|O_CREAT|O_TRUNC,0644);
+			  int fd = open(zoptarg, O_RDWR|O_CREAT|O_TRUNC,0644);
 			  if (fd >= 0) {
 			    dup2(fd,30); /* we ASSUME have far less fd's
 					    in use.. */
@@ -135,23 +134,23 @@
 #endif	/* XMEM */
 			break;
 		case 'n':
-			nrouters = atoi(optarg);
+			nrouters = atoi(zoptarg);
 			if (nrouters < 1)
 				nrouters = 1;
 			break;
 		case 'o':
-			zshopts = optarg;
+			zshopts = zoptarg;
 			break;
 		case 't':
 			if (tac < (sizeof tav)/(sizeof tav[0]))
-				tav[++tac] = optarg;
+				tav[++tac] = zoptarg;
 			else {
 				fprintf(stderr, "Too many trace options!\n");
-				fprintf(stderr, "Ignoring '%s'\n", optarg);
+				fprintf(stderr, "Ignoring '%s'\n", zoptarg);
 			}
 			break;
 		case 'f':	/* override default config file */
-			config = optarg;
+			config = (char*) zoptarg;
 			break;
 		case 'i':	/* first read config file, then read from tty */
 			interactiveflg = 1;
@@ -167,10 +166,10 @@
 			nosyslog = 0;
 			break;
 		case 'L':	/* override default log file */
-			logfn = optarg;
+			logfn = zoptarg;
 			break;
 		case 'P':	/* override default postoffice */
-			postoffice = optarg;
+			postoffice = zoptarg;
 			break;
 		case 'V':
 			version = 1;
@@ -182,7 +181,7 @@
 			do_hdr_warning = !do_hdr_warning;
 			break;
 		case 'r':
-			routerdirloops = atoi(optarg);
+			routerdirloops = atoi(zoptarg);
 			if (routerdirloops < 0)
 				routerdirloops = 0;
 			break;
@@ -222,7 +221,7 @@
 
 	getnobody();
 
-	c = optind;	/* save optind since builtins can interfere with it */
+	c = zoptind;	/* save optind since builtins can interfere with it */
 
 	if (daemonflg && logfn == NULL) {
 		if ((cp = (char *) getzenv("LOGDIR")) != NULL)
@@ -309,7 +308,7 @@
 	if (c < argc) {
 	  savefile = 1;
 	  /*
-	   * we need to use a local variable (c) because optind is global
+	   * we need to use a local variable (c) because zoptind is global
 	   * and can (and will) be modified by the funcall()'s we do.
 	   */
 	  do {
Index: zmailer/router/rtsyslog.c
diff -u zmailer/router/rtsyslog.c:1.8 zmailer/router/rtsyslog.c:1.9
--- zmailer/router/rtsyslog.c:1.8	Sat Dec  2 01:33:41 2000
+++ zmailer/router/rtsyslog.c	Sat Feb 24 00:15:46 2001
@@ -26,13 +26,14 @@
 static char lbuf[8000];	/* Should be aplenty..		*/
 
 void
-rtsyslog(msgmtime,msgino,from,smtprelay,size,nrcpts,msgid)
-time_t msgmtime;
-long msgino;
-char *from, *smtprelay, *msgid;
-int size, nrcpts;
+rtsyslog(msgmtime,msgino,from,smtprelay,size,nrcpts,msgid,starttime)
+const time_t msgmtime, starttime;
+const long msgino;
+const char *from, *smtprelay, *msgid;
+const int size, nrcpts;
 {
   char spoolid[30];		/* Min. space: 6+8+1 chars	*/
+  char delays[16], xdelays[16]; /* Min. space: 8+1 chars	*/
   time_t now;
   static const char *syslogflg = NULL;
   const char *t;
@@ -60,15 +61,17 @@
      ctladdr=`getpwuid(rp->addr->misc)`
      mailer='rp->addr->channel' */
 
+  tatimestr(delays,  now - msgmtime);
+  tatimestr(xdelays, now - starttime);
+
   if (*t == 'R')
     sprintf(lbuf,
-	    "%s: from=<%.200s>, rrelay=%.200s, size=%d, nrcpts=%d, msgid=%.200s",
-	    spoolid, from, smtprelay, size, nrcpts, msgid);
+	    "%s: from=<%.200s>, rrelay=%.200s, size=%d, nrcpts=%d, msgid=%.200s, delay=%s, xdelay=%s",
+	    spoolid, from, smtprelay, size, nrcpts, msgid, delays, xdelays);
   else
     sprintf(lbuf,
-	    "%s:\tfrom=<%.200s>\trrelay=%.200s\tsize=%d\tnrcpts=%d\tmsgid=%.200s",
-	    spoolid, from, smtprelay, size, nrcpts, msgid);
-
+	    "%s:\tfrom=<%.200s>\trrelay=%.200s\tsize=%d\tnrcpts=%d\tmsgid=%.200s\tdelay=%s\txdelay=%s",
+	    spoolid, from, smtprelay, size, nrcpts, msgid, delays, xdelays);
 
   zsyslog((LOG_INFO, "%s", lbuf));
 }
Index: zmailer/router/shliaise.c
diff -u zmailer/router/shliaise.c:1.8 zmailer/router/shliaise.c:1.9
--- zmailer/router/shliaise.c:1.8	Wed Aug 30 14:57:54 2000
+++ zmailer/router/shliaise.c	Mon Mar 12 11:12:34 2001
@@ -399,7 +399,7 @@
 	    UNGCPRO4;
 	    return NULL; /* ?? */
 	  }
-	  if (strcmp(nam,lc->string)==0) {
+	  if (STREQ(nam,lc->string)) {
 	    if (!cdr(lc)) {
 	      UNGCPRO4;
 	      return NULL;
Index: zmailer/router/libdb/header.c
diff -u zmailer/router/libdb/header.c:1.14 zmailer/router/libdb/header.c:1.16
--- zmailer/router/libdb/header.c:1.14	Fri Jun  2 13:38:57 2000
+++ zmailer/router/libdb/header.c	Mon Mar 12 11:12:34 2001
@@ -84,6 +84,7 @@
 { "env-end",	nilHeaderSemantics,	nilUserType,	eEnvEnd		},
 { "env-eof",	nilHeaderSemantics,	nilUserType,	eEnvEnd		},
 { "envid",	nilHeaderSemantics,	nilUserType,	eEnvid		},
+{ "errormsg",	nilHeaderSemantics,	nilUserType,	eErrorMsg	},
 { "external",	nilHeaderSemantics,	nilUserType,	eExternal	},
 { "from",		AMailboxList,	Sender,		eFrom		},
 { "fullname",		Phrase,		nilUserType,	eFullname	},
@@ -208,8 +209,7 @@
 open_header(sip)
 	search_info *sip;
 {
-	if (sip->subtype == NULL)
-	  return NULL;
+	if (! sip->subtype) return NULL;
 	return (struct sptree *)sip->subtype;
 }
 
Index: zmailer/router/libdb/search.h
diff -u zmailer/router/libdb/search.h:1.3 zmailer/router/libdb/search.h:1.4
--- zmailer/router/libdb/search.h:1.3	Fri Feb 16 03:12:31 2001
+++ zmailer/router/libdb/search.h	Thu Mar  8 12:12:34 2001
@@ -20,8 +20,10 @@
 	const char	*key;
 	time_t		 ttl;
 	const char	*subtype;
-	const char	**argv10;
+	const char	*defaultkey;
+	const char	**argv20;
 	const char	*argv1;
+	unsigned long	flags;
 } search_info;
 
 struct file_map {
Index: zmailer/scheduler/mailq.c
diff -u zmailer/scheduler/mailq.c:1.56 zmailer/scheduler/mailq.c:1.57
--- zmailer/scheduler/mailq.c:1.56	Mon Feb 19 19:28:24 2001
+++ zmailer/scheduler/mailq.c	Thu Mar  1 11:36:43 2001
@@ -1442,11 +1442,13 @@
 
 	    lines[linecnt] = malloc(bufsize+2);
 	    memcpy(lines[linecnt], b, bufsize+1);
-	    lines[++linecnt] = NULL;
+	    ++linecnt;
 
 	    /* fprintf(stdout,"%s\n", b); */
 	  }
 
+	  lines[linecnt] = NULL;
+
 	  for (i = 0; lines[i] != NULL; ++i) {
 	    char *channel = lines[i];
 	    char *host    = strchr(channel, '\t');
@@ -1498,12 +1500,13 @@
 	      threads[threadcnt].line    = malloc(bufsize + 2);
 	      memcpy(threads[threadcnt].line, b, bufsize+1);
 	      ++threadcnt;
-	      threads[threadcnt].channel = NULL;
-	      threads[threadcnt].host    = NULL;
-	      threads[threadcnt].line    = NULL;
 	    }
 	    
 	  }
+
+	  threads[threadcnt].channel = NULL;
+	  threads[threadcnt].host    = NULL;
+	  threads[threadcnt].line    = NULL;
 
 	  fclose(fpi); fclose(fpo);
 
Index: zmailer/scheduler/msgerror.c
diff -u zmailer/scheduler/msgerror.c:1.33 zmailer/scheduler/msgerror.c:1.34
--- zmailer/scheduler/msgerror.c:1.33	Sun Dec 31 15:09:54 2000
+++ zmailer/scheduler/msgerror.c	Thu Mar  8 12:12:34 2001
@@ -4,7 +4,7 @@
  */
 /*
  *	Lots of modifications (new guts, more or less..) by
- *	Matti Aarnio <mea@nic.funet.fi>  (copyright) 1992-2000
+ *	Matti Aarnio <mea@nic.funet.fi>  (copyright) 1992-2001
  *
  *	We produce RFC 1894 format reports with everything it contains.
  */
@@ -309,6 +309,7 @@
 	      strchr(eaddr,'=') == NULL /*Smells of X.400*/)))
 	  eaddr = "postmaster"; /* Paranoid, eh ? */
 	sfprintf(errfp, "channel error\n");
+	sfprintf(errfp, "errormsg\n"); /* SCHEDULER WROTE THIS! */
 
 	if (!*no_error_reportp)
 	  printenvaddr(errfp, eaddr);
Index: zmailer/scheduler/threads.c
diff -u zmailer/scheduler/threads.c:1.141 zmailer/scheduler/threads.c:1.143
--- zmailer/scheduler/threads.c:1.141	Tue Jan 23 01:35:11 2001
+++ zmailer/scheduler/threads.c	Tue Apr  3 14:45:38 2001
@@ -853,6 +853,7 @@
 	    proc = proc->pnext;
 	    while (proc) {
 	      sfprintf(sfstderr, " %p", proc);
+	      proc = proc->pnext;
 	    }
 	    sfprintf(sfstderr, " }\n");
 	  }
@@ -1666,15 +1667,15 @@
 	  else
 	    sfprintf(fp, "%s\n",timebuf);
 
-	  sfprintf(fp, "Msgs in %lu out %lu stored %lu ",
+	  sfprintf(fp, "Msgs in %lu out %lu stored %ld ",
 		   (u_long)MIBMtaEntry->mtaReceivedMessagesSc,
 		   (u_long)MIBMtaEntry->mtaTransmittedMessagesSc,
-		   (u_long)MIBMtaEntry->mtaStoredMessages);
+		   (long)MIBMtaEntry->mtaStoredMessages);
 
-	  sfprintf(fp, "Rcpnts in %lu out %lu stored %lu",
+	  sfprintf(fp, "Rcpnts in %lu out %lu stored %ld",
 		   (u_long)MIBMtaEntry->mtaReceivedRecipientsSc,
 		   (u_long)MIBMtaEntry->mtaTransmittedRecipientsSc,
-		   (u_long)MIBMtaEntry->mtaStoredRecipients);
+		   (long)MIBMtaEntry->mtaStoredRecipients);
 
 	  if (rcptsum != MIBMtaEntry->mtaStoredRecipients)
 	    sfprintf(fp, " (%d)", rcptsum);
Index: zmailer/smtpserver/cfgread.c
diff -u zmailer/smtpserver/cfgread.c:1.36 zmailer/smtpserver/cfgread.c:1.37
--- zmailer/smtpserver/cfgread.c:1.36	Mon Jan 15 17:12:09 2001
+++ zmailer/smtpserver/cfgread.c	Fri Mar  2 12:03:04 2001
@@ -4,7 +4,7 @@
  */
 /*
  *    Several extensive changes by Matti Aarnio <mea@nic.funet.fi>
- *      Copyright 1991-2000.
+ *      Copyright 1991-2001.
  */
 
 /*
Index: zmailer/smtpserver/mxverify.c
diff -u zmailer/smtpserver/mxverify.c:1.25 zmailer/smtpserver/mxverify.c:1.26
--- zmailer/smtpserver/mxverify.c:1.25	Mon Jan 15 17:12:09 2001
+++ zmailer/smtpserver/mxverify.c	Tue Apr  3 14:45:38 2001
@@ -407,21 +407,18 @@
 	  req.ai_socktype = SOCK_STREAM;
 	  req.ai_protocol = IPPROTO_TCP;
 	  req.ai_flags    = AI_CANONNAME;
+	  /*  ai_family  set above. */
 	  ai = NULL;
 	  /* This resolves CNAME, it should not happen in case
 	     of MX server, though..    */
-#define GETADDRINFODEBUG 0
-#if !GETADDRINFODEBUG
-	  i = getaddrinfo(mx[n], "0", &req, &ai);
-#else
+#ifdef HAVE__GETADDRINFO_
 	  i = _getaddrinfo_(mx[n], "0", &req, &ai,
 			    debug ? stdout : NULL);
-	  if (debug)
-	    printf("000-  getaddrinfo('%s','0') -> r=%d, ai=%p\n",mx[n],i,ai);
+#else
+	  i = getaddrinfo(mx[n], "0", &req, &ai);
 #endif
-
 	  if (debug)
-	    printf("000-  getaddrinfo('%s') yields %d\n", mx[n], i);
+	    printf("000-  getaddrinfo('%s','0') -> r=%d, ai=%p\n",mx[n],i,ai);
 	    
 	  if (i != 0)
 	    continue;		/* Well well.. spurious! */
@@ -490,20 +487,66 @@
 	  req.ai_socktype = SOCK_STREAM;
 	  req.ai_protocol = IPPROTO_TCP;
 	  req.ai_flags    = AI_CANONNAME;
-	  req.ai_family   = 0; /* Both OK (IPv4/IPv6) */
+	  req.ai_family   = PF_INET;
 	  ai = NULL;
 
+
 	  /* This resolves CNAME, it should not happen in case
 	     of MX server, though..    */
-#if !GETADDRINFODEBUG
-	  i = getaddrinfo((const char*)host, "0", &req, &ai);
-#else
+#ifdef HAVE__GETADDRINFO_
+	  if (debug)
+	    printf("000-  perhaps A?\n");
 	  i = _getaddrinfo_((const char*)host, "0", &req, &ai, debug ? stdout : NULL);
+#else
+	  i = getaddrinfo((const char*)host, "0", &req, &ai);
 #endif
 	  if (debug)
-	    printf("000-   perhaps A? getaddrinfo('%s','0') -> r=%d, ai=%p\n",host,i,ai);
-	  if (i != 0) /* Found nothing! */
+	    printf("000-   getaddrinfo('%s','0') (PF_INET) -> r=%d (%s), ai=%p\n",host,i,gai_strerror(i),ai);
+
+#if defined(AF_INET6) && defined(INET6)
+	  if (use_ipv6) {
+
+	    /* Want, but not have AAAA, ask for it. */
+
+	    int n2;
+	    struct addrinfo *ai2 = NULL;
+
+	    memset(&req, 0, sizeof(req));
+	    req.ai_socktype = SOCK_STREAM;
+	    req.ai_protocol = IPPROTO_TCP;
+	    req.ai_flags    = AI_CANONNAME;
+	    req.ai_family   = PF_INET6;
+
+	  /* This resolves CNAME, it should not happen in case
+	     of MX server, though..    */
+#ifdef HAVE__GETADDRINFO_
+	    n2 = _getaddrinfo_((const char *)host, "0", &req, &ai2,
+			       debug ? stdout : NULL);
+#else
+	    n2 = getaddrinfo((const char *)host, "0", &req, &ai2);
+#endif
+	    if (debug)
+	      printf("000-   getaddrinfo('%s','0') (PF_INET6) -> r=%d (%s), ai=%p\n",host,n2,gai_strerror(n2),ai2);
+
+
+	    if (i != 0 && n2 == 0) {
+	      /* IPv6 address, no IPv4 (or error..) */
+	      i = n2;
+	      ai = ai2; ai2 = NULL;
+	    }
+	    if (ai2 && ai) {
+	      /* BOTH ?!  Catenate them! */
+	      struct addrinfo **aip;
+	      aip = &ai->ai_next;
+	      while (*aip) aip = &((*aip)->ai_next);
+	      *aip = ai2;
+	    }
+	  }
+#endif
+
+	  if (i)
 	    return i;
+
 
 	  i = matchmyaddresses(ai);
 #if 1
Index: zmailer/smtpserver/smtpcmds.c
diff -u zmailer/smtpserver/smtpcmds.c:1.73 zmailer/smtpserver/smtpcmds.c:1.74
--- zmailer/smtpserver/smtpcmds.c:1.73	Sun Dec 31 15:09:55 2000
+++ zmailer/smtpserver/smtpcmds.c	Sat Feb 24 01:18:59 2001
@@ -837,6 +837,7 @@
 	}
 	/* The 's' goes to use below */
     }
+
     if (SS->mfp == NULL &&
 	(SS->mfp = mail_open(MSG_RFC822)) == NULL) {
 	if (s)
@@ -1426,9 +1427,12 @@
     s = NULL;
     if (STYLE(SS->cfinfo, 't')) {
 	s = router(SS, RKEY_TO, 1, cp, addrlen);
-	if (s == NULL)
+	if (s == NULL) {
 	    /* the error was printed in router() */
+	    if (newcp)
+		free((void *) newcp);
 	    return;
+	}
 	if (atoi(s) / 100 != 2) {
 	    /* verification failed */
 	    smtp_tarpit(SS);
@@ -1548,7 +1552,12 @@
 	    type(SS, 552, m571, "SPAM trap -- too many recipients for an empty source address!");
 	} else {
 	    err = atoi(s);
-	    type(SS, err, "%s", s + 4);
+	    if (err >= 400) {
+	      smtp_tarpit(SS);
+	      mail_abort(SS->mfp);
+	      SS->mfp = NULL;
+	    }
+	    type(SS, err, s + 4, "Ok");
 	    if (err < 400)
 	      err = 0;
 	}
Index: zmailer/smtpserver/smtpserver.c
diff -u zmailer/smtpserver/smtpserver.c:1.113 zmailer/smtpserver/smtpserver.c:1.116
--- zmailer/smtpserver/smtpserver.c:1.113	Wed Jan 31 18:46:22 2001
+++ zmailer/smtpserver/smtpserver.c	Fri Mar  2 12:03:04 2001
@@ -4,7 +4,7 @@
  */
 /*
  *    Several extensive changes by Matti Aarnio <mea@nic.funet.fi>
- *      Copyright 1991-2000.
+ *      Copyright 1991-2001.
  */
 
 /*
@@ -1539,20 +1539,24 @@
         /* We are about to read... */
 	alarm(SS->read_alarm_ival);
 	rc = Z_read(SS, SS->s_buffer, sizeof(SS->s_buffer));
+	SS->s_readerrno = 0;
 	if (rc < 0) {
+	  SS->s_readerrno = errno;
 	  if (errno == EINTR || errno == EAGAIN)
 	    if (!gotalarm)
 	      goto redo;
+	  /* The read returned.. */
+	  alarm(0);
 	  /* Other results are serious errors -- maybe */
 	  SS->s_status = EOF;
 	  return EOF;
 	}
+	/* We did read successfully! */
+	alarm(0);
 	if (rc == 0) {
 	    SS->s_status = EOF;
 	    return EOF;
 	}
-	/* We did read successfully! */
-	alarm(SS->read_alarm_ival);
 	SS->s_bufread = rc;
 	SS->s_readout = 0;
     }
@@ -2242,7 +2246,8 @@
 	tell = lseek(0, 0, SEEK_CUR);
 	reporterr(SS, tell, "session terminated");
     } else if (logfp != NULL) {
-	type(NULL,0,NULL,"Session closed w/o QUIT");
+	type(NULL,0,NULL,"Session closed w/o QUIT; read() errno=%d",
+	     SS->s_readerrno);
 	fflush(logfp);
     }
 #ifdef HAVE_OPENSSL
@@ -2316,16 +2321,17 @@
 #ifdef HAVE_STDARG_H
 void
 #ifdef __STDC__
- type(SmtpState * SS, const int Code, const char *status, const char *fmt,...)
+type(SmtpState * SS, const int Code, const char *status, const char *fmt,...)
 #else				/* Non ANSI-C */
- type(SS, Code, status, fmt)
+type(SS, Code, status, fmt)
 SmtpState *SS;
 const int Code;
 const char *status, *fmt;
 #endif
 #else
 /* VARARGS2 */
-void type(SS, Code, status, fmt, va_alist)
+void
+type(SS, Code, status, fmt, va_alist)
 SmtpState *SS;
 const int Code;
 const char *status, *fmt;
@@ -2333,7 +2339,8 @@
 #endif
 #else				/* No VPRINTF */
 /* VARARGS2 */
-void type(SS, Code, status, fmt, s1, s2, s3, s4, s5, s6)
+void
+type(SS, Code, status, fmt, s1, s2, s3, s4, s5, s6)
 SmtpState *SS;
 const int Code;
 const char *status, *fmt, *s1, *s2, *s3, *s4, *s5, *s6;
@@ -2470,7 +2477,7 @@
       fflush(logfp);
     }
     if (!SS) return; /* Only to local log.. */
-    strcpy(s, "\r\n");
+    memcpy(s, "\r\n", 2);
     Z_write(SS, buf, buflen+2); /* XX: check return value */
 }
 
Index: zmailer/smtpserver/smtpserver.h
diff -u zmailer/smtpserver/smtpserver.h:1.63 zmailer/smtpserver/smtpserver.h:1.64
--- zmailer/smtpserver/smtpserver.h:1.63	Wed Jan 31 18:46:22 2001
+++ zmailer/smtpserver/smtpserver.h	Wed Feb 28 14:35:58 2001
@@ -258,6 +258,7 @@
     int  s_bufread;
     int  s_readout;
     int  s_status;
+    int  s_readerrno;
     char s_buffer[SMTPLINESIZE];
 
     int  from_box;		/* Set when:  MAIL FROM:<>  */
Index: zmailer/transports/errormail/errormail.c
diff -u zmailer/transports/errormail/errormail.c:1.8 zmailer/transports/errormail/errormail.c:1.9
--- zmailer/transports/errormail/errormail.c:1.8	Mon Oct 16 14:32:39 2000
+++ zmailer/transports/errormail/errormail.c	Thu Mar  8 12:12:34 2001
@@ -274,6 +274,7 @@
 	}
 
 	sfprintf(mfp, "channel error\n");
+	sfprintf(mfp, "errormsg\n");
 
 	rp = dp->recipients;
 
Index: zmailer/transports/hold/hold.c
diff -u zmailer/transports/hold/hold.c:1.11 zmailer/transports/hold/hold.c:1.12
--- zmailer/transports/hold/hold.c:1.11	Tue Jan 23 01:35:11 2001
+++ zmailer/transports/hold/hold.c	Thu Mar  8 12:12:34 2001
@@ -27,6 +27,7 @@
 #include <netinet/in.h>
 #endif
 #include "libz.h"
+#include "dnsgetrr.h"
 
 #if	defined(TRY_AGAIN) && defined(HAVE_RESOLVER)
 #define	BIND		/* Want BIND (named) nameserver support enabled */
Index: zmailer/transports/libta/ctlopen.c
diff -u zmailer/transports/libta/ctlopen.c:1.27 zmailer/transports/libta/ctlopen.c:1.28
--- zmailer/transports/libta/ctlopen.c:1.27	Fri Nov 24 23:58:05 2000
+++ zmailer/transports/libta/ctlopen.c	Mon Feb 26 13:44:56 2001
@@ -492,8 +492,9 @@
 	    rp->lockoffset = rp->id + 1;
 	    rp->next = d.recipients;
 	    rp->desc = &d;
-	    rp->orcpt = NULL;
+	    rp->orcpt  = NULL;
 	    rp->inrcpt = NULL;
+	    rp->ezmlm  = NULL;
 	    rp->notify = NULL;
 	    rp->notifyflgs = _DSN_NOTIFY_FAILURE; /* Default behaviour */
 	    d.recipients = rp;
@@ -589,6 +590,13 @@
 		if (CISTREQN("INFROM=",s,7)) {
 		  s += 7;
 		  /* FIXME: pull INFROM into some sensible use.. */
+		  while (*s && *s != ' ' && *s != '\t') ++s;
+		  if (*s) *s++ = 0;
+		  continue;
+		}
+		if (CISTREQN("EZMLM=",s,6)) {
+		  s += 6;
+		  prevrp->ezmlm = s;
 		  while (*s && *s != ' ' && *s != '\t') ++s;
 		  if (*s) *s++ = 0;
 		  continue;
Index: zmailer/transports/smtp/getmxrr.c
diff -u zmailer/transports/smtp/getmxrr.c:1.30 zmailer/transports/smtp/getmxrr.c:1.32
--- zmailer/transports/smtp/getmxrr.c:1.30	Mon Feb 19 18:36:03 2001
+++ zmailer/transports/smtp/getmxrr.c	Wed Apr  4 11:10:09 2001
@@ -344,6 +344,8 @@
 	    --nscount;
 	}
 
+#if 0 /* Bloody Linux vs. FreeBSD implementation differences... */
+
 	/* If nscount isn't zero here, then (cp >= eom) is true ... */
 
 	/* Ok, can continue to pick the ADDITIONAL SECTION data */
@@ -375,7 +377,6 @@
 
 	  /* Ok, we have Type IN data in the ADDITIONAL SECTION */
 
-
 	  /* A and AAAA are known here! */
 
 	  if (type == T_A
@@ -424,6 +425,10 @@
 		ai->ai_protocol = IPPROTO_TCP;
 		ai->ai_addr     = (struct sockaddr *)usa;
 		ai->ai_addrlen  = sizeof(*usa);
+
+		/* At FreeBSD the 'ai_canonname' points to SEPARATE
+		   malloc() block, at Linux GLIBC it points inside
+		   this same... */
 		ai->ai_canonname = /* canon */ NULL;
 
 		ai->ai_next     = mx[i].ai;
@@ -455,12 +460,14 @@
 	  --arcount;
 	} /* Additional data collected! */
 
+
 	if (SS->verboselog)
 	  for (i = 0; i < nmx; ++i) {
 	    if (mx[i].ai == NULL)
 	      fprintf(SS->verboselog, " MX lookup lacked ADDITIONAL SECTION Address for entry: MX %d %s\n",
 		      mx[i].pref, mx[i].host);
 	  }
+#endif /* Linux vs. FreeBSD implementation difference... */
 
 	/* Collect addresses for all those who don't have them from
 	   the ADDITIONAL SECTION data */
@@ -720,6 +727,10 @@
 	  }
 	  ++n;			/* found one! */
 	}
+
+	nmx = n;
+	SS->mxcount = nmx;
+
 	if (n == 0 && had_eai_again)
 	  return EX_TEMPFAIL;
 
@@ -732,8 +743,6 @@
 #endif
 	  return EX_UNAVAILABLE;
 	}
-	nmx = n;
-	SS->mxcount = nmx;
 
 	/* sort the records per preferrence value */
 	for (i = 0; i < nmx; i++) {
@@ -999,15 +1008,15 @@
 	  errno = 0;
 	  /* Either forbidden MX usage, or does not have MX entries! */
 
-#ifdef HAVE_GETADDRINFO
-	  r = getaddrinfo(host, "smtp", &req, &ai);
+#ifdef HAVE__GETADDRINFO_
+	  r = _getaddrinfo_(host, "0", &req, &ai, SS.verboselog);
 #else
-	  r = _getaddrinfo_(host, "smtp", &req, &ai, SS.verboselog);
+	  r = getaddrinfo(host, "0", &req, &ai);
 #endif
 
 	  if (SS.verboselog)
 	    fprintf(SS.verboselog,
-		    "getaddrinfo('%s','smtp') -> r=%d (%s), ai=%p\n",
+		    "getaddrinfo('%s','0' (INET)) -> r=%d (%s), ai=%p\n",
 		    host, r, gai_strerror(r), ai);
 #if defined(AF_INET6) && defined(INET6)
 	  if (use_ipv6) {
@@ -1022,14 +1031,14 @@
 
 	    /* This resolves CNAME, it should not happen in case
 	       of MX server, though..    */
-#ifdef HAVE_GETADDRINFO
-	    i2 = getaddrinfo(host, "0", &req, &ai2);
-#else
+#ifdef HAVE__GETADDRINFO_
 	    i2 = _getaddrinfo_(host, "0", &req, &ai2, SS.verboselog);
+#else
+	    i2 = getaddrinfo(host, "0", &req, &ai2);
 #endif
 	    if (SS.verboselog)
 	      fprintf(SS.verboselog,
-		      "  getaddrinfo('%s','smtp') -> r=%d (%s), ai=%p\n",
+		      "getaddrinfo('%s','0' (INET6)) -> r=%d (%s), ai=%p\n",
 		      host,i2, gai_strerror(i2), ai2);
 
 	    if (r != 0 && i2 == 0) {
Index: zmailer/transports/smtp/smtp.c
diff -u zmailer/transports/smtp/smtp.c:1.228 zmailer/transports/smtp/smtp.c:1.235
--- zmailer/transports/smtp/smtp.c:1.228	Thu Jan 25 15:10:35 2001
+++ zmailer/transports/smtp/smtp.c	Tue May  8 15:42:55 2001
@@ -1,7 +1,7 @@
 /*
  *	Copyright 1988 by Rayan S. Zachariassen, all rights reserved.
  *	This will be free software, but only when it is finished.
- *	Copyright 1991-2000 by Matti Aarnio -- modifications, including MIME
+ *	Copyright 1991-2001 by Matti Aarnio -- modifications, including MIME
  */
 
 #include "smtp.h"
@@ -863,6 +863,7 @@
 	  struct rcpt *rp, *rphead;
 	  int loggedid;
 	  int openstatus = EX_OK;
+	  int retrymax;
 
 	  procabortset = 1;
 
@@ -887,6 +888,8 @@
 		  fprintf(logfp, "%s#\t%s: %s\n", logtag(), dp->msgfile, dp->logident);
 		}
 
+		retrymax = 3;
+
 		do {
 
 		  if (!SS->smtpfp) {
@@ -914,7 +917,7 @@
 		    smtpstatus = deliver(SS, dp, rphead, rp->next);
 
 		  /* Only for EX_TEMPFAIL, or for any non EX_OK ? */
-		  if (smtpstatus == EX_TEMPFAIL) {
+		  if (smtpstatus == EX_TEMPFAIL && SS->smtpfp) {
 		    smtpclose(SS, 1);
 		    notary_setwtt(NULL);
 		    notary_setwttip(NULL);
@@ -925,7 +928,10 @@
 		  }
 
 		  /* If delivery fails, try other MX hosts */
-		} while (((smtpstatus == EX_TEMPFAIL) ||
+		  --retrymax;
+
+		} while ((retrymax > 0) &&
+			 ((smtpstatus == EX_TEMPFAIL && !SS->smtpfp) ||
 			  (smtpstatus == EX_IOERR)) &&
 			 (SS->firstmx < SS->mxcount));
 
@@ -1181,13 +1187,43 @@
 	  size = -1;
 	SS->msize = size;
 
+	strcpy(SMTPbuf, "MAIL From:<");
 	if (STREQ(startrp->addr->link->channel,"error"))
-	  sprintf(SMTPbuf, "MAIL From:<>");
-	else
-	  sprintf(SMTPbuf, "MAIL From:<%.1000s>", startrp->addr->link->user);
-	if (SS->ehlo_capabilities & ESMTP_8BITMIME)
-	  strcat(SMTPbuf, " BODY=8BITMIME");
+	  strcpy(SMTPbuf+11, ">");
+	else if (startrp->ezmlm) {
+	  char *p = SMTPbuf+11;
+	  const char *u;
+	  int quote = 0;
+	  u = startrp->addr->link->user;
+	  for ( ; *u; ++u) {
+	    char c = *u;
+	    if (c == '\\') {
+	      *p++ = c; ++u;
+	      if (*u == 0) break;
+	      *p++ = *u;
+	      continue;
+	    }
+	    if (c == quote) /* 'c' is non-zero here */
+	      quote = 0;
+	    else if (c == '"')
+	      quote = '"';
+	    else if (!quote && (c == '@'))
+	      break;
+	    *p++ = c;
+	  }
+	  if (*u == '@') {
+	    strcpy(p, startrp->ezmlm);
+	    p += strlen(p);
+	  }
+	  strcpy(p, u);
+	} else
+	  sprintf(SMTPbuf+11, "%.1000s>", startrp->addr->link->user);
+
 	s = SMTPbuf + strlen(SMTPbuf);
+	if (SS->ehlo_capabilities & ESMTP_8BITMIME) {
+	  strcpy(s, " BODY=8BITMIME");
+	  s += strlen(s);
+	}
 
 	/* Size estimate is calculated in the  ctlopen()  by
 	   adding msg-body size to the largest known header size,
@@ -1210,7 +1246,9 @@
 
 	/* MAIL FROM:<...> -- pipelineable.. */
 	r = smtpwrite(SS, 1, SMTPbuf, pipelining, NULL);
+
 	if (!SS->smtpfp || sffileno(SS->smtpfp) < 0) r = EX_TEMPFAIL; /* ALWAYS! */
+
 	if (r != EX_OK) {
 	  /* If we err here, we probably are in SYNC mode... */
 	  /* Uh ??  Many new sendmail's have a pathological error mode:
@@ -1225,10 +1263,10 @@
 			  we have some new input, do close the connection */
 	    if (has_readable(SS->smtpfd)) {
 	      /* Drain the input, and then close the channel */
-	      (void) smtpwrite(SS, 1, NULL, 0, NULL);
+	      (void) smtpwrite(SS, 0, NULL, 0, NULL);
 	      smtpclose(SS, 1);
 	      if (logfp)
-		fprintf(logfp, "%s#\t(closed SMTP channel - MAIL FROM:<> got two responses!)\n", logtag());
+		fprintf(logfp, "%s#\t(closed SMTP channel - MAIL FROM:<> got two responses! [or EOF])\n", logtag());
 	    }
 	  }
 	  time(&endtime);
@@ -1254,26 +1292,49 @@
 	      }
 	  }
 
-	  for (rp = startrp; rp && rp != endrp; rp = rp->next) {
-	    /* NOTARY: address / action / status / diagnostic */
-	    if (rp->lockoffset) {
+	  /* Returning here EX_TEMPFAIL while smtpfp == NULL will do
+	     quick retry!  DON'T diagnose those now! */
+
+	  if (r != EX_TEMPFAIL && !SS->smtpfp)
+	    for (rp = startrp; rp && rp != endrp; rp = rp->next) {
+	      /* NOTARY: address / action / status / diagnostic */
+	      if (rp->lockoffset) {
 		notaryreport(rp->addr->user, FAILED,
-			   "5.5.0 (Undetermined protocol error)",NULL);
-	      diagnostic(rp, r, 0, "%s", SS->remotemsg);
+			     "5.5.0 (Undetermined protocol error)",NULL);
+		diagnostic(rp, r, 0, "%s", SS->remotemsg);
+	      }
 	    }
-	  }
+
 	  return r;
 	}
+
 	mail_from_failed = 0;
 	nrcpt = 0;
 	rcpt_cnt = 0;
 
 	for (rp = startrp; rp && rp != endrp; rp = rp->next) {
 
+	  if (!rp->lockoffset) continue; /* SKIP IT! */
+
+	  /* Make sure the recipient diagnostics status at this
+	     point is "OK". */
+	  rp->status = EX_OK;
+
 	  if (++rcpt_cnt >= SS->rcpt_limit) {
+	    /* Limit Count full */
 	    more_rp = rp->next;
 	    rp->next = NULL;
 	  }
+	  if (rp->ezmlm) {
+	    /* THIS recipient is EZMLM one */
+	    more_rp = rp->next;
+	    rp->next = NULL;
+	  }
+	  if (!rp->ezmlm && rp->next && rp->next->ezmlm) {
+	    /* THIS recipient isn't EZMLM one, but NEXT one is! */
+	    more_rp = rp->next;
+	    rp->next = NULL;
+	  }
 
 	  SS->cmdstate = SMTPSTATE_RCPTTO;
 
@@ -1342,8 +1403,10 @@
 	    /* Actually we DO NOT KNOW, we need to sync this latter on.. */
 	    rp->status = EX_OK;
 	  }
-	}
 
+	} /* ... for (rp = startrp; rp && rp != endrp; rp = rp->next) ... */
+
+
 	if (nrcpt == 0) {
 	  /* all the RCPT To addresses were rejected, so reset server */
 
@@ -1361,13 +1424,15 @@
 	    goto more_recipients;
 
 	  if (SS->rcptstates & RCPTSTATE_400)
+	    /* The smtpfp != NULL -> no retry for these
+	       recipients -- at least not right away! */
 	    return EX_TEMPFAIL; /* Even ONE temp failure -> total result
 				   is then TEMPFAIL */
 	  return EX_UNAVAILABLE;
 	}
 
 	if (!SS->smtpfp)
-	  return EX_TEMPFAIL;
+	  return EX_TEMPFAIL; /* Doing quick retry on these rcpts! */
 
 	chunkblkptr   = NULL;
 	SS->chunksize = 0;
@@ -1422,7 +1487,8 @@
 	      if (smtpwrite(SS, 0, "RSET", 0, NULL) == EX_OK)
 		r = EX_TEMPFAIL;
 	    }
-	    return r;
+	    return r; /* The smtpfp != NULL -> no retry for these
+			 recipients -- at least not right away! */
 	  }
 
 	  /* OK, we synced, lets continue with BDAT ...
@@ -1430,34 +1496,16 @@
 	     pipelining with BDAT, but lets do this
 	     with checkpoints at first */
 
-	} else if (pipelining) {
+	} else {
 
 	  /* No CHUNKING here... do normal DATA-dot exchange */
 
-	  /* In PIPELINING mode ... send "DATA" and SYNC ! */
-	  r = smtpwrite(SS, 1, "DATA", 0, NULL);
-#if 0
-	  if (r != EX_OK) { /* failure on pipes ? */
-	    time(&endtime);
-	    notary_setxdelay((int)(endtime-starttime));
-	    if (SS->smtpfp)
-	      r = smtp_sync(SS, r, 0); /* Sync it.. */
-	    for (rp = startrp; rp && rp != endrp; rp = rp->next)
-	      if (rp->lockoffset) {
-		/* NOTARY: address / action / status / diagnostic / wtt */
-		notaryreport(rp->addr->user,FAILED,NULL,NULL);
-		diagnostic(rp, r, 0, "%s", SS->remotemsg);
-	      }
-	    smtpclose(SS, 1);
-	    r = EX_TEMPFAIL;
-	    return r;
-	  }
-	  time(&endtime);
-	  notary_setxdelay((int)(endtime-starttime));
-	  /* Now it is time to do synchronization .. */
-	  if (SS->smtpfp)
-	    r = smtp_sync(SS, EX_OK, 0); /* Up & until "DATA".. */
-#endif
+	  /* In PIPELINING mode ...... send "DATA" and SYNC ! */
+	  /* In non-pipelining mode .. send "DATA" and SYNC ! */
+
+	  timeout = timeout_data;
+	  r = smtpwrite(SS, 1, "DATA", 0 /* SYNC! */, NULL);
+
 	  if (r != EX_OK) {
 	    if (SS->smtpfp &&
 		(SS->rcptstates & DATASTATE_OK)) {
@@ -1514,24 +1562,6 @@
 	    return r;
 	  }
 
-	  /* Successes are reported AFTER the DATA-transfer is ok */
-	} else {
-	  /* Non-PIPELINING sync mode */
-	  timeout = timeout_data;
-	  r = smtpwrite(SS, 1, "DATA", 0, NULL);
-	  if (r != EX_OK) {
-	    time(&endtime);
-	    notary_setxdelay((int)(endtime-starttime));
-	    for (rp = startrp; rp && rp != endrp; rp = rp->next)
-	      if (rp->lockoffset) {
-		/* NOTARY: address / action / status / diagnostic / wtt */
-		notaryreport(rp->addr->user,FAILED,NULL,NULL);
-		diagnostic(rp, r, 0, "%s", SS->remotemsg);
-	      }
-	    smtpclose(SS, 1);
-	    r = EX_TEMPFAIL;
-	    return r;
-	  }
 	  timeout = timeout_dot;
 	}
 	/* Headers are 7-bit stuff -- says MIME specs */
@@ -1780,7 +1810,7 @@
 
 
 	/* More recipients to send ? */
-	if (r == EX_OK && more_rp != NULL && !getout)
+	if (r == EX_OK && more_rp && !getout)
 	  goto more_recipients;
 
 	SS->cmdstate = SMTPSTATE_DATADOTRSET;
@@ -2180,7 +2210,7 @@
 	  }
 
 	  SS->mxcount = 0;
-	  retval = makeconn(SS, ai, -2);
+	  retval = makeconn(SS, host, ai, -2);
 
 	} else {
 
@@ -2405,7 +2435,7 @@
 	      sprintf(buf,"dns; %.200s", host);
 	      notary_setwtt(buf);
 	    }
-	    retval = makeconn(SS, ai, -1);
+	    retval = makeconn(SS, host, ai, -1);
 
 	    if (ai != NULL)
 	      freeaddrinfo(ai);
@@ -2424,7 +2454,7 @@
 	      sprintf(buf,"dns; %.200s", SS->mxh[i].host);
 	      notary_setwtt(buf);
 
-	      r = makeconn(SS, SS->mxh[i].ai, i);
+	      r = makeconn(SS, SS->mxh[i].host, SS->mxh[i].ai, i);
 	      SS->firstmx = i+1;
 	      if (r == EX_OK) {
 		retval = EX_OK;
@@ -2476,8 +2506,9 @@
 }
 
 int
-makeconn(SS, ai, ismx)
+makeconn(SS, hostname, ai, ismx)
 	SmtpState *SS;
+	const char *hostname;
 	struct addrinfo *ai;
 	int ismx;
 {
@@ -2492,6 +2523,8 @@
 
 	if (ai->ai_canonname)
 	  strncpy(hostbuf, ai->ai_canonname, sizeof(hostbuf));
+	else if (hostname)
+	  strncpy(hostbuf, hostname, sizeof(hostbuf));
 	else
 	  *hostbuf = 0;
 	hostbuf[sizeof(hostbuf)-1] = 0;
@@ -2554,6 +2587,8 @@
 	    SS->ai.ai_canonname = NULL;
 	    if (ai->ai_canonname)
 	      SS->ai.ai_canonname = strdup(ai->ai_canonname);
+	    else if (hostname)
+	      SS->ai.ai_canonname = strdup(hostname);
 	    SS->ai.ai_next = NULL;
 	    SS->ismx = ismx;
 	  }
@@ -2674,7 +2709,7 @@
      SmtpState *SS;
 {
   smtpclose(SS, 1);
-  return makeconn(SS, & SS->ai, SS->ismx);
+  return makeconn(SS, SS->ai.ai_canonname, & SS->ai, SS->ismx);
 }
 
 int
@@ -3119,9 +3154,6 @@
 	SS->sslmode = 0;
 #endif /* - HAVE_OPENSSL */
 
-	if (SS->smtphost != NULL)
-	  free(SS->smtphost);
-	SS->smtphost = NULL;
 }
 
 void
@@ -3202,25 +3234,32 @@
 }
 
 
+extern int select_sleep __((int fd, time_t when_tout));
+
 #ifdef	HAVE_SELECT
 
-int select_sleep(fd,tout)
-int fd, tout;
+int select_sleep(fd,when_tout)
+int fd;
+time_t when_tout;
 {
 	struct timeval tv;
 	int rc;
 	fd_set rdmask;
 	fd_set wrmask;
+
+	time(&now);
 
-	tv.tv_sec = tout;
+	tv.tv_sec = when_tout - now;
+	if (when_tout < now)
+	  tv.tv_sec = 0;
 	tv.tv_usec = 0;
 	_Z_FD_ZERO(rdmask);
 	_Z_FD_ZERO(wrmask);
 	if (fd > 0)
 	  _Z_FD_SET(fd,rdmask);
 	else {
-	  _Z_FD_SET(fd,wrmask);
 	  fd = -fd;
+	  _Z_FD_SET(fd,wrmask);
 	}
 
 	rc = select(fd+1,&rdmask,&wrmask,NULL,&tv);
@@ -3249,15 +3288,18 @@
 	return 0;    /* interrupt or timeout, or some such.. */
 }
 #else /* not HAVE_SELECT */
-int select_sleep(fd, tout)
-int fd, tout;
+int select_sleep(fd, when_tout)
+int fd;
+time_t when_tout;
 {
+	errno = ENOSYS;
 	return -1;
 }
 
 int has_readable(fd)
 int fd;
 {
+	errno = ENOSYS;
 	return 1;
 }
 #endif
@@ -3379,6 +3421,7 @@
 	char *p;
 	char *status = NULL;
 	int statesave;
+	time_t when_timeout;
 
 	SS->smtp_outcount = 0;
 	SS->block_written = 0;
@@ -3449,6 +3492,8 @@
 	  s = eol;
       rescan_line:   /* Got additional input */
 
+	  when_timeout = time(&now) + timeout;
+
 	  eof = SS->pipebuf + SS->pipebufsize;
 	  for (eol = s; eol < eof; ++eol)
 	    if (*eol == '\n') break;
@@ -3484,11 +3529,11 @@
 	      /* Blocking mode, and didn't succeed in reading, lets
 		 use select to see what we can do. */
 
-	      err = select_sleep(infd, timeout);
+	      err = select_sleep(infd, when_timeout);
 	      en = errno;
 	      if (debug && logfp)
 		fprintf(logfp,"%s#\tselect_sleep(%d,%d); rc=%d\n",
-			logtag(),infd,timeout,err);
+			logtag(),infd,(int)(when_timeout - now),err);
 	      if (err < 0) {
 		if (logfp)
 		  fprintf(logfp,"%s#\tTimeout (%d sec) while waiting responses from remote (errno=%d)\n",logtag(),timeout,en);
@@ -3657,30 +3702,40 @@
 	     SS->pipecmds[idx] ? SS->pipecmds[idx] : "<nil>");
 	  */
 
+	  if (SS->rcptstates & (FROMSTATE_500)) {
+	    /* If "MAIL From:<..>" tells non-200 report, and
+	       causes "RCPT To:<..>" commands to yield "400/500",
+	       we IGNORE the "500" status. */
+	    rc = EX_UNAVAILABLE;
+	  } else if (SS->rcptstates & (FROMSTATE_400)) {
+	    /* If "MAIL From:<..>" tells non-200 report, and
+	       causes "RCPT To:<..>" commands to yield "400/500",
+	       we IGNORE the "500" status. */
+	    SS->rcptstates |= RCPTSTATE_400;
+	    rc = EX_TEMPFAIL;
+	  }
+
 	  if (code >= 400) {
 	    /* Errors */
 
-	    /* MAIL From:<*>: ... */
+	    /* MAIL From:<*>: 250/ 552/451/452/ 500/501/421 */
 	    /* DATA: 354/ 451/554/ 500/501/503/421 */
 	    /* RCPT To:<*>: 250/251/ 550/551/552/553/450/451/452/455/ 500/501/503/421 */
 
 	    if (SS->pipercpts[idx] != NULL) {
 
-	      if (SS->rcptstates & (FROMSTATE_400)) {
-		/* If "MAIL From:<..>" tells non-200 report, and
-		   causes "RCPT To:<..>" commands to yield "400/500",
-		   we IGNORE the "500" status. */
+	      if (code >= 500)
+		SS->rcptstates |= RCPTSTATE_500;
+	      else
 		SS->rcptstates |= RCPTSTATE_400;
-		rc = EX_TEMPFAIL;
-	      } else {
-		if (code >= 500)
-		  SS->rcptstates |= RCPTSTATE_500;
-		else
-		  SS->rcptstates |= RCPTSTATE_400;
-		/* ``rc'' is correct. */
-	      }
+	      /* ``rc'' is correct. */
 
 	      /* Diagnose the errors, we report successes AFTER the DATA phase.. */
+	      if (SS->verboselog)
+		fprintf(SS->verboselog,
+			" -> diagnostic(rc=%d idx=%d) remotemsg='%s'\n",
+			rc, idx, SS->remotemsg);
+
 	      time(&endtime);
 	      notary_setxdelay((int)(endtime-starttime));
 	      notaryreport(SS->pipercpts[idx]->addr->user,FAILED,NULL,NULL);
@@ -3704,6 +3759,7 @@
 		  SS->rcptstates |= FROMSTATE_400;
 		else
 		  SS->rcptstates |= FROMSTATE_OK;
+
 	      } else {
 
 		/* "DATA" or "BDAT" phase */
@@ -3818,12 +3874,14 @@
 	}
 	if (rc == EX_OK) {
 	  /* Study the DATA STATES! */
-	  if (SS->rcptstates & DATASTATE_OK)
-	    rc = EX_OK; /* Some ok! */
+	  if (SS->rcptstates & DATASTATE_500)
+	    rc = EX_UNAVAILABLE; /* All hard failures */
 	  else if (SS->rcptstates & DATASTATE_400)
 	    rc = EX_TEMPFAIL; /* Some TEMPFAIL */
-	  else if (SS->rcptstates & DATASTATE_500)
-	    rc = EX_UNAVAILABLE; /* All hard failures */
+#if 0
+	  else if (SS->rcptstates & DATASTATE_OK)
+	    rc = EX_OK; /* Some ok! */
+#endif
 	}
 
 	if (rc != EX_OK && logfp)
Index: zmailer/transports/smtp/smtp.h
diff -u zmailer/transports/smtp/smtp.h:1.26 zmailer/transports/smtp/smtp.h:1.27
--- zmailer/transports/smtp/smtp.h:1.26	Tue Jan 23 15:37:56 2001
+++ zmailer/transports/smtp/smtp.h	Tue May  8 15:33:04 2001
@@ -351,7 +351,6 @@
   Sfio_t *smtpfp;		/* Sfio_t* to the remote host           */
   struct smtpdisc smtpdisc;	/* SMTP outstream discipline data	*/
 
-  char *smtphost;		/* strdup()ed name of the remote host */
   char *myhostname;		/* strdup()ed name of my outbound interface */
 
   FILE *verboselog;		/* verboselogfile */
@@ -466,7 +465,7 @@
 extern int  check_7bit_cleanness __((struct ctldesc *dp));
 extern void notarystatsave __((SmtpState *SS, char *smtpstatline, char *status));
 
-extern int  makeconn  __((SmtpState *SS, struct addrinfo *, int));
+extern int  makeconn  __((SmtpState *SS, const char *, struct addrinfo *, int));
 extern int  makereconn __((SmtpState *SS));
 extern int  vcsetup  __((SmtpState *SS, struct sockaddr *, int*, char*));
 #ifdef	BIND
Index: zmailer/utils/Makefile.in
diff -u zmailer/utils/Makefile.in:1.18 zmailer/utils/Makefile.in:1.19
--- zmailer/utils/Makefile.in:1.18	Wed Aug 30 12:29:21 2000
+++ zmailer/utils/Makefile.in	Sat Feb 24 00:15:47 2001
@@ -50,9 +50,12 @@
 .c.o:
 	$(CC) $(CFLAGS) -c $<
 
-listexpand:	listexpand.o
-	$(CC) $(CFLAGS) -o $@.x listexpand.o $(LIB)
+listexpand:	listexpand.o $(TOPDIR)/smtpserver/rfc821scn.o
+	$(CC) $(CFLAGS) -o $@.x listexpand.o $(TOPDIR)/smtpserver/rfc821scn.o $(LIB)
 	mv $@.x $@
+
+$(TOPDIR)/smtpserver/rfc821scn.o:
+	cd $(TOPDIR)/smtpserver; $(MAKE) $MFLAGS) rfc821scn.o
 
 md5sum: md5sum.o $(LIBDEB)
 	$(CC) $(CFLAGS) -o $@.x md5sum.o $(LIB)
Index: zmailer/utils/listexpand.c
diff -u zmailer/utils/listexpand.c:1.8 zmailer/utils/listexpand.c:1.10
--- zmailer/utils/listexpand.c:1.8	Fri Jan 21 00:14:56 2000
+++ zmailer/utils/listexpand.c	Mon Feb 26 13:44:58 2001
@@ -19,7 +19,7 @@
 #include "ta.h"
 #include "libz.h"
 
-int bundlesize = 200;
+int bundlesize = 6000;
 
 char *progname = "listexpand";
 int D_alloc = 0;
@@ -27,6 +27,8 @@
 extern char *strchr();
 #endif
 
+extern  char * rfc821_path2 __((char *s, int strict));
+
 /* this macro is from  compat/sendmail/sendmail.c */
 
 #define RFC821_822QUOTE(newcp,cp) \
@@ -54,7 +56,7 @@
 
 void usage()
 {
-  fprintf(stderr,"%s: [-{bundlesize}]  owner@address /path/to/file/containing/addresses [privuid]\n",
+  fprintf(stderr,"%s: ['-debug'] ['+ezmlm'] [-{bundlesize}]  owner@address /path/to/file/containing/addresses [privuid]\n",
 	  progname);
   exit(EX_USAGE);
 }
@@ -108,11 +110,25 @@
 	struct rcpts *rcpts = malloc(sizeof(*rcpts)*8);
 	int rcpts_space = 8;
 	int rcpts_count = 0;
+	int ezmlmalike = 0;
+	int debug = 0;
+
+	if (argv[1] && strcmp(argv[1],"-debug")==0) {
+	  ++argv;
+	  --argc;
+	  debug = 1;
+	}
 
+	if (argv[1] && strcmp(argv[1],"+ezmlm")==0) {
+	  ++argv;
+	  --argc;
+	  ezmlmalike = 1;
+	}
+
 	if (argc > 3 && argv[1][0]=='-') {
 	  bundlesize = atoi(argv[1]+1);
-	  if (bundlesize < 200)
-	    bundlesize = 200;
+	  if (bundlesize < 1)
+	    bundlesize = 1;
 	  ++argv;
 	  --argc;
 	}
@@ -133,18 +149,47 @@
 	  s = strchr(buf,'\n'); if (s) *s = 0; /* Zap the trailing '\n' */
 
 	  s = buf;
-	  while(*s == ' ' || *s == '\t') ++s;
-	  p = skip821address(s);
+	  while(*s == ' ' || *s == '\t') ++s; /* Skip white */
+
+	  p = rfc821_path2(s, 1); /* Strict syntax scanner */
+
 	  /* Blank line -- or started with TAB or SPC.. */
+
+	  if (p == s) {
+	    if (debug) {
+	      fprintf(stderr, "Input Address Syntax Fault: '%s'\n", buf);
+	    } else {
+	      /* Report the error to the given OWNER! */
+	      if (!mfp) {
+		mfp = mail_open(MSG_RFC822);
+		if (!mfp) exit(EX_CANTCREAT); /* ??? */
+
+		fprintf(mfp, "channel error\n");
+		fprintf(mfp, "to %s\nenv-end\n", argv[1]);
+		fprintf(mfp, "From: \"Expander of %s\" <>\n", argv[2]);
+		fprintf(mfp, "To: List Owner <%s>\n", argv[1]);
+		fprintf(mfp, "Subject: Bad data at listfile '%s'\n", argv[2]);
+		fprintf(mfp, "\n");
+		fprintf(mfp, "Following lines were found to have bad RFC 821\n");
+		fprintf(mfp, "interpreted data at file: %s\n\n", argv[2]);
+	      }
+
+	      fprintf(mfp, "%s\n", buf);
+
+	    }
+	    continue;
+	  }
+
 	  *p = 0;
 	  if (s == p || *s == '\n' || *s == 0) continue;
 
 	  p2 = p = strrchr(s,'@');
-	  while (p && *p) {
-	    if (*p >= 'A' && *p <= 'Z')
-	      *p += 0x20;
-	    ++p;
+
+	  /* Lowercasify the ASCII (domain) string */
+	  for (; p && *p; ++p) {
+	    if ('A' <= *p && *p <= 'Z') *p += 0x20;
 	  }
+
 	  if (rcpts_count >= rcpts_space) {
 	    rcpts_space <<= 1;
 	    rcpts = realloc(rcpts, sizeof(*rcpts)*rcpts_space);
@@ -155,6 +200,9 @@
 	}
 	fclose(addrfile);
 
+	if (mfp)
+	  mail_close(mfp);
+
 	if (rcpts_count == 0) {
 	  rcpts[rcpts_count].address = "postmaster";
 	  rcpts[rcpts_count].revdomain = "";
@@ -195,15 +243,22 @@
 	while (rcpts_space < rcpts_count) {
 	  int i;
 	  /* Open the spool file  */
-	  mfp = mail_open(MSG_RFC822);
+	  if (debug) {
+	    mfp = stderr;
+	    fprintf(mfp, "\n----------- %d -----------\n\n", rcpts_space);
+	  } else
+	    mfp = mail_open(MSG_RFC822);
 	  if (!mfp) exit(EX_CANTCREAT); /* ??? */
+
+	  fprintf(mfp,"via listexpand\n");
+
 	  if (argv[1][0] == 0 || argv[1][0] == ' ')
 	    fprintf(mfp,"channel error\n");
-	  else
+	  else {
 	    fprintf(mfp,"from %s\n",argv[1]);
-	  fprintf(mfp,"via listexpand\n");
+	  }
 
-	  /* Up to 200 recipient addresses */
+	  /* Up to BUNDLESIZE recipient addresses */
 	  for (i = 0;
 	       rcpts_space < rcpts_count && i < bundlesize;
 	       ++i) {
@@ -214,43 +269,65 @@
 	    /* FIRST 'todsn', THEN 'to' -header! */
 	    fprintf(mfp, "todsn ORCPT=rfc822;");
 	    p = s;
-	    while (*p) {
+	    for (p = s; *p; ++p) {
 	      u_char c = *p;
 	      if ('!' <= c && c <= '~' && c != '+' && c != '=')
 		putc(c,mfp);
 	      else
 		fprintf(mfp,"+%02X",c);
-	      ++p;
 	    }
 	    /* if (notify)
 	       fprintf(mfp," NOTIFY=%s", notify);
 	       */
+	    if (ezmlmalike) {
+	      int prevc = 0;
+	      fprintf(mfp, " EZMLM=+");
+	      for (p = s; *p; ++p) {
+		u_char c = *p;
+		if (('0' <= c && c <= '9') ||
+		    ('A' <= c && c <= 'Z') ||
+		    ('a' <= c && c <= 'z') ||
+		    ('.' == c && c != prevc) || ('-' == c) || (c == '_')) {
+		  putc(c, mfp);
+		} else
+		  fprintf(mfp, "=%02X", c);
+		prevc = c;
+	      }
+	    }
 	    putc('\n',mfp);
 	    fprintf(mfp,"to %s\n",s);
 	  } /* End of recipient address printing */
+
 	  fprintf(mfp,"env-end\n");
+
 	  if (ferror(mfp) || feof(mfp)) {
 	    mail_abort(mfp);
 	    exit(EX_CANTCREAT);
 	  }
+
+	  if (!debug) {
 
-	  fseek(bodycopy, 0, SEEK_SET);
-	  while (1) {
-	    int siz = fread(buf,1,sizeof(buf),bodycopy);
-	    if (siz == 0) break;
-	    if (fwrite(buf,1,siz,mfp) != siz) {
+	    fseek(bodycopy, 0, SEEK_SET);
+	    while (1) {
+	      int siz = fread(buf,1,sizeof(buf),bodycopy);
+	      if (siz == 0) break;
+	      if (fwrite(buf,1,siz,mfp) != siz) {
+		mail_abort(mfp);
+		exit(EX_CANTCREAT);
+	      }
+	    }
+
+	    if (feof(mfp) || ferror(mfp)) {
 	      mail_abort(mfp);
 	      exit(EX_CANTCREAT);
 	    }
-	  }
+	    if (privuid >= 0)
+	      fchown(FILENO(mfp),privuid,-1);
+	    mail_close(mfp);
 
-	  if (feof(mfp) || ferror(mfp)) {
-	    mail_abort(mfp);
-	    exit(EX_CANTCREAT);
-	  }
-	  if (privuid >= 0)
-	    fchown(FILENO(mfp),privuid,-1);
-	  mail_close(mfp);
-	}
+	  } /* - not debug - */
+
+	} /* All recipientbundles */
+
 	return 0;
 }
Index: zmailer/utils/vacation/vacation.c
diff -u zmailer/utils/vacation/vacation.c:1.16 zmailer/utils/vacation/vacation.c:1.17
--- zmailer/utils/vacation/vacation.c:1.16	Tue Jan 23 01:35:11 2001
+++ zmailer/utils/vacation/vacation.c	Mon Feb 26 13:44:59 2001
@@ -2,7 +2,7 @@
  *  vacation -- originally BSD vacation by Eric Allman,
  *
  *  Adapted to ZMailer by Rayan Zachariassen, and further
- *  modified by Matti Aarnio over years 1988(?) thru 1998.
+ *  modified by Matti Aarnio over years 1988(?) thru 2000.
  */
 
 #include "mailer.h"
