[comp.mail.elm] Elm 2.1 PL1 Part 19 of 22

syd@dsinc.UUCP (Syd Weinstein) (12/14/88)

---- Cut Here and unpack ----
#!/bin/sh
# this is part 19 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file src/sort.c continued
#
CurArch=19
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
echo "x - Continuing file src/sort.c"
sed 's/^X//' << 'SHAR_EOF' >> src/sort.c
X	    "re:" prefix.  specifically, it looks for, and will
X	    remove, any of the pattern:
X
X		( [Rr][Ee][^:]:[ ] ) *
X
X	    If it doesn't find a ':' in the line it will return it
X	    intact, just in case!
X	**/
X
X	static char buffer[SLEN];
X	register int i=0;
X
X	while (whitespace(string[i])) i++;
X
X	do {
X	  if (string[i] == '\0') return( (char *) string);	/* forget it */
X
X	  if (string[i] != 'r' || string[i+1] != 'e') 
X	    return( (char *) string);				/*   ditto   */
X
X	  i += 2;	/* skip the "re" */
X
X	  while (string[i] != ':') 
X	    if (string[i] == '\0')
X	      return( (char *) string);		      /* no colon in string! */
X	    else
X	      i++;
X
X	  /* now we've gotten to the colon, skip to the next non-whitespace  */
X
X	  i++;	/* past the colon */
X
X	  while (whitespace(string[i])) i++;
X
X	} while (string[i] == 'r' && string[i+1] == 'e');
X 
X	/* and now copy it into the buffer and sent it along... */
X
X	strcpy(buffer, (char *) string + i);
X
X	return( (char *) buffer);
X}
SHAR_EOF
echo "File src/sort.c is complete"
chmod 0444 src/sort.c || echo "restore of src/sort.c fails"
echo "x - extracting src/string2.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > src/string2.c &&
X
Xstatic char rcsid[] = "@(#)$Id: string2.c,v 2.1 88/07/21 09:59:43 edc Exp $";
X
X/*******************************************************************************
X *  The Elm Mail System  -  $Revision: 2.1 $   $State: Exp $
X *
X * 			Copyright (c) 1986 Dave Taylor
X *******************************************************************************
X * Bug reports, patches, comments, suggetions should be sent to:
X *
X *	Syd Weinstein, Elm Corrdinator
X *	syd@dsinc.UUCP			dsinc!syd
X *
X *******************************************************************************
X * $Log:	string2.c,v $
X * Revision 2.1  88/07/21  09:59:43  edc
X * checked in with -k by syd at 88.09.15.20.29.55.
X * 
X * Revision 2.1  88/07/21  09:59:43  edc
X * Final hacks and cleanup to the 2.1 alpha test release.
X * 
X * Revision 2.0  88/06/27  17:25:42  edc
X * The original 2.0 gamma sources as leaked from HP
X * 
X *
X *
X ******************************************************************************/
X
X/** This file contains string functions that are shared throughout the
X    various ELM utilities...
X
X**/
X
X#ifndef TRUE
X#define TRUE		1
X#define FALSE		0
X#endif
X
X#define whitespace(c)		(c == ' ' || c == '\t')
X
Xint 
Xin_string(buffer, pattern)
Xchar *buffer, *pattern;
X{
X	/** Returns TRUE iff pattern occurs IN IT'S ENTIRETY in buffer. **/ 
X
X	register int i = 0, j = 0;
X	
X	while (buffer[i] != '\0') {
X	  while (buffer[i++] == pattern[j++]) 
X	    if (pattern[j] == '\0') 
X	      return(TRUE);
X	  i = i - j + 1;
X	  j = 0;
X	}
X	return(FALSE);
X}
X
Xint
Xchloc(string, ch)
Xchar *string, ch;
X{
X	/** returns the index of ch in string, or -1 if not in string **/
X	register int i;
X
X	for (i=0; i<strlen(string); i++)
X	  if (string[i] == ch) return(i);
X	return(-1);
X}
X
Xint
Xoccurances_of(ch, string)
Xchar ch, *string;
X{
X	/** returns the number of occurances of 'ch' in string 'string' **/
X
X	register int count = 0, i;
X
X	for (i=0; i<strlen(string); i++)
X	  if (string[i] == ch) count++;
X
X	return(count);
X}
X
Xremove_possible_trailing_spaces(string)
Xchar *string;
X{
X	/** an incredibly simple routine that will read backwards through
X	    a string and remove all trailing whitespace.
X	**/
X
X	register int i;
X
X	for (i=strlen(string)-1; whitespace(string[i]); i--)
X		/** spin backwards **/
X
X	string[i+1] = '\0';	/* note that even in the worst case when there
X				   are no trailing spaces at all, we'll simply
X				   end up replacing the existing '\0' with
X				   another one!  No worries, as M.G. would say
X				*/
X}
SHAR_EOF
chmod 0444 src/string2.c || echo "restore of src/string2.c fails"
echo "x - extracting src/strings.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > src/strings.c &&
X
Xstatic char rcsid[] = "@(#)$Id: strings.c,v 2.1 88/09/15 20:29:57 syd Exp $";
X
X/*******************************************************************************
X *  The Elm Mail System  -  $Revision: 2.1 $   $State: Exp $
X *
X * 			Copyright (c) 1985 Dave Taylor
X *******************************************************************************
X * Bug reports, patches, comments, suggetions should be sent to:
X *
X *	Syd Weinstein, Elm Corrdinator
X *	syd@dsinc.UUCP			dsinc!syd
X *
X *******************************************************************************
X * $Log:	strings.c,v $
X * Revision 2.1  88/09/15  20:29:57  syd
X * checked in with -k by syd at 88.09.15.20.29.57.
X * 
X * Revision 2.1  88/07/21  09:59:48  edc
X * 88/09/12 Chip Rosenthal <chip@vector>
X * couple of additional toupper()/tolower() side effect instances.
X *
X * Final hacks and cleanup to the 2.1 alpha test release.
X * 
X * Revision 2.0  88/06/27  17:25:42  edc
X * The original 2.0 gamma sources as leaked from HP
X * 
X *
X *
X ******************************************************************************/
X
X/** This file contains all the string oriented functions for the
X    ELM Mailer, and lots of other generally useful string functions! 
X
X    For BSD systems, this file also includes the function "tolower"
X    to translate the given character from upper case to lower case.
X
X**/
X
X#include <stdio.h>
X#include "headers.h"
X#include <ctype.h>
X
X#ifdef BSD
X#undef tolower
X#undef toupper
X#endif
X
X/** forward declarations **/
X
Xchar *format_long(), *strip_commas(), *tail_of_string(), *shift_lower(),
X     *get_token(), *strip_parens(), *argv_zero(), *strcpy(), *strncpy();
X
X#ifdef BSD
X
Xint
Xtolower(ch)
Xchar ch;
X{
X	/** This should be a macro call, but if you use this as a macro
X	    calls to 'tolower' where the argument is a function call will
X	    cause the function to be called TWICE which is obviously the
X	    wrong behaviour.  On the other hand, to just blindly translate
X	    assuming the character is always uppercase can cause BIG
X	    problems, so...
X	**/
X
X	return ( isupper(ch) ? ch - 'A' + 'a' : ch );
X}
X
Xint
Xtoupper(ch)
Xchar ch;
X{
X	/** see comment for above routine - tolower() **/
X
X	return ( islower(ch) ? ch - 'a' + 'A' : ch );
X}
X
X#endif
X
Xint
Xprintable_chars(string)
Xchar *string;
X{
X	/** Returns the number of "printable" (ie non-control) characters
X	    in the given string... Modified 4/86 to know about TAB
X	    characters being every eight characters... **/
X
X	register int count = 0;
X	char     c, *pend, *p;
X
X	for (pend = string + strlen(string), p=string; p < pend ;) {
X	  if ((c = *p++) >= ' ')
X	    if (c == '\t')
X	      count += (7-(count % 8));
X	    else
X	      count++;
X	}
X
X	return(count);
X}
X
Xcopy_sans_escape(dest, source, len)
Xchar *dest, *source;
Xint  len;
X{
X	/** this performs the same function that strncpy() does, but
X	    also will translate any escape character to a printable
X	    format (e.g. ^(char value + 32))
X	**/
X
X	register int i = 0, j = 0;
X
X	while (i < len && source[i] != '\0') {
X	  if (source[i] < ' ' && source[i] != '\t') {
X	     dest[j++] = '^';
X	     dest[j++] = source[i++] + 'A' - 1;
X	  }
X	  else
X	    dest[j++] = source[i++];
X	}
X
X	dest[j] = '\0';
X}
X
Xtail_of(from, buffer, header_line)
Xchar *from, *buffer;
Xint   header_line;
X{
X	/** Return last two words of 'from'.  This is to allow
X	    painless display of long return addresses as simply the
X	    machine!username.  Alternatively, if the first three
X	    characters of the 'from' address are 'To:' and 'header_line'
X	    is TRUE, then return the buffer value prepended with 'To '. 
X
X	    Mangled to know about the PREFER_UUCP hack.  6/86
X
X	    Also modified to know about X.400 addresses (sigh) and
X	    that when we ask for the tail of an address similar to
X	    a%b@c we want to get back a@b ...
X	**/
X
X	/** Note: '!' delimits Usenet nodes, '@' delimits ARPA nodes,
X	          ':' delimits CSNet & Bitnet nodes, '%' delimits multi-
X		  stage ARPA hops, and '/' delimits X.400 addresses...
X	          (it is fortunate that the ASCII character set only has
X	   	  so many metacharacters, as I think we're probably using
X		  them all!!) **/
X
X	register int loc, i = 0, cnt = 0;
X	char     tempbuffer[SLEN];
X	
X#ifdef PREFER_UUCP
X	
X	/** let's see if we have an address appropriate for hacking: 
X	    what this actually does is remove the spuriously added
X	    local BOGUS_INTERNET header if we have one and the message
X	    has some sort of UUCP component too...
X	**/
X
X	if (chloc(from,'!') != -1 && in_string(from, BOGUS_INTERNET))
X	   from[strlen(from)-strlen(BOGUS_INTERNET)] = '\0';
X
X#endif
X
X	for (loc = strlen(from)-1; loc >= 0 && cnt < 2; loc--) {
X	  if (from[loc] == BANG || from[loc] == AT_SIGN ||
X	      from[loc] == COLON) cnt++;
X	  if (cnt < 2) buffer[i++] = from[loc];
X	}
X
X	buffer[i] = '\0';
X
X	reverse(buffer);
X
X	if ((strncmp(from, "To:", 3) == 0) && header_line) {
X	  if (strncmp(buffer, "To: ", 3) == 0)
X	    sprintf(tempbuffer,"To %s", (char *) buffer + 3); 
X	  else
X	    sprintf(tempbuffer,"To %s", buffer); 
X	  strcpy(buffer, tempbuffer);
X	}
X	else if (strncmp(buffer, "To:", 3) == 0) {
X	  for (i=3; i < strlen(buffer); i++)
X	    tempbuffer[i-3] = buffer[i];
X	  tempbuffer[i-3] = '\0';
X	  strcpy(buffer, tempbuffer);
X	}
X	else {					/* user%host@host? */
X
X	  /** The logic here is that we're going to use 'loc' as a handy
X	      flag to indicate if we've hit a '%' or not.  If we have,
X	      we'll rewrite it as an '@' sign and then when we hit the
X	      REAL at sign (we must have one) we'll simply replace it
X	      with a NULL character, thereby ending the string there.
X	  **/
X
X	  loc = 0;
X
X	  for (i=0; buffer[i] != '\0'; i++)
X	    if (buffer[i] == '%') {
X	      buffer[i] = AT_SIGN;
X	      loc++;
X	    }
X	    else if (buffer[i] == AT_SIGN && loc)
X	      buffer[i] = '\0';
X	}
X
X}
X
Xchar *format_long(inbuff, init_len)
Xchar *inbuff;
Xint   init_len;
X{
X	/** Return buffer with \n\t sequences added at each point where it 
X	    would be more than 80 chars long.  It only allows the breaks at 
X	    legal points (ie commas followed by white spaces).  init-len is 
X	    the characters already on the first line...  Changed so that if 
X            this is called while mailing without the overhead of "elm", it'll 
X            include "\r\n\t" instead.
X	    Changed to use ',' as a separator and to REPLACE it after it's
X	    found in the output stream...
X	**/
X
X	static char ret_buffer[VERY_LONG_STRING];
X	register int index = 0, current_length = 0, depth=15, i;
X	char     buffer[VERY_LONG_STRING];
X	char     *word, *bufptr;
X
X	strcpy(buffer, inbuff);
X
X	bufptr = (char *) buffer;
X
X	current_length = init_len + 2;	/* for luck */
X
X	while ((word = get_token(bufptr,",", depth)) != NULL) {
X
X	    /* first, decide what sort of separator we need, if any... */
X
X	  if (strlen(word) + current_length > 80) {
X	    if (index > 0) {
X	      ret_buffer[index++] = ',';	/* close 'er up, doctor! */
X	      ret_buffer[index++] = '\n';
X	      ret_buffer[index++] = '\t';
X	    }
X	    
X	    /* now add this pup! */
X
X	    for (i=(word[0] == ' '? 1:0); i<strlen(word); i++)
X	      ret_buffer[index++] = word[i];
X	    current_length = strlen(word) + 8;	/* 8 = TAB */
X	  }
X
X	  else {	/* just add this address to the list.. */
X
X	    if (index > 0) {
X	      ret_buffer[index++] = ',';	/* comma added! */
X	      ret_buffer[index++] = ' ';
X	      current_length += 2;
X	    }
X	    for (i=(word[0] == ' '? 1:0); i<strlen(word); i++)
X	      ret_buffer[index++] = word[i];
X	    current_length += strlen(word);
X	  }
X	
X	  bufptr = NULL;
X	}
X	
X	ret_buffer[index] = '\0';
X
X	return( (char *) ret_buffer);
X}
X
Xchar *strip_commas(string)
Xchar *string;
X{
X	/** return string with all commas changed to spaces.  This IS
X	    destructive and will permanently change the input string.. **/
X
X	register int i;
X
X	for (i=0; i < strlen(string); i++)
X	  if (string[i] == COMMA)
X	    string[i] = SPACE;
X
X	return( (char *) string);
X}
X
Xchar *strip_parens(string)
Xchar *string;
X{
X	/** Return string with all parenthesized information removed.
X	    This is a non-destructive algorithm... **/
X
X	static char  buffer[VERY_LONG_STRING];
X	register int i, depth = 0, buffer_index = 0;
X
X	for (i=0; i < strlen(string); i++) {
X	  if (string[i] == '(')
X	    depth++;
X	  else if (string[i] == ')') 
X	    depth--;
X	  else if (depth == 0)
X	    buffer[buffer_index++] = string[i];
X	}
X	
X	buffer[buffer_index] = '\0';
X
X	return( (char *) buffer);
X}
X
Xmove_left(string, chars)
Xchar string[];
Xint  chars;
X{
X	/** moves string chars characters to the left DESTRUCTIVELY **/
X
X	register int i;
X
X	/*  chars--; /* index starting at zero! */
X
X	for (i=chars; string[i] != '\0' && string[i] != '\n'; i++)
X	  string[i-chars] = string[i];
X
X	string[i-chars] = '\0';
X}
X
Xremove_first_word(string)
Xchar *string;
X{	/** removes first word of string, ie up to first non-white space
X	    following a white space! **/
X
X	register int loc;
X
X	for (loc = 0; string[loc] != ' ' && string[loc] != '\0'; loc++) 
X	    ;
X
X	while (string[loc] == ' ' || string[loc] == '\t')
X	  loc++;
X	
X	move_left(string, loc);
X}
X
Xsplit_word(buffer, first, rest)
Xchar *buffer, *first, *rest;
X{
X	/** Rip the buffer into first word and rest of word, translating it
X	    all to lower case as we go along..
X	**/
X
X	register int i, j = 0;
X
X	/** skip leading white space, just in case.. **/
X
X	for (i=0; whitespace(buffer[i]); i++)	;
X
X	/** now copy into 'first' until we hit white space or EOLN **/
X
X	for (j=0; i < strlen(buffer) && ! whitespace(buffer[i]); ++i)
X	  first[j++] = tolower(buffer[i]);
X
X	first[j] = '\0';
X	
X	while (whitespace(buffer[i])) i++;
X
X	for (j=0; i < strlen(buffer); i++)
X	  rest[j++] = tolower(buffer[i]);
X
X	rest[j] = '\0';
X
X	return;
X}
X
Xchar *tail_of_string(string, maxchars)
Xchar *string;
Xint  maxchars;
X{
X	/** Return a string that is the last 'maxchars' characters of the
X	    given string.  This is only used if the first word of the string
X	    is longer than maxchars, else it will return what is given to
X	    it... 
X	**/
X
X	static char buffer[SLEN];
X	register int index, i;
X
X	for (index=0;! whitespace(string[index]) && index < strlen(string); 
X	     index++)
X	  ;
X
X	if (index < maxchars) {
X	  strncpy(buffer, string, maxchars-2);	/* word too short */
X	  buffer[maxchars-2] = '.';
X	  buffer[maxchars-1] = '.';
X	  buffer[maxchars]   = '.';
X	  buffer[maxchars+1] = '\0';
X	} 
X	else {
X	  i = maxchars;
X	  buffer[i--] = '\0';
X	  while (i > 1) 
X	    buffer[i--] = string[index--];
X	  buffer[2] = '.';
X	  buffer[1] = '.';
X	  buffer[0] = '.';
X	}
X
X	return( (char *) buffer);
X}
X
Xreverse(string)
Xchar *string;
X{
X	/** reverse string... pretty trivial routine, actually! **/
X
X	char buffer[SLEN];
X	register int i, j = 0;
X
X	for (i = strlen(string)-1; i >= 0; i--)
X	  buffer[j++] = string[i];
X
X	buffer[j] = '\0';
X
X	strcpy(string, buffer);
X}
X
Xint
Xget_word(buffer, start, word)
Xchar *buffer, *word;
Xint start;
X{
X	/**	return next word in buffer, starting at 'start'.
X		delimiter is space or end-of-line.  Returns the
X		location of the next word, or -1 if returning
X		the last word in the buffer.  -2 indicates empty
X		buffer!  **/
X
X	register int loc = 0;
X
X	while (buffer[start] == ' ' && buffer[start] != '\0')
X	  start++;
X
X	if (buffer[start] == '\0') return(-2);	 /* nothing IN buffer! */
X
X	while (buffer[start] != ' ' && buffer[start] != '\0')
X	  word[loc++] = buffer[start++];
X
X	word[loc] = '\0';
X	return(start);
X}
X
Xchar *shift_lower(string)
Xchar *string;
X{
X	/** return 'string' shifted to lower case.  Do NOT touch the
X	    actual string handed to us! **/
X
X	static char buffer[LONG_SLEN];
X	register int i;
X
X	for (i=0; i < strlen(string); i++)
X	  if (isupper(string[i]))
X	    buffer[i] = tolower(string[i]);
X	  else
X	    buffer[i] = string[i];
X	
X	buffer[strlen(string)] = 0;
X	
X	return( (char *) buffer);
X}
X
XCenterline(line, string)
Xint line;
Xchar *string;
X{
X	/** Output 'string' on the given line, centered. **/
X
X	register int length, col;
X
X	length = strlen(string);
X
X	if (length > COLUMNS)
X	  col = 0;
X	else
X	  col = (COLUMNS - length) / 2;
X
X	PutLine0(line, col, string);
X}
X
Xchar *argv_zero(string)
Xchar *string;
X{
X	/** given a string of the form "/something/name" return a
X	    string of the form "name"... **/
X
X	static char buffer[NLEN];
X	register int i, j=0;
X
X	for (i=strlen(string)-1; string[i] != '/'; i--)
X	  buffer[j++] = string[i];
X	buffer[j] = '\0';
X
X	reverse(buffer);
X
X	return( (char *) buffer);
X}
X
X#define MAX_RECURSION		20		/* up to 20 deep recursion */
X
Xchar *get_token(source, keys, depth)
Xchar *source, *keys;
Xint   depth;
X{
X	/** This function is similar to strtok() (see "opt_utils")
X	    but allows nesting of calls via pointers... 
X	**/
X
X	register int  last_ch;
X	static   char *buffers[MAX_RECURSION];
X	char     *return_value, *sourceptr;
X
X	if (depth > MAX_RECURSION) {
X	   error1("get_token calls nested greater than %d deep!", 
X		  MAX_RECURSION);
X	   emergency_exit();
X	}
X
X	if (source != NULL)
X	  buffers[depth] = source;
X	
X	sourceptr = buffers[depth];
X	
X	if (*sourceptr == '\0') 
X	  return(NULL);		/* we hit end-of-string last time!? */
X
X	sourceptr += strspn(sourceptr, keys);	  /* skip the bad.. */
X	
X	if (*sourceptr == '\0') {
X	  buffers[depth] = sourceptr;
X	  return(NULL);			/* we've hit end-of-string   */
X	}
X
X	last_ch = strcspn(sourceptr, keys);   /* end of good stuff   */
X
X	return_value = sourceptr;	      /* and get the ret     */
X
X	sourceptr += last_ch;		      /* ...value            */
X
X	if (*sourceptr != '\0')		/** don't forget if we're at end! **/
X	  sourceptr++;			      
X	
X	return_value[last_ch] = '\0';	      /* ..ending right      */
X
X	buffers[depth] = sourceptr;	      /* save this, mate!    */
X
X	return((char *) return_value);	     /* and we're outta here! */
X}
SHAR_EOF
chmod 0444 src/strings.c || echo "restore of src/strings.c fails"
echo "x - extracting src/syscall.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > src/syscall.c &&
X
Xstatic char rcsid[] = "@(#)$Id: syscall.c,v 2.1 88/09/15 20:30:00 syd Exp $";
X
X/*******************************************************************************
X *  The Elm Mail System  -  $Revision: 2.1 $   $State: Exp $
X *
X * 			Copyright (c) 1986 Dave Taylor
X *******************************************************************************
X * Bug reports, patches, comments, suggetions should be sent to:
X *
X *	Syd Weinstein, Elm Corrdinator
X *	syd@dsinc.UUCP			dsinc!syd
X *
X *******************************************************************************
X * $Log:	syscall.c,v $
X * Revision 2.1  88/09/15  20:30:00  syd
X * checked in with -k by syd at 88.09.15.20.30.01.
X * 
X * 88/09/05 killer!tness7!mechjgh (Greg Hackney)
X *	 Fix interrupt on shell escapes
X *
X * 88/08/27 ssw
X *	add deluth patches
X *
X * Revision 2.1  88/07/21  09:59:52  edc
X * Final hacks and cleanup to the 2.1 alpha test release.
X * 
X * Revision 2.0  88/06/27  17:25:44  edc
X * The original 2.0 gamma sources as leaked from HP
X * 
X *
X *
X ******************************************************************************/
X
X/** These routines are used for user-level system calls, including the
X    '!' command and the '|' commands...
X
X**/
X
X#include "headers.h"
X
X#include <signal.h>
X
X#ifdef BSD
X#  include <sys/wait.h>
X#endif
X
Xchar *argv_zero();	
Xvoid  _exit();
X
Xint
Xsubshell()
X{
X	/** spawn a subshell with either the specified command
X	    returns non-zero if screen rewrite needed
X	**/
X
X	char command[SLEN];
X	int  ret;
X	int  old_raw;
X
X	register int (*istat)();
X	
X	PutLine0(LINES-3,COLUMNS-40,"(use the shell name for a shell)");
X	PutLine0(LINES-2,0,"Shell Command: ");
X	command[0] = '\0';
X	(void) optionally_enter(command, LINES-2, 15, FALSE);
X	if (strlen(command) == 0) {
X	  MoveCursor(LINES-2,0);	CleartoEOLN();
X	  return(0);
X	}
X
X	MoveCursor(LINES,0); 	CleartoEOLN();
X	if (( old_raw = RawState()) == ON)
X	  Raw(OFF);
X	if (cursor_control)  transmit_functions(OFF);
X	
X	istat = signal(SIGINT,SIG_DFL);
X	
X	ret = system_call(command, USER_SHELL);
X
X	istat = signal(SIGINT,istat);
X	
X	PutLine0(LINES, 0, "\n\nPress <return> to return to ELM: ");
X
X	if (old_raw == ON)
X	  Raw(ON);
X	(void) getchar();
X	if (cursor_control)  transmit_functions(ON);
X
X	if (ret != 0) error1("Return code was %d", ret);
X	return(1);
X}
X
Xsystem_call(string, shell_type)
Xchar *string;
Xint   shell_type;
X{
X	/** execute 'string', setting uid to userid... **/
X	/** if shell-type is "SH" /bin/sh is used regardless of the 
X	    users shell setting.  Otherwise, "USER_SHELL" is sent **/
X
X	int stat = 0, pid, w;
X#ifdef BSD
X	union wait status;
X#else
X	int status;
X#endif
X	register int (*istat)(), (*qstat)();
X	
X	dprint(2, (debugfile,
X		"System Call: %s\n\t%s\n", shell_type == SH? "/bin/sh" : shell,
X		string));
X
X#ifdef NO_VM		/* machine without virtual memory! */
X	if ((pid = fork()) == 0) {
X#else
X	if ((pid = vfork()) == 0) {
X#endif
X	  setgid(groupid);	/* and group id		    */
X	  setuid(userid);	/* back to the normal user! */
X
X	  (void) signal(SIGHUP, SIG_IGN);	/* kids should ignore this */
X
X	  if (strlen(shell) > 0 && shell_type == USER_SHELL) {
X	    execl(shell, argv_zero(shell), "-c", string, (char *) 0);
X	  }
X	  else 
X	    execl("/bin/sh", "sh", "-c", string, (char *) 0);
X	  _exit(127);
X	}
X
X	istat = signal(SIGINT, SIG_IGN);
X	qstat = signal(SIGQUIT, SIG_IGN);
X
X	while ((w = wait(&status)) != pid && w != -1)
X		;
X
X#ifdef BSD
X	if (status.w_retcode != 0) stat = status.w_retcode;
X#else
X	if (w == -1) stat = status;
X#endif
X	
X	signal(SIGINT, istat);
X	signal(SIGQUIT, qstat);
X
X	return(stat);
X}
X
Xint
Xdo_pipe()
X{
X	/** pipe the tagged messages to the specified sequence.. **/
X
X	char command[SLEN], buffer[LONG_SLEN], message_list[SLEN];
X	register int  ret, tagged = 0, i;
X	int	old_raw;
X
X	message_list[0] = '\0';	/* NULL string to start... */
X
X	for (i=0; i < message_count; i++)
X	  if (ison(header_table[i].status, TAGGED)) {
X	    sprintf(message_list,"%s %d", message_list, 
X		    header_table[i].index_number);
X	    tagged++;
X	  }
X
X	if (tagged > 1)
X	  PutLine0(LINES-2,0,"Pipe tagged msgs to: ");
X	else if (tagged) 
X	  PutLine0(LINES-2,0,"Pipe tagged msg to : ");
X	else {
X	  PutLine0(LINES-2,0,"Pipe current msg to: ");
X	  sprintf(message_list,"%d", header_table[current-1].index_number);
X	}
X
X	command[0] = '\0';
X
X	(void) optionally_enter(command, LINES-2, 21, FALSE);
X	if (strlen(command) == 0) {
X	  MoveCursor(LINES-2,0);	CleartoEOLN();
X	  return(0);
X	}
X
X	MoveCursor(LINES,0); 	CleartoEOLN();
X	if (( old_raw = RawState()) == ON)
X	  Raw(OFF);
X
X	if (cursor_control)  transmit_functions(OFF);
X	
X	sprintf(buffer, "%s -f %s -h %s | %s",
X		readmsg,
X		infile,
X		message_list,
X		command);
X	
X	ret = system_call(buffer, USER_SHELL);
X
X	PutLine0(LINES, 0, "\n\nPress <return> to return to ELM: ");
X	if (old_raw == ON)
X	   Raw(ON);
X	(void) getchar();
X	if (cursor_control)  transmit_functions(ON);
X
X	if (ret != 0) error1("Return code was %d", ret);
X	return(1);
X}
X
Xprint_msg()
X{
X	/** Print current message or tagged messages using 'printout' 
X	    variable.  Error message iff printout not defined! **/
X
X	char buffer[LONG_SLEN], filename[SLEN], printbuffer[LONG_SLEN];
X	char message_list[SLEN];
X	register int  retcode, tagged = 0, i;
X
X	if (strlen(printout) == 0) {
X	  error("Don't know how to print - option \"printmail\" undefined!");
X	  return;
X	}
X	
X	message_list[0] = '\0';	/* reset to null... */
X
X	for (i=0; i < message_count; i++) 
X	  if (header_table[i].status & TAGGED) {
X	    sprintf(message_list, "%s %d", message_list, 
X		    header_table[i].index_number);
X	    tagged++;
X	  }
X
X	if (! tagged)
X	  sprintf(message_list," %d", header_table[current-1].index_number);
X
X	sprintf(filename,"%s%d", temp_print, getpid());
X
X	if (in_string(printout, "%s"))
X	  sprintf(printbuffer, printout, filename);
X	else
X	  sprintf(printbuffer, "%s %s", printout, filename);
X
X	sprintf(buffer,"(%s -p -f %s%s > %s; %s 2>&1) > /dev/null",
X		readmsg, infile, message_list, 
X		filename,
X		printbuffer);
X	
X	dprint(2, (debugfile, "Printing system call...\n"));
X
X  	Centerline(LINES, "queueing...");
X
X	if ((retcode = system_call(buffer, SH)) == 0) {
X	  sprintf(buffer, "Message%s queued up to print", plural(tagged));
X	  Centerline(LINES, buffer);
X	}
X	else
X	  error1("Printout failed with return code %d", retcode);
X
X	unlink(filename);	/* remove da temp file! */
X}
X
Xlist_folders()
X{
X	/** list the folders in the users FOLDERHOME directory.  This is
X	    simply a call to "ls -C"
X	**/
X
X	char buffer[SLEN];
X
X	CleartoEOS();	/* don't leave any junk on the bottom of the screen */
X	sprintf(buffer, "cd %s;ls -C", folders);
X	printf("\n\rContents of your folder directory:\n\r\n\r");
X	system_call(buffer, SH); 
X	printf("\n\r");
X}
X
SHAR_EOF
chmod 0444 src/syscall.c || echo "restore of src/syscall.c fails"
echo "x - extracting src/utils.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > src/utils.c &&
X
Xstatic char rcsid[] = "@(#)$Id: utils.c,v 2.2 88/09/15 20:30:04 syd Exp $";
X
X/*******************************************************************************
X *  The Elm Mail System  -  $Revision: 2.2 $   $State: Exp $
X *
X * 			Copyright (c) 1985 Dave Taylor
X *******************************************************************************
X * Bug reports, patches, comments, suggetions should be sent to:
X *
X *	Syd Weinstein, Elm Corrdinator
X *	syd@dsinc.UUCP			dsinc!syd
X *
X *******************************************************************************
X * $Log:	utils.c,v $
X * Revision 2.2  88/09/15  20:30:04  syd
X * checked in with -k by syd at 88.09.15.20.30.04.
X * 
X * 14 Sep 88 Chip Rosenthal <chip@vector>
X * This file contains the patches for Elm 2.1b to run on XENIX System V.
X * The general issues with running Elm on such a machine are:
X *
X * 88/08/27 ssw
X *	add deluth patches
X *
X * Revision 2.2  88/07/21  09:59:54  edc
X * Final hacks and cleanup to the 2.1 alpha test release.
X * 
X * Revision 2.1  88/06/28  12:48:51  edc
X * Added code for systems without mkdir() call, and NOMKDIR define from
X * sysconf.h. This is sort of a kludge, since it just executes mkdir to
X * create the directory. This may not be portable to non-System V machines.
X * 					---Eric Christensen---
X * 
X * Revision 2.0  88/06/27  17:25:44  edc
X * The original 2.0 gamma sources as leaked from HP
X * 
X *
X *
X ******************************************************************************/
X
X/** Utility routines for ELM 
X
X**/
X
X#include "headers.h"
X#include <sys/types.h>
X#include <sys/stat.h>
X#include <ctype.h>
X#include <errno.h>
X
X#ifdef BSD
X#undef tolower
X#endif
X
X#include <signal.h>
X
Xextern int errno;
X
Xchar *error_name();
Xvoid   exit();
X
Xmove_old_files_to_new()
X{
X	/** this routine is just for allowing people to transition from
X	    the old Elm, where things are all kept in their $HOME dir,
X	    to the new one where everything is in $HOME/.elm... **/
X
X	char source[SLEN], dest[SLEN], temp[SLEN];
X	char com[SLEN];
X
X	/** first off, let's make the directory we need... **/
X
X	/** Some systems don't have a mkdir call - how inconvienient! **/
X
X#ifdef NOMKDIR
X	sprintf(com, "mkdir %s/.elm", home);
X	system_call(com, SH);
X	sprintf(com, "chmod 700 %s/.elm", home);
X	system_call(com, SH);
X#else
X	sprintf(source, "%s/.elm", home);
X	(void) mkdir(source, 0700);
X#endif NOMKDIR
X
X	chown( source, userid, groupid);
X
X	/** and simply go through all the files... **/
X
X	sprintf(source, "%s/.alias_text", home);
X	if (access(source, ACCESS_EXISTS) != -1) {
X	  sprintf(dest,   "%s/%s", home, ALIAS_TEXT);
X	  printf("\n\r%s   -->   %s   \t[':' changed to '=']\n", source, dest);
X	
X	  sprintf(temp, "/tmp/%d", getpid());
X	  sprintf(com, "/bin/sed -e 's/:/=/g' %s > %s\n", source, temp);
X	  (void) system_call(com, SH);
X	  sprintf(com, "/bin/mv %s %s\n", temp, dest);
X	  (void) system_call(com, SH);
X	}
X
X	sprintf(source, "%s/.alias_data", home);
X	if (access(source, ACCESS_EXISTS) != -1) {
X	  sprintf(dest,   "%s/%s", home, ALIAS_DATA);
X	  printf("%s   -->   %s\n", source, dest);
X	
X	  move(source, dest);
X	}
X
X	sprintf(source, "%s/.alias_hash", home);
X	if (access(source, ACCESS_EXISTS) != -1) {
X	  sprintf(dest,   "%s/%s", home, ALIAS_HASH);
X	  printf("%s   -->   %s\n", source, dest);
X	
X	  move(source, dest);
X	}
X
X	sprintf(source, "%s/.elmheaders", home);
X	if (access(source, ACCESS_EXISTS) != -1) {
X	  sprintf(dest,   "%s/%s", home, mailheaders);
X	  printf("%s   -->   %s\n", source, dest);
X	
X	  move(source, dest);
X	}
X
X	sprintf(source, "%s/.elmrc", home);
X	if (access(source, ACCESS_EXISTS) != -1) {
X	  sprintf(dest,   "%s/%s", home, elmrcfile);
X	  printf("%s   -->   %s\n", source, dest);
X	
X	  move(source, dest);
X	}
X
X	sprintf(source, "%s/.last_read_mail", home);
X	if (access(source, ACCESS_EXISTS) != -1) {
X	  sprintf(dest,   "%s/%s", home, mailtime_file);
X	  printf("%s   -->   %s\n", source, dest);
X	
X	  move(source, dest);
X	}
X
X	printf("\n\rWelcome to the New Elm system...\n\n\r");
X	sleep(3);
X}
X	
Xshow_mailfile_stats()
X{
X	/** when we're about to die, let's try to dump lots of good stuff
X	    to the debug file... **/
X
X	struct stat buffer;
X
X	if (debug == 0) return;		/* Damn!  Can't do it! */
X
X	if (fstat(fileno(mailfile), &buffer) == 0) {
X	  dprint(1, (debugfile, "\nDump of stats for mailfile %s;\n", infile));
X
X	  dprint(1,  (debugfile, "\tinode: %d, mode: %o, uid: %d, ",
X			buffer.st_ino, buffer.st_mode, buffer.st_uid));
X
X	  dprint(1, (debugfile, 
X		 "gid: %d, size: %d\n\n", buffer.st_gid, buffer.st_size));
X
X	  dprint(1, (debugfile, "\toffset into file = %l\n", ftell(mailfile)));
X	}
X	else
X	  dprint(1, (debugfile, 
X		 "\nfstat on mailfile '%s' failed with error %s!!\n\n",
X			infile, error_name(errno)));
X}
X	
Xemergency_exit()
X{
X	/** used in dramatic cases when we must leave without altering
X	    ANYTHING about the system... **/
X	char buffer[SLEN];
X
X	dprint(1, (debugfile, 
X     "\nERROR: Something dreadful is happening!  Taking emergency exit!!\n\n"));
X	dprint(1, (debugfile,
X	     "  possibly leaving behind the following files;\n"));
X	dprint(1, (debugfile,
X	     "     The mailbox tempfile : %s%s\n", temp_mbox, username));
X	sys_lock_file(buffer, username);
X	dprint(1, (debugfile,
X	     "     The mailbox lock file: %s\n", buffer));
X	dprint(1, (debugfile,
X	     "     The composition file : %s%d\n", temp_file, getpid()));
X	dprint(1, (debugfile,
X	     "     The header comp file : %s%d\n", temp_file, getpid()+1));
X	dprint(1, (debugfile,
X	     "     The readmsg data file: %s/%s\n", home, readmsg_file));
X
X	Raw(OFF);
X	if (cursor_control)  transmit_functions(OFF);
X	if (hp_terminal)     softkeys_off();
X
X	if (cursor_control)
X	  MoveCursor(LINES, 0);
X
X	PutLine0(LINES,0, 
X		"\nEmergency Exit taken!  All temp files intact!\n\n");
X
X	exit(1);
X}
X
X/*ARGSUSED*/
X/*VARARGS0*/
X
Xleave(val)
Xint val;	/* not used, placeholder for signal catching! */
X{
X	char buffer[SLEN];
X
X	dprint(2, (debugfile, "\nLeaving mailer normally (leave)\n"));
X
X	Raw(OFF);
X	if (cursor_control)  transmit_functions(OFF);
X	if (hp_terminal)     softkeys_off();
X
X	sprintf(buffer,"%s%d",temp_file, getpid());  /* editor buffer */
X	(void) unlink(buffer);
X
X	sprintf(buffer,"%s%d",temp_file, getpid()+1);  /* editor buffer */
X	(void) unlink(buffer);
X
X	if (mbox_specified == 0) {
X	  sprintf(buffer,"%s%s",temp_mbox, username);  /* temp mailbox */
X	  (void) unlink(buffer);
X	}
X
X	sprintf(buffer,"%s/%s", home, readmsg_file);  /* readmsg temp */
X	(void) unlink(buffer);
X
X	sys_lock_file(buffer, username);		/* lock file */
X	(void) unlink(buffer);
X
X	if (! mail_only) {
X	  MoveCursor(LINES,0);
X	  Writechar('\n');
X	}
X
X	exit(0);
X}
X
Xsilently_exit()
X{
X	/** This is the same as 'leave', but it doesn't remove any non-pid
X	    files.  It's used when we notice that we're trying to create a
X	    temp mail file and one already exists!!
X	**/
X	char buffer[SLEN];
X
X	dprint(2, (debugfile, "\nLeaving mailer quietly (silently_exit)\n"));
X
X	Raw(OFF);
X	if (cursor_control)  transmit_functions(OFF);
X	if (hp_terminal)     softkeys_off();
X
X	sprintf(buffer,"%s%d",temp_file, getpid());  /* editor buffer */
X	(void) unlink(buffer);
X
X	sprintf(buffer,"%s%d",temp_file, getpid()+1);  /* editor buffer */
X	(void) unlink(buffer);
X
X	if (! mail_only) {
X	  MoveCursor(LINES,0);
X	  Writechar('\n');
X	}
X
X	exit(0);
X}
X
X/*ARGSUSED0*/
X
Xleave_locked(val)
Xint val;	/* not used, placeholder for signal catching! */
X{
X	/** same as leave routine, but don't disturb lock file **/
X
X	char buffer[SLEN];
X
X        dprint(3, (debugfile,
X	    "\nLeaving mailer due to presence of lock file (leave_locked)\n"));
X
X	Raw(OFF);
X	if (cursor_control)  transmit_functions(OFF);
X	if (hp_terminal)     softkeys_off();
X
X	sprintf(buffer,"%s%d",temp_file, getpid());  /* editor buffer */
X	(void) unlink(buffer);
X
X	sprintf(buffer,"%s%d",temp_file, getpid()+1);  /* editor buffer */
X	(void) unlink(buffer);
X
X	sprintf(buffer,"%s%s",temp_mbox, username);  /* temp mailbox */
X	(void) unlink(buffer);
X
X	MoveCursor(LINES,0);
X	Writechar('\n');
X
X	exit(0);
X}
X
Xint
Xget_page(msg_pointer)
Xint msg_pointer;
X{
X	/** Ensure that 'current' is on the displayed page,
X	    returning non-zero iff the page changed! **/
X
X	register int first_on_page, last_on_page;
X
X	first_on_page = (header_page * headers_per_page) + 1;
X
X	last_on_page = first_on_page + headers_per_page - 1;
X
X	if (selected)	/* but what is it on the SCREEN??? */
X	  msg_pointer = compute_visible(msg_pointer-1);
X
X	if (selected && msg_pointer > selected) 
X	  return(FALSE);	/* too far - page can't change! */
X
X	if (msg_pointer > last_on_page) {
X	  header_page = (int) (msg_pointer-(selected? 0:1)) / headers_per_page;
X	  return(1);
X	}
X	else if (msg_pointer < first_on_page) {
X	  header_page = (int) (msg_pointer-1) / headers_per_page;
X	  return(1);
X	}
X	else
X	  return(0);
X}
X
Xchar *nameof(filename)
Xchar *filename;
X{
X	/** checks to see if 'filename' has any common prefixes, if
X	    so it returns a string that is the same filename, but 
X	    with '=' as the folder directory, or '~' as the home
X	    directory..
X	**/
X
X	static char buffer[STRING];
X	register int i = 0, index = 0;
X
X	if (strncmp(filename, folders, strlen(folders)) == 0) {
X	  if (strlen(folders) > 0) {
X	    buffer[i++] = '=';
X	    index = strlen(folders);
X	  }
X	}
X	else if (strncmp(filename, home, strlen(home)) == 0) {
X	  if (strlen(home) > 0) {
X	    buffer[i++] = '~';
X	    index = strlen(home);
X	  }
X	}
X	else index = 0;
X
X	while (filename[index] != '\0')
X	  buffer[i++] = filename[index++];
X	buffer[i] = '\0';
X	
X	return( (char *) buffer);
X}
SHAR_EOF
chmod 0444 src/utils.c || echo "restore of src/utils.c fails"
echo "x - extracting src/validname.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > src/validname.c &&
X
Xstatic char rcsid[] = "@(#)$Id: validname.c,v 2.1 88/07/21 09:59:57 edc Exp $";
X
X/*******************************************************************************
X *  The Elm Mail System  -  $Revision: 2.1 $   $State: Exp $
X *
X * 			Copyright (c) 1986 Dave Taylor
X *******************************************************************************
X * Bug reports, patches, comments, suggetions should be sent to:
X *
X *	Syd Weinstein, Elm Corrdinator
X *	syd@dsinc.UUCP			dsinc!syd
X *
X *******************************************************************************
X * $Log:	validname.c,v $
X * Revision 2.1  88/07/21  09:59:57  edc
X * checked in with -k by syd at 88.09.15.20.30.06.
X * 
X * Revision 2.1  88/07/21  09:59:57  edc
X * Final hacks and cleanup to the 2.1 alpha test release.
X * 
X * Revision 2.0  88/06/27  17:25:45  edc
X * The original 2.0 gamma sources as leaked from HP
X * 
X *
X *
X ******************************************************************************/
X
X/** This routine takes a single address, no machine hops or
X    anything, and returns 1 if it's valid and 0 if not.  The
X    algorithm it uses is the same one that uux uses, namely:
X
X	1. Is there a file '/usr/mail/%s'?  
X	2. Is there a password entry for %s?
X	
X**/
X
X#include "defs.h"
X
X#include <stdio.h>
X
X#ifndef NOCHECK_VALIDNAME
X#  ifdef BSD4_1
X#    include <sys/pwd.h>
X#  else
X#    include <pwd.h>
X#  endif
X#endif
X
Xint
Xvalid_name(name)
Xchar *name;
X{
X	/** does what it says above, boss! **/
X
X#ifdef NOCHECK_VALIDNAME
X
X	return(1);		/* always say it's okay! */
X
X#else
X	struct passwd *getpwnam();
X	char filebuf[SLEN];
X
X	sprintf(filebuf,"%s/%s", mailhome, name);
X	
X	if (access(filebuf, ACCESS_EXISTS) == 0)
X	  return(1);
X
X	if (getpwnam(name) != NULL)
X	  return(1);
X
X	return(0);
X
X#endif
X
X}
SHAR_EOF
chmod 0444 src/validname.c || echo "restore of src/validname.c fails"
echo "x - extracting test/test.empty (Text)"
sed 's/^X//' << 'SHAR_EOF' > test/test.empty &&
SHAR_EOF
chmod 0444 test/test.empty || echo "restore of test/test.empty fails"
echo "x - extracting test/test.mail (Text)"
sed 's/^X//' << 'SHAR_EOF' > test/test.mail &&
XFrom root Wed Oct 30 14:03:36 1985
X>From srmmail Wed Oct 30 14:10:08 1985  remote from veeger
X>From hplabs Wed Oct 30 14:00:16 1985 remote from hpcnof
X>From hpl-opus!poulton  Wed Oct 30 02:06:16 1985 remote from hplabs
XDate: Wed, 30 Oct 85 01:55:05 pst
XFrom: <hplabs!hpl-opus!poulton>
XReceived: by HP-VENUS id AA26352; Wed, 30 Oct 85 01:55:05 pst
XMessage-Id: <8510300955.AA26352@HP-VENUS>
XTo: hplabs!hpldat!taylor
XSubject: Re: announce(1)
X
XThe announce I got was shar'd July 8.   NLEN was not defined in that
Xsource, just used.  LONG_SLEN is not defined in the newmail(1)
Xthat you sent me.  What system are you running on?
XMy s500 doesn't have these def's.
X
X	-> Monday, January 3rd: Call your mother
X
XAs to announce --> newmail: why the switch?
XSeems like both are useful, in different situations.
X
XKen Poulton
XHPL
X
X
X
X
XFrom root Wed Oct 30 14:03:39 1985
X>From srmmail Wed Oct 30 14:10:12 1985  remote from veeger
X>From hplabs Wed Oct 30 13:59:53 1985 remote from hpcnof
X>From fowler  Wed Oct 30 12:57:11 1985 remote from hplabs
XDate: Wed, 30 Oct 85 12:57:11 pst
XFrom: Greg Fowler <hplabs!fowler>
XReceived: by HP-VENUS id AA12562; Wed, 30 Oct 85 12:57:11 pst
XMessage-Id: <8510302057.AA12562@HP-VENUS>
XTo: mail-men@rochester
XSubject: Re: Summary of Network Mail Headers
XReferences: <36700044@hpcnof.UUCP>
XPriority: Most Urgent
X
XI believe your introduction referred to the uucp network.  usenet is the network news
Xsoftware mechanism and isn't a "network".
X
X	- > February 19, 1986
X	-
X	-    A longer test of the system
X	-
X
X	Greg
X
X
X
XFrom root Wed Oct 30 14:13:23 1985
X>From srmmail Wed Oct 30 14:20:08 1985  remote from veeger
X>From root Wed Oct 30 14:01:57 1985 remote from hpcnof
XTo: DCC@hplabs
XSubject: Log of backup tape #1
X
X 
XFull Backup starting at Wed Oct 30 12:45:14 MST 1985
X 
X
X
Xbacking up directories: 
X	./users/fh ./users/rmd ./users/vince ./users/roberts ./users/row ./users/dt ./lost+found ./users/lost+found ./users/scb ./users/kevin ./users/du
X
X
X
X
X
XFrom root Wed Oct 30 15:33:24 1985
X>From srmmail Wed Oct 30 15:40:26 1985  remote from veeger
X>From root Wed Oct 30 15:37:17 1985 remote from hpcnof
XTo: root, uucp, taylor@hplabs.ARPA
XSubject: Log of backup tape #2
X
Xbacking up directories: 
X	./users/fh ./users/rmd ./users/vince ./users/roberts ./users/row ./users/dt ./lost+found ./users/lost+found ./users/scb ./users/kevin ./users/du
X
X
X
X
Xbacking up directories: 
X	./users/sbh ./users/ges ./users/cpb ./users/amy ./net ./users/root ./users/balza ./dev ./users/remple ./users/jr ./users/mwr ./users/larryf
X
X
X
X
X
XFrom root Sun Dec  8 22:50:18 1985
X>From srmmail Mon Dec  9 00:50:05 1985 remote from veeger
X>From root Mon Dec  9 00:41:15 1985 remote from hpcnof
X>From JLarson.pa@Xerox.ARPA  Sun Dec  8 20:45:55 1985 remote from hplabs
XDate: 8 Dec 85 20:36:36 PST (Sunday)
XFrom: hplabs!JLarson.pa@Xerox.ARPA
XSubject: How's it going, anyway?
XTo: hpcnou!dat@HPLABS.ARPA (Dave Taylor)
XCc: JLarson.pa@Xerox.ARPA
X
XHow are things with you?  Could you send me that paper we were talking
Xabout?  
X
X	Thanks
X
XJohn Larson
XXerox Palo Alto Research Center
X3333 Coyote Hill Road
XPalo Alto, Ca  94304
X
X
X
X
XFrom To:host!root@hplabs.HP.COM Wed Aug  7 19:58:30 1985
X#From uucp Wed Aug  7 19:55:12 1985  remote from veeger
X#From hplabs Wed Aug  7 19:48:10 1985 remote from hpcnof
X#From RICHER@SUMEX-AIM  Wed Aug  7 09:23:12 1985 remote from hplabs
XReceived: by HP-VENUS id AA18269; Wed, 7 Aug 85 09:11:48 pdt
XDate: Tue 6 Aug 85 09:12:37-PDT
X#From: Mark Richer <hplabs!RICHER@SUMEX-AIM>
XReceived: by HP-VENUS via CSNET; 7 Aug 1985 09:11:37-PDT (Wed)
XReceived: from sumex-aim.arpa by csnet-relay.arpa id a015812; 6 Aug 85 12:14 EDT
XTo: hpcnof!veeger!hpcnou!dat%hplabs.csnet@CSNET-RELAY
XVia:  CSNet; 7 Aug 85 9:11-PDT
XSubject: Re: AI in Education mailing list...
XCc: RICHER@SUMEX-AIM
XIn-Reply-To: <8508030243.AA27641@HP-VENUS>
XMessage-Id: <12132987812.61.RICHER@SUMEX-AIM.ARPA>
X
XI added you to aied.  This message may be of interest to you:
X
XArtificial Intelligence in Education Meeting at IJCAI 85
X---------- ------------ -- --------- ------- -- ----- --
X
XPlace: Math Sciences Auditorium (a.k.a. Math 4000A), UCLA campus
XTime: 6:30 pm, Tuesday, Aug. 20, 1985  (length: 1 - 1 1/4 hr)
X
XAgenda:
X	I have two speakers scheduled to make presentations that
Xshould stimulate questions and discussions:
X
X	(1) Short Announcements
X
X	(2) Jeff Bonar, Research Scientist, Learning Research and
X	Development Center (LRDC), University of Pittsburgh
X
X	--- on-going ICAI research projects at LRDC
X	--- dissemination of ICAI technology in the form of software
X	tools, workshops, written materials, and video tapes.
X
X	(3) Gary Fine, Product Engineering Manager, INTELLICORP,
X	formerly with a company producing CAI products, also graduate
X	work in ICAI  
X
X	--- bridging the gap between current ICAI technology and the
X	real world
X
X[IJCAI-85, the 9th International Joint Conference on Artificial
XIntelligence is being held at UCLA Campus, August 18-23, 1985.  This
Xconference is co-sponsered by the American Association for Artificial
XIntelligence (AAAI) this year, and I have been told by their office
Xthat only walk-in registration is available at this time.  For more
Xinformation, contact AAAI:  AAAI-OFFICE@SUMEX-AIM.ARPA
X			    AAAI, 445 Burgess Drive, Menlo Park, CA 94025
X			    or call (415) 328-3123]
X
XDirect questions on the AI in ED meeting (only) to Mark Richer,
XRICHER@SUMEX-AIM.ARPA
X-------
X
X
X
X
XFrom root Tue Sep 24 09:53:24 1985
X>From HPMAIL-gateway Tue Sep 24  9:46:47 1985  remote from veeger
X>From Simon_CINTZ_/_HPD600/TR  Tue Sep 24  9:46:47 1985  remote from hpmail
XDate:   Tue, 24 Sep 85  9:14:00 MDT
XFrom:   Simon_CINTZ_/_HPD600/TR  (Simon Cintz)
XSubject: ITF
XFrom:   Simon_CINTZ_/_HPD600/TR  (Simon Cintz)
XTo:     Dave_TAYLOR_/_HPF100/00
X
XDave -
X
XJust as one programming language doesn't suit the needs of
Xall programmers, one authoring facility will probably not
Xsuit the needs of all HP entities that require CBT -- at least
Xnot in the near future.  Of course, this is my personal opinion
Xand if I'm wrong, it won't be the first time.
X
XGood luck.
X
X
X                                           - Simon
X
XFrom root Mon Oct 21 10:43:37 1985
X>From srmmail Mon Oct 21 10:30:16 1985  remote from veeger
X>From root Mon Oct 21 10:28:58 1985 remote from hpcnof
X>From DLS.MDC%office-X.arpa@CSNET-RELAY  Mon Oct 21 01:57:05 1985 remote from hplabs
XReceived: by HP-VENUS id AA17376; Mon, 21 Oct 85 01:57:05 pdt
XDate: 21 Oct 85 01:02 EDT
XFrom: Duane Stone / McDonnell Douglas / CSC-ASD <hplabs!DLS.MDC%office-1.arpa@CSNET-RELAY>
XReceived: by HP-VENUS via CSNET; 21 Oct 1985 01:57:01-PDT (Mon)
XReceived: from office-1.arpa by CSNET-RELAY.ARPA id a019220; 21 Oct 85 1:18 EDT
XTo: Dave Taylor <hpcnou!dat%hplabs.csnet@CSNET-RELAY>
XVia:  CSNet; 21 Oct 85 1:56-PDT
XSubject: Re: More Mail Headers...
XMessage-Id: <MDC-DLS-7W9CS@OFFICE-1>
XComment: Dave -- this is the body of the message I previously 'sent' to you via
X
Xa Journal.
X
XI might suggest re-wording the para on Author -- my associates might object to 
X'strange' -- something like:
X
X   This is used to credit the original author, or to give credit on article 
X   excerpts (from Newspapers, magazines, books, etc).
X
XOne field which I forgot is:
X
X   Length:  This is computed when the message is sent and gives the recipients 
X   an estimate of the number of pages in the document.
X
X   Example:
X
X      Length: 6 pages [estimate]
X
XAccess:
X
X   Used to declare whether a Journal item should be Public or Private (to those
X   that are on the distribution list or Extended Access list)
X
X   Example:
X
X      Access: Unrestricted
X
XAcknowledge-Delivery:
X
X   Used to request the system mailer send back a message when it has 
X   successfully delivered the item.
X
X   Example:
X
X      Acknowledge-Delivery: Requested
X
XAcknowledge-Receipt:
X
X   Used to to ask the recipient to acknowledge receipt of the message.
X
X   Example:
X
X   Acknowledge-Receipt: Requested
X
XAddendum-To:
X
X   A pointer to a previously submitted Journal item.
X
X   Example:
X
X      Addendum-To: <ASD,1234,>
X
XDelivery-Timing:
X
X   Used by the sender to indicate when the message should be submitted to the 
X   mailer.
X
X      Examples:
X
X         Rush:       -   immediate
X
X         Soon:       -   as soon as possible
X
X         Defer:      -   overnight
X
X         Start-Delivery: DATE TIME
X
X         Stop-Delivery:  DATE TIME (if not yet delivered)
X
XDisposition-Code:
X
X   Used by the system to group Journal items into one of several classes for 
X   eventual archive to tape and as an indicator of how long the archive tapes 
X   should be retained.
X
X   Example:
X
X      Disposition-Code: Temporary (2 years)
X
XExtended-access:
X
X   Used with private Journal items to allow access by other than those on the 
X   distribution list.
X
X   Example:
X
X      Extended-access: ASD.MDC
X
XLocation:
X
X   Used to submit the message to the Journal.  The adressees receive a short 
X   citation with other header fields and a "Location:" field pointing to a file
X   in an electronic library.
X
X   Example:
X
X      Location: <MDC,1234,>
X
XPart-Of:
X
X   A pointer to a previously submitted Journal item.
X
X   Example:
X
X      Part-Of: <MDC,1234,>
X
XRoute-To:
X
X   Used to send a message "in-turn" to addressees in the "To:" field -- as 
X   opposed to the broadcast method of delivery where everyone gets the message 
X   "simultaneously".  Any addresses in the "Cc:" field receive a copy of the 
X   message each time it is passed from one adressee to the next in the "To:" 
X   field.
X
X   Example:
X
X      Routed-to: {addresses in To field}
X
XSigned:
X
X   Created when the user employs the Sign command; used to electronically sign 
X   a message.  It affixes a signature-block to a message.  A "Verify Signature"
X   command is available to recipients that lets them find out if anyone has 
X   changed the body of the message since the message was signed.
X
X   Example:
X
X          SIGNED
X      
X      Duane L. Stone
X      App. Dev. Mgr.
X
XSupersedes:
X
X   A pointer to a previously submitted Journal item.
X
X   Example:
X
X      Supersedes: <MDC,1234,>
X
X
X--- last line of the file --
SHAR_EOF
chmod 0444 test/test.mail || echo "restore of test/test.mail fails"
echo "x - extracting utils/Makefile.mt (Text)"
sed 's/^X//' << 'SHAR_EOF' > utils/Makefile.mt &&
X# @(#)$Id: Makefile.mt,v 2.1 88/09/15 21:08:39 syd Exp $
X#
X#  Makefile for the Elm system utilities
X#
X#         (C) Copyright 1986, 1987 Dave Taylor
X#
X# $Log:	Makefile.mt,v $
X# Revision 2.1  88/09/15  21:08:39  syd
X# Initial 2.1 Release
X# 
X# 14 Sep 88 Chip Rosenthal <chip@vector>
X# This file contains the patches for Elm 2.1b to run on XENIX System V.
X# The general issues with running Elm on such a machine are:
X#
X#  88/09/05 Walt
X#	added getopt to two utils for sequent
X#
X#  8/27/88 ssw
X#	moved from to frm to avoid BSD conflict
X#
XSHELL=/bin/sh
X
XDEFINE= >os-define<
XLIB2  = >lib2<
X
XCFLAGS= >cflags< -O -I../hdrs
XCC=	>cc<
XRM= 	>rm<
XECHO=  /bin/echo
X
XOBJS=	../bin/newalias ../bin/frm ../bin/newmail ../bin/answer       \
X	../bin/printmail ../bin/fastmail ../bin/readmsg                \
X	../bin/checkalias ../bin/arepdaemon ../bin/autoreply 	       \
X	../bin/messages ../bin/listalias 
X
Xall: ${OBJS}
X
X../bin/newalias:  ../hdrs/defs.h newalias.c ../src/validname.o 	       \
X	../src/opt_utils.o
X	${CC} ${CFLAGS} ${DEFINE} newalias.c ../src/validname.o \
X	../src/opt_utils.o -o ../bin/newalias 
X
X../bin/frm: from.c ../src/opt_utils.o ../src/string2.o\
X	expand.o >getopt<
X	${CC} ${CFLAGS} ${DEFINE} from.c ../src/opt_utils.o \
X	../src/string2.o >getopt< expand.o -o ../bin/frm
X
X../bin/newmail: ../src/opt_utils.c newmail.c ../src/string2.o expand.o
X	${CC} ${CFLAGS} ${DEFINE} newmail.c expand.o \
X	../src/string2.o -o ../bin/newmail
X
X../bin/listalias: listalias.c 
X	${CC} ${CFLAGS} ${DEFINE} listalias.c -o ../bin/listalias
X
X../bin/answer: answer.c ../src/opt_utils.o
X	${CC} ${CFLAGS} ${DEFINE} answer.c ../src/opt_utils.o -o ../bin/answer
X
X../bin/fastmail: fastmail.c 
X	${CC} ${CFLAGS} ${DEFINE} fastmail.c ../src/opt_utils.o \
SHAR_EOF
echo "End of part 19"
echo "File utils/Makefile.mt is continued in part 20"
echo "20" > s2_seq_.tmp
exit 0
-- 
=====================================================================
Sydney S. Weinstein, CDP, CCP                   Elm Coordinator
Datacomp Systems, Inc.				Voice: (215) 947-9900
{allegra,bellcore,bpa,vu-vlsi}!dsinc!syd	FAX:   (215) 938-0235