Xref: utzoo comp.mail.elm:3860 comp.mail.mh:1580 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!hellgate.utah.edu!cs.utah.edu!heiner From: heiner@cs.utah.edu (Jeremy Heiner) Newsgroups: comp.mail.elm,comp.mail.mh Subject: Re: elm folder --> mh folder --> elm folder Summary: isn't keeping original "\nFrom " line easier than reconstructing it? Message-ID: <1991Mar21.114105.12035@hellgate.utah.edu> Date: 21 Mar 91 18:41:04 GMT References: <1991Mar8.140403.17710@NPIRS.Purdue.EDU> <16210@reed.UUCP> Organization: University of Utah CS Dept Lines: 75 I too was disappointed to find it wasn't easy to get from the mh message format back to the unix maildrop format. Instead of writing a script to reconstruct the delimiting line I changed mh so that it doesn't throw that line away. This change affects nine lines in two files, and is currently part of the RPATHS option. Bugs: (1) annotations get prepended to the message, so you cannot depend on the saved delimiter being the first line of the message. (2) this probably should be separated from the RPATHS option. (3) the name of the new component might conflict with officially recognized component names. (4) there is no guarantee or warranty of any kind associated with these changes. Jeremy =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= % diff -c original/uip/scansbr.c modified/uip/scansbr.c *** original/uip/scansbr.c Thu Apr 12 14:29:37 1990 --- modified/uip/scansbr.c Thu Feb 28 18:05:04 1991 *************** *** 41,46 **** --- 41,47 ---- static int dat[4]; /* aux. data for format routine */ #ifdef RPATHS + extern char unixbuf[]; char *unixline (); /* info from UNIX From: line */ #endif RPATHS *************** *** 143,150 **** if ((scnout = fopen (scnmsg, "w")) == NULL) adios (scnmsg, "unable to write"); #ifdef RPATHS if ((cp = unixline ()) && *cp != '\n') { ! FPUTS ("Return-Path: "); FPUTS (cp); } #endif RPATHS --- 144,153 ---- if ((scnout = fopen (scnmsg, "w")) == NULL) adios (scnmsg, "unable to write"); #ifdef RPATHS + FPUTS("UNIX-From: From "); + FPUTS(unixbuf); if ((cp = unixline ()) && *cp != '\n') { ! FPUTS ("\nReturn-Path: "); FPUTS (cp); } #endif RPATHS % diff -c original/uip/slocal.c modified/uip/slocal.c *** original/uip/slocal.c Thu Apr 12 14:29:38 1990 --- modified/uip/slocal.c Thu Feb 28 18:26:42 1991 *************** *** 1135,1140 **** --- 1135,1144 ---- #ifndef RPATHS continue; /* but don't put in file */ #else + fputs ("UNIX-From: ", ffp); + if (ferror (ffp)) goto writerr; + fputs (buffer, ffp); + if (ferror (ffp)) goto writerr; hp = cp = index (fp = unixfrom + i, ' '); while (hp = index (++hp, 'r')) if (uprf (hp, "remote from")) { *************** *** 1157,1162 **** --- 1161,1167 ---- first++; fputs (buffer, ffp); if (ferror (ffp)) { + writerr: (void) close (fd1); (void) fclose (ffp); (void) fclose (qfp);