Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!orstcs!ogccse!schaefer From: schaefer@ogccse.ogc.edu (Barton E. Schaefer) Newsgroups: comp.mail.mush Subject: Re: using folders with other formats Summary: let "undigest" do some of the work Message-ID: <4315@ogccse.ogc.edu> Date: 22 Aug 89 18:14:14 GMT References: <8908180042.AA05056@well.UUCP> Reply-To: schaefer@ogccse.UUCP (Barton E. Schaefer) Organization: Oregon Graduate Center, Beaverton, OR Lines: 68 In article <8908180042.AA05056@well.UUCP> dv@well.sf.ca.us (David W. Vezie) writes: } (Dan and Bart, if I goof up here, let me know, but I'm taking your } suggestion of other people piping in with answers, so it isn't just you two) Your suggestion was just fine. Only a couple comments to add. } > Can mush be configured to handle folders with the following } > headers? } > } > Return-Path: @bloom-beacon.mit.edu:xpert-request@expo.lcs.mit.edu } > Received: ... } > Received: ... [ other headers deleted ] } } Mush by default looks for a line, after a blank line, that begins } with "From ". If it doesn't see any such lines, then it won't find } any messages (treat everything as "garbage before the first line"). Comment One: True on many systems, but some use one or two lines of nonprintable characters as a separator (e.g. four ctrl-A characters). I suspect that the folder with the headers described above may have originally had that type of separator and they were lost somehow. } Is there some recognizable pattern that begins each message? You } can either use some program to add a From_ line in front of each } pattern, or you can set mush to use that pattern as the message } separator (via MSG_SEPARATOR in config.h). Comment Two: MSG_SEPARATOR must match a full line (not counting the trailing newline, except for MMDF which uses two separators). If there is no line common to all messages, MSG_SEPARATOR can't be used. The Return-Path: header won't work because the path may be different for each message. } Here's a little sed script that I think would work for you: } } sed 's/^\(Return-Path: \)\(.*\)/From \2 Thu Aug 17 17:55:54 1989\ } \1\2/' < mail.gwm > mush.gwm } } Keep in mind that the date part of the From line isn't used in mush } when a Date: field exists. Comment Three: Not true. The date in the From_ line is used to record the date when the message was received. The closest equivalent date can be taken from the topmost Received: header if it is important. It is the string following the first semicolon in the Received: header, but it may not be in the correct format and may require some rewriting. The sed command above is fine for simple conversion, though. If you don't care about the date received, and you don't want to worry about generating a correctly formed From_ line yourself, you can insert a line of 8 or more hyphens like this: -------- between each of the messages in the folder, mail the folder to yourself as one big message, and then use the "undigest" command in mush to unpack it. "undigest" will create From_ lines based on the From: and Date: headers of the messages, or insert message separators if that's the way your system is set up. The next release of mush (presently in beta-test) allows you to pass a pattern to the undigest command that will be used as the separator, so with that version you could just say "undigest -p Return-Path" and not need to bother with inserting the "--------" lines. -- Bart Schaefer "And if you believe that, you'll believe anything." -- DangerMouse CSNET / Internet schaefer@cse.ogc.edu UUCP ...{sequent,tektronix,verdix}!ogccse!schaefer