v02i032: Smail 2.5 patches for Xenix -- finally!

Chip Salzenberg chip at ateng.UUCP
Sun Jan 31 08:23:45 AEST 1988


[I sat on these for a bit, this being the fourth "final" version I've received.
Comp.sources.misc: Volume 2, Issue 32
Submitted-By: Chip Salzenberg <chip at ateng.UUCP>
Archive-Name: final-xenix-smail

[I sat on these for a bit, this being the fourth "final" version I've received.
Looks like this time it's for keeps.  ++bsa]

Okay, here it is (finally).  Patches for using Smail under SCO Xenix.
Many people have got smail running under Xenix, but their schemes usually
break Micnet mail and ignore pipe aliases as supported by the standard
Xenix mail system.  My patches don't replace Xenix mail, they work with it.

And besides, they look nice.  :-)

So here's the sharchive.  "Shar and enjoy."

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the "#! /bin/sh" line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	X.README
#	X.patches
#	Makefile
#	execm.c
#	install_smail
# This archive created: Thu Jan  7 13:58:34 1988
export PATH; PATH=/bin:$PATH
:
echo 'shar: extracting "X.README" (4621 characters) '
if test -f 'X.README'
then
	echo 'shar: will not overwrite existing file "X.README" '
else
sed 's/^X//' << \SHAR_EOF > 'X.README'
XX.README
X
XThis file describes how to use the enclosed smail 2.5 patches for SCO Xenix
XSystem V.  (They may work with non-SCO Xenix.)
X
XTo use these patches, you need either (1) Larry Wall's "patch" program, or
X(2) lots of patience while you apply these changes by hand.
X
X
XFor users of my earlier smail patches:
X
X	I posted some early smail patches in comp.unix.xenix and
X	alt.sources in December '87.  If you are using those patches, you
X	should get rid of them and USE THESE PATCHES INSTEAD.
X
X	Why?
X
X	1.  Cleaner mods (only important things have been changed).
X	2.  Better comments.
X	3.  Explicit support for Micnet/Xenix-Net.
X	4.  Support for /etc/systemid file (no need to relink your
X	    kernel to change your machine name).
X
X
XInstallation:
X
X	1.  Find your original, untouched smail 2.5 sources.  Copy these
X	    to a new directory.  (We'll call it "/usr/src/xsmail".)
X	    If you don't have your original sources, some (or many!)
X	    patches may fail, possibly introducing problems.
X
X	2.  Unpack this sharchive and move the files in this sharchive into
X	    /usr/src/xsmail.  This will overwrite the distributed Makefile,
X	    so you may want to rename the original Makefile first.
X
X	3.  Change to /usr/src/xsmail and run "patch <X.patches".  This
X	    does the hard work of changing source files.
X
X	    This step will leave ".orig" files lying around.  You may
X	    remove these at any time, but I'd leave them until installation
X	    is complete just to be on the safe side.  If any patches fail
X	    -- which should only occur if you're starting with modfied
X	    sources -- the failed patches will be written to ".rej" files.
X
X	4.  Examine defs.h and modify it as necessary for your machine(s).
X	    Specifically, if you're running Micnet or Xenix-Net, you'll
X	    probably want to uncomment "#define MICNET". (Or you can
X	    include "-DMICNET" in the CFLAGS in the Makefile.)
X
X	5.  Run "make" to make smail and execm, or if you prefer, run
X	    "make all".
X
X	6.  >As root<, run "./install_smail".
X
X
XThe above steps should result in:
X
X	/usr/bin/rmail moved to /usr/bin/rmail.x and never used again.
X
X	Smail installed as /usr/bin/smail with a link to /usr/bin/rmail.
X
X	/usr/lib/mail/execmail moved to /usr/lib/mail/execmail.x.  Smail
X	then uses execmail.x for delivering local mail. (If you compile
X	smail with MICNET defined, then execmail.x is used for delivering
X	_all_ mail, not just local mail.)
X
X	The program execm.c installed as /usr/lib/mail/execmail.  This
X	"fake" execmail just parses its arguments and overlays itself with
X	smail, which does all the work. (The /bin/mail program uses
X	execmail, so we can't ignore it.  I would have just linked
X	/usr/bin/smail to /usr/lib/mail/execmail, but their arguments are
X	different.)
X
X
XNotes on aliasing:
X
X	The normal Xenix aliasing mechanism is still intact. (You know,
X	/usr/lib/aliases, maliases, and faliases.) In addition, smail
X	aliases using the file /usr/lib/mail/saliases.  This file has a
X	format which is almost, but not quite, entirely unlike the Xenix
X	aliases file.  See the smail "aliases.c" for some hints.  The main
X	difference is that you can include a name in parentheses after the
X	alias:
X
X	    postmaster:     chip                    (mail administrator)
X	    rick:           rick at uunet.uu.net       (Rick Adams)
X
X	The nice thing about having two alias files is that smail's aliases
X	can be internet-style addresses ("user at domain"), and execmail's
X	aliases can be pipes ("|/usr/lib/news/uurec").  If you use Micnet,
X	the network utilities will stomp on the Xenix aliases file but
X	leave the saliases file untouched.
X
X
XNotes on the use of /bin/mail:
X
X	If you want to use Internet-style addresses with /bin/mail, you
X	have to add the line "set execmail" to /usr/lib/mail/mailrc.
X	Otherwise, /bin/mail assumes that addresses without bangs must be
X	valid local users.  Of course, you can use the bang notation with
X	domains and /bin/mail will always be happy.
X
X	If you do any significant amount of mail work, forget /bin/mail and
X	use Elm.  It's the best thing since System V.  :-)
X
X
XOne final comment:
X
X	I'd like to have some idea of how widely used these patches are.
X	So when you get it working -- or if you can't! -- drop me a line
X	and tell me about it. (My address is ateng!chip.  If you can't find
X	a valid path, try going through codas or uunet.)
X
X
XObligatory quote:
X
X	"INVESTIGATE your point of view, don't just dogmatize it!
X	Reflect on it and re-evaluate it.  You may want to change
X	your mind someday."
X				-- Tim Reingold, from alt.flame
X
XSignature:
X
X	Chip Salzenberg <chip at ateng.UUCP>
X	A T Engineering, Tampa, FL
X	06 January 1988
SHAR_EOF
if test 4621 -ne `wc -c < 'X.README'`
then
	echo 'shar: error transmitting "X.README" (should have been 4621 characters) '
fi
chmod 644 'X.README'
fi  # end of overwriting check
:
echo 'shar: extracting "X.patches" (10980 characters) '
if test -f 'X.patches'
then
	echo 'shar: will not overwrite existing file "X.patches" '
else
sed 's/^X//' << \SHAR_EOF > 'X.patches'
XIndex: alias.c
X*** smail2.5/alias.c	Mon Dec 21 18:29:55 1987
X--- smail/alias.c	Thu Sep 24 13:00:56 1987
X***************
X*** 460,462 ****
X  
X! 	while((*p != NULL) && (*p != '#')) {
X  		b = p;
X--- 460,462 ----
X  
X! 	while((*p != '\0') && (*p != '#')) {
X  		b = p;
XIndex: defs.h
X*** smail2.5/defs.h	Mon Dec 21 18:29:57 1987
X--- smail/defs.h	Wed Dec 30 11:30:40 1987
X***************
X*** 18,19 ****
X--- 18,47 ----
X  
X+ /*
X+ **	Modified for SCO Xenix by Chip Salzenberg (chip at ateng.UUCP).
X+ **	Released to Usenet on 01 Dec 1987.
X+ **	Further modified 23 Dec 1987.
X+ **
X+ **	Additions:
X+ **
X+ **		EXECMAIL is defined as the renamed /usr/lib/mail/execmail.
X+ **		Under Xenix, this is the local delivery agent.
X+ **
X+ **		SMARTMAILER is now automatically defined if either SENDMAIL
X+ **		or EXECMAIL is defined.  This is useful for code that depends
X+ **		on properties that these programs have in common (automatic
X+ **		bouncing of failed mail, for example).
X+ **
X+ **		MICNET should be defined if Micnet or Xenix-Net is in use.
X+ **		In this case, execmail is used for _all_ mail, which allows
X+ **		the automatic routing of UUCP mail to a gateway.  However,
X+ **		execmail sends one file per recipient, even if the recipients
X+ **		are all on the same (remote) machine.  This is not exactly
X+ **		a bug; it just increases UUCP connect time.  I personally
X+ **		leave MICNET undefined.
X+ **
X+ **		HOSTFILE is the name of a file containing the hostname.
X+ **		Under Xenix, this is "/etc/systemid".  HOSTFILE overrides
X+ **		UNAME/GETHOSTNAME.
X+ */
X+ 
X  #ifndef VERSION
X***************
X*** 32,34 ****
X  
X! /* if defined, HOSTNAME overrides UNAME and GETHOSTNAME */
X  /*#define HOSTNAME	"host"		/* literal name */
X--- 60,69 ----
X  
X! /* if defined, HOSTFILE overrides UNAME and GETHOSTNAME */
X! #ifndef HOSTFILE
X! #ifdef M_XENIX
X! #define HOSTFILE    "/etc/systemid"	/* read host name from this file */
X! #endif
X! #endif
X! 
X! /* if defined, HOSTNAME overrides HOSTFILE, UNAME, and GETHOSTNAME */
X  /*#define HOSTNAME	"host"		/* literal name */
X***************
X*** 105,107 ****
X  
X! #define ALIAS	"/usr/lib/aliases"	/* location of mail aliases       */
X  /*#define CASEALIAS			/* make aliases case sensitive    */
X--- 140,147 ----
X  
X! 	/* Location of mail aliases */
X! #ifdef M_XENIX
X! #define ALIAS   "/usr/lib/mail/saliases"
X! #else
X! #define ALIAS   "/usr/lib/aliases"
X! #endif
X  /*#define CASEALIAS			/* make aliases case sensitive    */
X***************
X*** 125,126 ****
X--- 165,170 ----
X  
X+ 	/* list of Full Name, address pairs */
X+ #ifdef M_XENIX
X+ #define FULLNAME        "/usr/lib/mail/fullnames"
X+ #else
X  #define FULLNAME	"/usr/lib/fullnames"
X***************
X*** 126,128 ****
X  #define FULLNAME	"/usr/lib/fullnames"
X! 					/* list of Full Name, address pairs */
X  
X--- 170,172 ----
X  #define FULLNAME	"/usr/lib/fullnames"
X! #endif
X  
X***************
X*** 144,146 ****
X  
X! /*#define LOG	"/usr/spool/uucp/mail.log"	/* log of uucp mail */
X  /*#define RECORD	"/tmp/mail.log"		/* record of uucp mail */
X--- 188,190 ----
X  
X! #define LOG	"/usr/spool/uucp/mail.log"	/* log of uucp mail */
X  /*#define RECORD	"/tmp/mail.log"		/* record of uucp mail */
X***************
X*** 162,165 ****
X  
X! #ifndef SMAIL
X! #define SMAIL		"/bin/smail"	/* location of smail command */
X  #endif
X--- 206,212 ----
X  
X! #ifndef SMAIL       /* location of smail command */
X! #ifdef M_XENIX
X! #define SMAIL		"/usr/bin/smail"
X! #else
X! #define SMAIL		"/bin/smail"
X  #endif
X***************
X*** 165,166 ****
X--- 212,214 ----
X  #endif
X+ #endif
X  
X***************
X*** 179,182 ****
X  
X! #define RMAIL(flags,from,sys) "%s -a%s %s - %s!rmail",UUX,from,flags,sys /* */
X! /*#define RMAIL(flags,from,sys) "%s %s - %s!rmail",UUX,flags,sys /* */
X  
X--- 227,230 ----
X  
X! /*#define RMAIL(flags,from,sys) "%s -a%s %s - %s!rmail",UUX,from,flags,sys /* */
X! #define RMAIL(flags,from,sys) "%s %s - %s!rmail",UUX,flags,sys /* */
X  
X***************
X*** 187,188 ****
X--- 235,238 ----
X  
X+ 	/* We're letting sendmail do lots of work for us. */
X+ 
X  #define HANDLE	JUSTUUCP	/* see HANDLE definition below */
X***************
X*** 195,197 ****
X  
X! #else
X  
X--- 245,247 ----
X  
X! #else  /* !SENDMAIL */
X  
X***************
X*** 197,200 ****
X  
X! #define HANDLE	ALL
X! #define ROUTING JUSTDOMAIN
X  
X--- 247,249 ----
X  
X! 	/* We don't have sendmail, so we'll do the work ourselves. */
X  
X***************
X*** 200,205 ****
X  
X! #ifdef BSD
X! #define LMAIL(frm,sys)		"/bin/mail"	/* BSD local delivery agent */
X! #else
X! #define LMAIL(frm,sys)		"/bin/lmail"	/* SV  local delivery agent */
X  #endif
X--- 249,255 ----
X  
X! #define HANDLE  ALL             /* see HANDLE definition below */
X! #define ROUTING ALWAYS          /* see ROUTING definition below */
X! 
X! #ifdef BSD              /* BSD local delivery agent */
X! #define LMAIL(frm,sys)          "/bin/mail"
X  #endif
X***************
X*** 206,207 ****
X--- 256,267 ----
X  
X+ #ifdef M_XENIX          /* Xenix local delivery agent (renamed) */
X+ #define EXECMAIL                "/usr/lib/mail/execmail.x"
X+ #define LMAIL(frm,sys)          "%s -m -f '%s'",EXECMAIL,frm
X+ /*#define MICNET                  /* give all mail to execmail, never uux */
X+ #endif
X+ 
X+ #ifndef LMAIL           /* Default local delivery agent */
X+ #define LMAIL(frm,sys)          "/bin/lmail"
X+ #endif
X+ 
X  #define LARG(user)		" '%s'",postmaster(user)
X***************
X*** 210,211 ****
X--- 270,280 ----
X  
X+ #endif  /* !SENDMAIL */
X+ 
X+ /* Sendmail and Execmail are "smart" mailers */
X+ #ifdef SENDMAIL
X+ #define SMARTMAILER
X+ #endif
X+ 
X+ #ifdef EXECMAIL
X+ #define SMARTMAILER
X  #endif
XIndex: deliver.c
X*** smail2.5/deliver.c	Mon Dec 21 18:29:59 1987
X--- smail/deliver.c	Wed Dec 23 12:19:33 1987
X***************
X*** 7,8 ****
X--- 7,24 ----
X  
X+ /*
X+ **	Modified for SCO Xenix by Chip Salzenberg (chip at ateng.UUCP).
X+ **	Released to Usenet on 01 Dec 1987.
X+ **	Further modified 23 Dec 1987.
X+ **
X+ **	Additions:
X+ **
X+ **		If MICNET is defined, then LMAIL (execmail) is used to
X+ **		deliver all mail, even remote mail.  See defs.h for a
X+ **		discussion of the tradeoffs of this feature.
X+ **
X+ **		Some #ifdefs are now SMARTMAILER instead of SENDMAIL.
X+ **		This is because execmail has some of the intelligent
X+ **		features of sendmail, i.e. automatic mail return.
X+ */
X+ 
X  #ifndef lint
X***************
X*** 219,222 ****
X  			command = scommand;
X- 		} else if (form == LOCAL) {
X- 			command = lcommand;
X  		} else {
X--- 235,236 ----
X***************
X*** 222,226 ****
X  		} else {
X! 			command = rcommand;
X! 			if(flags == uux_noqueue) {
X! 				noqcnt++;
X  			}
X--- 236,250 ----
X  		} else {
X! #ifdef MICNET
X! 			/* Xenix system running Micnet -- let execmail
X! 			 * handle all messages except retries.
X! 			 */
X! 			command = lcommand;
X! #else
X! 			if (form == LOCAL) {
X! 				command = lcommand;
X! 			} else {
X! 				command = rcommand;
X! 				if(flags == uux_noqueue) {
X! 					noqcnt++;
X! 				}
X  			}
X***************
X*** 226,227 ****
X--- 250,252 ----
X  			}
X+ #endif
X  		}
X***************
X*** 271,273 ****
X  		if (form == LOCAL) {
X! #ifdef SENDMAIL
X  			(void) sprintf(buf, LFROM(from, nows, hostname));
X--- 296,298 ----
X  		if (form == LOCAL) {
X! #ifdef SMARTMAILER
X  			(void) sprintf(buf, LFROM(from, nows, hostname));
X***************
X*** 283,285 ****
X  			} else {
X! 				*p = NULL;
X  				(void) sprintf(buf, RFROM(p+1, nows, from));
X--- 308,310 ----
X  			} else {
X! 				*p = '\0';
X  				(void) sprintf(buf, RFROM(p+1, nows, from));
X***************
X*** 372,378 ****
X  					(void) fseek(spoolfp, message, 0);
X! #ifdef SENDMAIL
X! 					/* if we have sendmail, then it
X! 					** was handed the mail, which failed.
X! 					** sendmail returns the failed mail
X! 					** for us, so we need not do it again.
X  					*/
X--- 397,402 ----
X  					(void) fseek(spoolfp, message, 0);
X! #ifdef SMARTMAILER
X! 					/* Mail is automatically returned
X! 					** by sendmail and execmail, so we
X! 					** need not do it again.
X  					*/
XIndex: headers.c
X*** smail2.5/headers.c	Mon Dec 21 18:30:06 1987
X--- smail/headers.c	Wed Dec 23 12:26:43 1987
X***************
X*** 5,6 ****
X--- 5,18 ----
X  
X+ /*
X+ **	Modified for SCO Xenix by Chip Salzenberg (chip at ateng.UUCP).
X+ **	Released to Usenet on 01 Dec 1987.
X+ **	Further modified 23 Dec 1987.
X+ **
X+ **	Additions:
X+ **
X+ **		Understand "a%b" to mean "a at b".  (This is a judgement call.
X+ **		I prefer to accept any mail that I can understand, not just
X+ **		that which is "correct.")
X+ */
X+ 
X  #ifndef lint
X***************
X*** 155,156 ****
X--- 167,179 ----
X  	}
X+ /*
X+ **  Try splitting at %.  If it works, this is user%domain, which we choose
X+ **  to understand as user at domain.  Prefer the righthand % in a%b%c.
X+ **  (This code allows 'user%foo at mydom' to mean '@mydom,user at foo'.)
X+ */
X+ 	if ((parts = ssplit(address, '%', partv)) >= 2) {
X+ 		(void) strcpy(domain, partv[parts-1]);
X+ 		(void) strncpy(user, partv[0], partv[parts-1]-partv[0]-1);
X+ 		user[partv[parts-1]-partv[0]-1] = '\0';
X+ 		return (DOMAIN);
X+ 	} 
X  /* 
XIndex: misc.c
X*** smail2.5/misc.c	Mon Dec 21 18:30:19 1987
X--- smail/misc.c	Wed Dec 23 12:30:02 1987
X***************
X*** 5,6 ****
X--- 5,21 ----
X  
X+ /*
X+ **	Modified for SCO Xenix by Chip Salzenberg (chip at ateng.UUCP).
X+ **	Released to Usenet on 01 Dec 1987.
X+ **	Further modified 23 Dec 1987.
X+ **
X+ **	Additions:
X+ **
X+ **		If HOSTFILE is defined, read it to look for the hostname.
X+ **		(This file is typically "/etc/systemid" on Xenix systems.)
X+ **		If HOSTFILE is missing, try uname() or gethostname().
X+ **
X+ **		Write only the basename of the program in the log file,
X+ **		just to make the log file easier to read.
X+ */
X+ 
X  #ifndef lint
X***************
X*** 53,57 ****
X  
X! 	logtime = strcpy(tbuf, nows);
X! 	logtime[16] = '\0';
X! 	logtime += 4;
X  
X--- 68,75 ----
X  
X! 	/* To make the log file look nicer, show only the basename of
X! 	 * the command.
X! 	 */
X! 	if (*command == '/')
X! 	{
X! 		char *p, *ecmd;
X  
X***************
X*** 57,58 ****
X--- 75,92 ----
X  
X+ 		if ( (ecmd = index(command, ' ')) != 0 )
X+ 			*ecmd = '\0';
X+ 
X+ 		if ( (p = rindex(command, '/')) != 0 )
X+ 			command = p + 1;
X+ 
X+ 		if ( ecmd != 0 )
X+ 			*ecmd = ' ';
X+ 	}
X+ 
X+ 	/* Time (now).
X+ 	 */
X+ 	strcpy(tbuf, nows);
X+ 	tbuf[16] = '\0';
X+ 	logtime = &tbuf[4];
X+ 
X  	cmask = umask(0);
X***************
X*** 313,314 ****
X--- 347,363 ----
X  		(void) strcpy(hostname, HOSTNAME);
X+ #endif
X+ #ifdef HOSTFILE
X+ 	if (!*hostname) {
X+ 		FILE *fp;
X+ 		char *p;
X+ 
X+ 		if ((fp = fopen(HOSTFILE, "r")) != NULL) {
X+ 			if (fgets(hostname, SMLBUF - 1, fp) != NULL
X+ 			 && (p = index(hostname, '\n')) != NULL)
X+ 				*p = '\0';
X+ 			else
X+ 				*hostname = '\0';
X+ 			fclose(fp);
X+ 		}
X+ 	}
X  #endif
XIndex: nptx.c
X*** smail2.5/nptx.c	Mon Dec 21 18:30:20 1987
X--- smail/nptx.c	Thu Sep 24 13:07:13 1987
X***************
X*** 127,129 ****
X  		(void) strcpy(nl[i], p+1);
X! 		*p = NULL;
X  	}
X--- 127,129 ----
X  		(void) strcpy(nl[i], p+1);
X! 		*p = '\0';
X  	}
X***************
X*** 164,166 ****
X  			(void) strcpy(il[ii], pi+1);
X! 			*pi = NULL;
X  		}
X--- 164,166 ----
X  			(void) strcpy(il[ii], pi+1);
X! 			*pi = '\0';
X  		}
SHAR_EOF
if test 10980 -ne `wc -c < 'X.patches'`
then
	echo 'shar: error transmitting "X.patches" (should have been 10980 characters) '
fi
chmod 644 'X.patches'
fi  # end of overwriting check
:
echo 'shar: extracting "Makefile" (1427 characters) '
if test -f 'Makefile'
then
	echo 'shar: will not overwrite existing file "Makefile" '
else
sed 's/^X//' << \SHAR_EOF > 'Makefile'
X# Makefile for smail
X# @(#)Makefile	2.5 (smail) 9/15/87
X#
X# Modified for SCO Xenix by Chip Salzenberg <chip at ateng.UUCP>.
X# Released to Usenet on 01 Dec 1987.
X# Fixed as per comments of Chris Lewis <uunet!mnetor!spectrix!clewis>.
X#
X# With the addition of the `xenix' pseudo-target, this makefile now makes
X# both smail and execm by default.
X#
X# Use the `install_smail' script to install the resulting binaries.
X
XCFLAGS	= -O
XLDFLAGS = -i
XSHELL	= /bin/sh
XCOPY    = copy -om
X
X#
X# System V Release 2.0 sites can use -lmalloc for a faster malloc
X#
X#LIBS	=	-lmalloc
X
XOBJECTS =	main.o map.o resolve.o deliver.o misc.o alias.o pw.o headers.o getpath.o str.o getopt.o
X
Xxenix:  smail execm
Xall:    smail svbinmail lcasep pathproc mkfnames nptx execm
X
Xsmail:		$(OBJECTS)
X		$(CC) $(LDFLAGS) -F 4000 $(OBJECTS) -o smail $(LIBS)
X
X$(OBJECTS):	defs.h
X		$(CC) $(CFLAGS) -c $<
X
Xexecm:          execm.c
X		$(CC) $(CFLAGS) $(LDFLAGS) execm.c -o execm
X
Xsvbinmail:	svbinmail.c defs.h
X		$(CC) $(CFLAGS) $(LDFLAGS) svbinmail.c -o svbinmail
X
Xlcasep:		lcasep.c
X		$(CC) $(CFLAGS) $(LDFLAGS) lcasep.c -o lcasep
X
Xpathproc:	pathproc.sh
X		$(COPY) pathproc.sh pathproc
X		chmod 755 pathproc
X
Xmkfnames:	mkfnames.sh
X		$(COPY) mkfnames.sh mkfnames
X		chmod 755 mkfnames
X
Xnptx:		nptx.o pw.o str.o
X		$(CC) $(CFLAGS) nptx.o pw.o str.o -o nptx $(LIBS)
X
Xclean:
X		rm -f *.o *.ln a.out core
X
Xclobber:	clean
X		rm -f smail rmail lcasep pathproc mkfnames svbinmail nptx execm
SHAR_EOF
if test 1427 -ne `wc -c < 'Makefile'`
then
	echo 'shar: error transmitting "Makefile" (should have been 1427 characters) '
fi
chmod 644 'Makefile'
fi  # end of overwriting check
:
echo 'shar: extracting "execm.c" (747 characters) '
if test -f 'execm.c'
then
	echo 'shar: will not overwrite existing file "execm.c" '
else
sed 's/^X//' << \SHAR_EOF > 'execm.c'
X/*
X * execm.c
X *
X * This program is a substitute for Xenix's /usr/lib/mail/execmail.
X *
X * Written by Chip Salzenberg (chip at ateng.UUCP).
X * Released to Usenet on 01 Dec 1987.
X *
X * Do what you want with it; I'm not responsible for lost mail,
X * but I don't expect that this little program will lose anything.
X */
X
X#include <stdio.h>
X
Xmain(argc, argv)
Xint     argc;
Xchar    **argv;
X{
X	char *progname = argv[0];
X
X	/*
X	 * Drop the execmail options.
X	 */
X	while (argv[1][0] == '-')
X	{
X		switch (argv[1][1])
X		{
X		case 'f':
X		case 'h':
X			argv += 2;
X			break;
X		default:
X			++argv;
X			break;
X		}
X	}
X
X	argv[0] = progname;
X	execv("/usr/bin/smail", argv);
X	execv("/bin/smail", argv);
X
X	fprintf(stderr, "%s: can't execute smail!\n", progname);
X	exit(1);
X}
SHAR_EOF
if test 747 -ne `wc -c < 'execm.c'`
then
	echo 'shar: error transmitting "execm.c" (should have been 747 characters) '
fi
chmod 644 'execm.c'
fi  # end of overwriting check
:
echo 'shar: extracting "install_smail" (1137 characters) '
if test -f 'install_smail'
then
	echo 'shar: will not overwrite existing file "install_smail" '
else
sed 's/^X//' << \SHAR_EOF > 'install_smail'
X: install_smail
X# Shell script to install smail in a Xenix System V system.
X#
X# Written by Chip Salzenberg (chip at ateng.UUCP).
X# Released to Usenet on 01 Dec 1987.
X#
X# Note that this script renames the standard Xenix rmail and execmail
X# programs to rmail.x and execmail.x respectively.  If those `.x' files
X# already exist, then no renaming takes place, so you can run this script
X# more than once without losing those renamed programs.
X#
X# BTW, be sure to test everything thoroughly; a broken mail system is
X# sure to upset any users on your system.
X
XCOPY="copy -m"
XSMAIL="/usr/bin/smail"
XRMAIL="/usr/bin/rmail"
XEXECM="/usr/lib/mail/execmail"
X
Xfor f in smail execm
Xdo
X    if [ ! -x $f ]; then
X	echo "You need to compile $f first."
X	exit 1
X    fi
Xdone
X
Xecho "Installing current smail -- you have 5 seconds to abort."
Xsleep 5
X
Xif [ ! -f $RMAIL.x ]; then
X    mv $RMAIL $RMAIL.x
Xfi
Xrm -f $RMAIL
Xif [ ! -f $EXECM.x ]; then
X    mv $EXECM $EXECM.x
Xfi
Xrm -f $EXECM
X
X$COPY execm $EXECM
Xchown bin $EXECM
Xchgrp bin $EXECM
Xchmod 755 $EXECM
X
Xrm -f $SMAIL $RMAIL
X$COPY smail $SMAIL
Xchown bin $SMAIL
Xchgrp bin $SMAIL
Xchmod 755 $SMAIL
Xln $SMAIL $RMAIL
SHAR_EOF
if test 1137 -ne `wc -c < 'install_smail'`
then
	echo 'shar: error transmitting "install_smail" (should have been 1137 characters) '
fi
chmod 755 'install_smail'
fi  # end of overwriting check
#	End of shell archive
exit 0



More information about the Comp.sources.misc mailing list