[comp.unix.sysv386] Smail3.1.21 on Sys V and ESIX

robert@netsoft.wimsey.bc.ca (Robert B. Nelson) (06/03/91)

The patches I posted for ESIX earlier will work unchanged on patch 21
of Smail 3.1.  However the changes introduced in patch 21 contain a
couple of bugs which need fixing before it will compile.  I believe
the changes apply to most System V versions not just ESIX.

The first problem is with the resetting of the mail files access time.
The routine which was added assumes a utime.h file declaring the structure
utimbuf.  Three or four of the System Vs I've used don't have this file.
The only place I remember seeing it is in the 88/Open version.  The fix I've
come up with is to add a new feature variable for the conf/os/<file>.  This new
variable is called UTIME_H.  If the variable is not defined then the utimbuf
structure is declared as per the SVID otherwise utime.h is included.  This
variable is only required for systems which don't conform to the SVID and
supply the utime.h file.

The second problem is the use of isprint() without including ctype.h.

The diffs to correct these two problems follow:

--------------------------------C-U-T---H-E-R-E--------------------------------
--- ../smail3_1_21/src/transports/appendfile.c	1991/06/03 01:02:36
+++ ./src/transports/appendfile.c	1991/06/03 07:50:12
@@ -80,7 +80,14 @@
 # include <sys/file.h>
 #endif
 #if defined(UNIX_SYS5) || defined(HAVE_UTIME)
+#if defined(HAVE_UTIME_H)
 # include <utime.h>
+#else
+struct utimbuf	{
+    time_t	actime;		/* access time */
+    time_t	modtime;	/* modification time */
+}   times;
+#endif
 # define RESTORE_ATIME
 #else	/* not UNIX_SYS5 && not HAVE_UTIME */
 # if defined(UNIX_BSD) || defined(HAVE_UTIMES)
===================================================================
--- ../smail3_1_21/src/transports/pipe.c	1991/06/03 04:57:33
+++ ./src/transports/pipe.c	1991/06/03 04:58:47
@@ -47,6 +47,7 @@
  *		write failed on the pipe.
  */
 #include <stdio.h>
+#include <ctype.h>
 #include <pwd.h>
 #include <grp.h>
 #include <signal.h>
--------------------------------C-U-T---H-E-R-E--------------------------------

-- 
Robert B. Nelson                               NetSoft Systems Inc
Phone: (604) 261-3652                          1102 West 48th Avenue
INTERNET: robert@netsoft.wimsey.bc.ca          Vancouver, BC, CANADA, V6M 2N5

larry@nstar.rn.com (Larry Snyder) (06/03/91)

what does 21 correct (or add) over 20?

-- 
      Larry Snyder, NSTAR Public Access Unix 219-289-0287/317-251-7391
                         HST/PEP/V.32/v.32bis/v.42bis 
                        regional UUCP mapping coordinator 
               {larry@nstar.rn.com, ..!uunet!nstar.rn.com!larry}

robert@netsoft.wimsey.bc.ca (Robert B. Nelson) (06/04/91)

In <1991Jun03.123538.15104@nstar.rn.com> larry@nstar.rn.com (Larry Snyder) writes:

>what does 21 correct (or add) over 20?

I have enclosed the CHANGES section from the README distributed with 3.1.21.

>-- 
>      Larry Snyder, NSTAR Public Access Unix 219-289-0287/317-251-7391
>                         HST/PEP/V.32/v.32bis/v.42bis 
>                        regional UUCP mapping coordinator 
>               {larry@nstar.rn.com, ..!uunet!nstar.rn.com!larry}

CHANGES IN THE 3.1.21 RELEASE

Release 3.1.21 is a patch release to smail3.1.20, which was a limited
release of smail.  The 3.1.20 release included significant work on the
OS-configuration aspects of smail.  The 3.1.21 is primarily a bug fix
release.  All of the enhancements are limited in scope.

Some changes in 3.1.21 are:

1.  Smail now tries to preserve the access time for mailbox files.
    This allows programs to compare the access time and modification
    time of mailbox files to determine if mail has arrived.  The
    usability of this depends upon your mail user interface.

2.  Added some optimization options to the DNS router driver (bind)
    to prevent lookups for domains that are known not to be in the
    DNS, or for names that apparently are not domains.

3.  Added support to the bind router for delivering mail only
    to those sites with MX records.  This is useful for some local
    area networks, but is generally not advisable on the Internet.

4.  Enhanced the /bin/mail "replacement" (in pd/binmail) to support
    options of the SVR3 and SVR4 versions of /bin/mail.

5.  Added support for HP-UX 7.0 and A/UX 2.0.

6.  Better debugging messages are now generated, including complete
    expanded headers, plus filenames (for appendfile) and shell
    commands (for the pipe driver).  Use a debugging level of at
    least 6 to get all of the new debugging output.

Some bugs that were fixed:

1.  Fixed a bug in the bind router that was resulting in considering
    some MX entries for a host to be invalid.  The problem fixed was
    that the GETSHORT macro was being called with a regular char *
    rather than an unsigned char *.  On some machines that supply
    a GETSHORT macro, this resulted in inappropriate sign extensions.

2.  One C compiler (pcc for microport/286) couldn't handle four
    HDREQ() macro calls in an if statement.  These were broken up
    into two if statements.

3.  The help message printed by SMTP was in a single, multi-line
    string which was too long for some compilers (Xenix/286).  This
    was broken up into multiple strings.

4.  Several people pointed out that their systems could not include
    both <sys/time.h> and <time.h>, as was done in src/main.c.  Only
    one of these will now be included, based on os-type.

5.  The fwdfile director driver was calling xprintf with the wrong
    number of arguments, if a parsing error was encountered in a
    mailing list or .forward file, sometimes causing a core dump,
    often generating less than meaningful error messages.

6.  Some machines do not support the <<-EOF construct (indented here
    documents) in /bin/sh.  Uses of this construct were removed.

7.  Shell scripts in the util source directory were not having the
    X_UTIL_PATH_X replaced by a propper set of directories.  This
    resulted from the changes to mkdefs.sh in release 3.1.20.  This
    has been fixed.

8.  On some systems (Motorola V.3.2), use of greater than 14 character
    file names results in failure rather than name truncation.  This
    was a problem for the installation procedure which uses four-
    character suffixes (.OLD and .NEW).  These suffixes have been
    changed to .O and .N.

9.  When using the malloc library supplied with SVR3, a structure
    cannot be referenced after it is freed.  One known use of a
    freed structure (in smtprecv.c) was modified.

10. I found another case where an @user@host address was being
    generated, in smtplib.c.

11. Smail for SunOS will not compile correctly if /usr/5bin is in
    your PATH before /bin.  To compensate, the sun_os4 conf/os file
    sets CC to /bin/cc explicitly.

12. The gethostbyname router driver was returning a NULL rather than
    DB_NOMATCH in one case, causing occasionally incorrect behavior.

13. Fixed some problems with pathalias, including some problems with
    ANSI C compilers, and a potential loop in generated output which
    was exhibited at some sites by more recent postings of the USENET
    map database.

14. The handling of :include: files would occasionally result in
    inappropriate errors.  This resulted from functions that were
    supposed to return a value but instead had implicit returns.
    The common symptom was an error message with a blank error.

-- 
Robert B. Nelson                               NetSoft Systems Inc
Phone: (604) 261-3652                          1102 West 48th Avenue
INTERNET: robert@netsoft.wimsey.bc.ca          Vancouver, BC, CANADA, V6M 2N5

mju@mudos.ann-arbor.mi.us (Marc Unangst) (06/05/91)

robert@netsoft.wimsey.bc.ca (Robert B. Nelson) writes:
> The routine which was added assumes a utime.h file declaring the structure
> utimbuf.  Three or four of the System Vs I've used don't have this file.

AT&T System V doesn't have it, which is probably why most of the
derivative System V's don't have it.

When I compiled smail 3.1.21, I went into /usr/include and made a
utime.h.  I'm not sure why AT&T didn't put the struct utimbuf
declaration into an include file, but instead required you to put it in
all your programs...What does AT&T think include files are for, anyway?

(The system may not conform to SVID anymore, but I doubt anything's
going to break because <utime.h> exists where it shouldn't.)

--
Marc Unangst               |
mju@mudos.ann-arbor.mi.us  | "Bus error: passengers dumped"
...!hela!mudos!mju         |