[comp.mail.mh] mhmail and aliases.

rickert@mp.cs.niu.edu (Neil Rickert) (01/30/91)

 Well, I decided to try mhmail in place of ucb/Mail.  Checked the man pages
for the parameters.  Type in the command, to forward a copy of a small file
to a user on another system.

 The thing blew up in my face.  It seems that it doesn't read the personal
aliases file.  Then it tried to save the message in dead.letter, and that
failed too - it seems it doesn't read the $HOME environment variable, but
just used the current directory.

 So much for mhmail.  Back to using ucb/Mail.  But what a pain.  It means I
have to keep my aliases files in two different formats - one for MH, and
another for ucb/Mail.

-- 
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  Neil W. Rickert, Computer Science               <rickert@cs.niu.edu>
  Northern Illinois Univ.
  DeKalb, IL 60115                                   +1-815-753-6940

dme@doc.ic.ac.uk (Dave Edmondson) (01/31/91)

In article <1991Jan30.152049.4879@mp.cs.niu.edu> rickert@mp.cs.niu.edu (Neil Rickert) writes:
> The thing blew up in my face.  It seems that it doesn't read the personal
> aliases file.  Then it tried to save the message in dead.letter, and that
in your mh 6.7 distribution (mh-6.7/miscellany/scripts/amhmail.sh to
be exact) is a sh front end to mhmail that does aliasing.

> failed too - it seems it doesn't read the $HOME environment variable, but
> just used the current directory.
patch at the end...

i really like mh.  keep up the good work people.

dave.

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  home-dead.letter-patch
# Wrapped by dme@mr-uppity.doc.ic.ac.uk on Thu Jan 31 11:15:45 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'home-dead.letter-patch' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'home-dead.letter-patch'\"
else
echo shar: Extracting \"'home-dead.letter-patch'\" \(1530 characters\)
sed "s/^X//" >'home-dead.letter-patch' <<'END_OF_FILE'
X*** /tmp/,RCSt1a03118	Thu Jan 31 11:15:08 1991
X--- mhmail.c	Thu Jan 31 11:14:21 1991
X***************
X*** 6,11 ****
X--- 6,15 ----
X  #include "../h/mh.h"
X  #include <stdio.h>
X  #include <signal.h>
X+ #include <sys/param.h>
X+ #ifndef MAXPATHLEN
X+ #define MAXPATHLEN 1024
X+ #endif /* MAXPATHLEN */
X  
X  /*  */
X  
X***************
X*** 55,61 ****
X  	   *from = NULL,
X             *body = NULL,
X            **argp = argv + 1,
X!             buf[100];
X      FILE * out;
X  
X      invo_name = r1bindex (argv[0], '/');
X--- 59,67 ----
X  	   *from = NULL,
X             *body = NULL,
X            **argp = argv + 1,
X!             buf[100],
X!            *home = NULL,
X!             dead_letter[MAXPATHLEN];
X      FILE * out;
X  
X      invo_name = r1bindex (argv[0], '/');
X***************
X*** 163,171 ****
X  
X  	default: 
X  	    if (status = pidXwait (child_id, postproc)) {
X! 		fprintf (stderr, "Letter saved in dead.letter\n");
X! 		execl ("/bin/mv", "mv", tmpfil, "dead.letter", NULLCP);
X! 		execl ("/usr/bin/mv", "mv", tmpfil, "dead.letter", NULLCP);
X  		perror ("mv");
X  		_exit (-1);
X  	    }
X--- 169,181 ----
X  
X  	default: 
X  	    if (status = pidXwait (child_id, postproc)) {
X! 		if ((home = getenv("HOME")) != NULL)
X! 			sprintf(dead_letter, "%s/dead.letter");
X! 	        else
X! 			strcpy(dead_letter, "dead.letter");
X! 		fprintf (stderr, "Letter saved in %s\n", dead_letter);
X! 		execl ("/bin/mv", "mv", tmpfil, dead_letter, NULLCP);
X! 		execl ("/usr/bin/mv", "mv", tmpfil, dead_letter, NULLCP);
X  		perror ("mv");
X  		_exit (-1);
X  	    }
END_OF_FILE
if test 1530 -ne `wc -c <'home-dead.letter-patch'`; then
    echo shar: \"'home-dead.letter-patch'\" unpacked with wrong size!
fi
# end of 'home-dead.letter-patch'
fi
echo shar: End of shell archive.
exit 0
--
Dave Edmondson, Systems Support.                     Opinions are all my own.
Department of Computing, Imperial College of Science, Technology and Medicine,
180 Queen's Gate, London SW7 1BZ. phone: 071-589-5111 x5085 fax: 071-581-8024
         email: dme@doc.ic.ac.uk, ..!ukc!icdoc!dme, dme@athena.mit.edu
  ``Be selective, be objective, be an asset to the collective'' -- Jazzy B