[comp.mail.mush] binmail vs MMDF mail file format

schaefer@ogccse.ogc.edu (Barton E. Schaefer) (07/05/89)

Sorry, my inews won't let me post to alt.*.

In article <12057@s.ms.uky.edu> david@ms.uky.edu (David Herron -- One of the vertebrae) writes:
} A problem with both the ucbmail and mush ports into the MMDF
} environment is that neither makes a distinction between saving
} a message to a mailbox and sending it out a pipe.  In both cases
} the ^A's are sent out...  It's on my list of things to do ;-)

Mush 6.5.6 *does* remove the ^A separators when piping, *except* when you
specify a pipe as one of the addresses when sending mail (e.g. if $record
is a pipe).  But that is an incredibly trivial thing to fix.  (Why don't
poeple *tell* me about these problems?!?!)

[ This is NOT an Official Patch.  There will be no further Official
Patches until the SunView port is out of beta-test. ]

In file mail.c, add one line after line 1416:

  1408      /* First, put the message separator in... */
  1409      for (size = 1; size < next_file; size++)
  1410  #ifndef MSG_SEPARATOR
  1411          {
  1412              time_t t;
  1413              (void) time(&t);
  1414              fprintf(files[size], "From %s %s", login, ctime(&t));
  1415          }
  1416  #else /* MSG_SEPARATOR */
+               if (names[size])
  1417  #ifdef MMDF
  1418          fputs(MSG_SEPARATOR, files[size]);
  1419  #else /* MMDF */
  1420          fprintf(files[size], "%s\n", MSG_SEPARATOR);
  1421  #endif /* MMDF */
  1422  #endif /* MSG_SEPARATOR */

and also move lines 1487-1489 to after 1490:

  1486      for (size = 1; size < next_file; size++) {
- 1487  #ifdef END_MSG_SEP
- 1488          fputs(END_MSG_SEP, files[size]);
- 1489  #endif /* END_MSG_SEP */
  1490          if (names[size]) {
+       #ifdef END_MSG_SEP
+                   fputs(END_MSG_SEP, files[size]);
+       #endif /* END_MSG_SEP */
  1491  #ifndef END_MSG_SEP
  1492              fputc('\n', files[size]);
  1493  #endif /* !END_MSG_SEP */
  1494              close_lock(names[size], files[size]);
  1495              xfree(names[size]);
  1496          } else
  1497              pclose(files[size]);
  1498      }

Line 1491 and the one above it could of course be condensed into #else.
-- 
Bart Schaefer           "And if you believe that, you'll believe anything."
                                                            -- DangerMouse
CSNET / Internet                schaefer@cse.ogc.edu
UUCP                            ...{sequent,tektronix,verdix}!ogccse!schaefer