Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!icdoc!gould.doc!dme From: dme@doc.ic.ac.uk (Dave Edmondson) Newsgroups: comp.mail.mh Subject: Re: mhmail and aliases. Message-ID: Date: 31 Jan 91 11:16:58 GMT References: <1991Jan30.152049.4879@mp.cs.niu.edu> Sender: news@doc.ic.ac.uk Organization: Imperial College Mafia Lines: 104 In-reply-to: rickert@mp.cs.niu.edu's message of 30 Jan 91 15:20:49 GMT 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 '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 X #include X+ #include 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