lacey@batcomputer.tn.cornell.edu (John Lacey) (08/06/89)
I am having a problem with Mush. I am trying to modify the mbox.saver shell script from rn to drop the "Article %a of %C" line, and the leading "Path:" line as well. I want to do this because I have the following line in my .mushrc: set hdr_format = "%25n %-3N %M (%3l) %28s" The problem comes up because if I am reading a news mail folder, the from_ line contains the UUCP bang path, and not the senders real address and name. So, as I said, I tried modifying mbox.saver. Now, I drop the offending lines, and use as the first line of the message the second line of the actual article, as it is in %A (rn notation, /usr/spool/news/... in my case), changing the from: to a from_ (i.e., "From "). Nonetheless, Mush is not recognizing this line. Why not? Does Mush require the MSG_SEPARATOR line to contain something other than simply a leading from_? I compiled Mush with no changes to MSG_SEPARATOR (i.e., left it undefined). Help?... -- John Lacey lacey@tcgould.tn.cornell.edu cornell!batcomputer!lacey After August 16: jjlacey@owucomcn.bitnet If you have to, try mdl@sppy00.UUCP or maybe {...}!osu-cis!sppy00!mdl
schaefer@CSE.OGC.EDU (Barton E. Schaefer) (08/06/89)
On Aug 5, 8:43pm, John Lacey wrote: } Subject: Mush MSG_SEPARATOR and rn mbox.saver } } I am having a problem with Mush. I am trying to modify the mbox.saver } shell script from rn to drop the "Article %a of %C" line, and the leading } "Path:" line as well. } } Now, I drop the } offending lines, and use as the first line of the message the second } line of the actual article, as it is in %A (rn notation, /usr/spool/news/... } in my case), changing the from: to a from_ (i.e., "From "). Nonetheless, } Mush is not recognizing this line. Why not? Does Mush require the } MSG_SEPARATOR line to contain something other than simply a leading from_? Mush accepts a number of formats for the From_ line. The basic form is From address ctime-date where the ctime-date is a 26-character date in ctime(3) format and the address does NOT have any (My Name Here) or other comment fields. Mush intentionally does NOT recognize lines that do not match this format or one of its dozen or so variations; if it did, this line: >From the halls of Montezuma to the shores of Tripoli (it did not originally have a leading ">", though some mailers may have put one there) would incorrectly split this message into two parts. That said, the most helpful thing I can probably do is to send you the mbox.saver that I use. It doesn't bother to strip the "Article N of ..." or "Path:" lines, it just rewrites the arg list a little and then calls the usual mbox.saver (the location of which probably varies from site to site, look it up). It sometimes runs into problems with RN's internal buffer sizes for the argument list and so on, and it works better from the "w"rite command than from the "s"ave command (with "s"ave you don't really need to include the Subject: as I have at the end of this script). #!/bin/sh # mbox.saver -- sh script to save netnews articles via rn # # Arguments: # 1 Full name of article (%A) # 2 Public news spool directory (%P) # 3 Directory of current newsgroup (%c) # 4 Article number (%a) # 5 Where in article to start (%B) # 6 Newsgroup name (%C) # 7 Save destination (%b) # 8 Date and time (See below) # 9 Name of poster (%t) # 10 Subject (%s) # # This script is a "preprocessor" for the default mbox.saver (currently # residing in /usr/local/lib/rn). It tacks a few extra words onto the # arguments it gets to make everything compatible with "mail -f", then # invokes the default saver. # # This script is intended to be used with the following rn environment: # # setenv MBOXSAVER '%p/mbox.saver %A %P %c %a %B %C \"%b\" \ # \"rn %(%[posted]!=^\$?%[posted]:%(%[date]=^\(\w*\), \ # \(\w*\)-\(\w*\)-\(\w*\) \([^ ]*\)?%1 %3 %(%2=..?%2: %2) %5 19%4))\n\" \ # \"%f\n\" \"%s\"' # export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$) first=$1 name=`/bin/echo $9 | sed 's= (.*)=='` shift /usr/local/lib/rn/mbox.saver "$first" "$1" "$2" "$3" "$4" "$5" "$6" \ "From $name $7\ Subject: $9" -- Bart Schaefer "And if you believe that, you'll believe anything." -- DangerMouse CSNET / Internet schaefer@cse.ogc.edu UUCP ...{sequent,tektronix,verdix}!ogccse!schaefer
lacey@batcomputer.tn.cornell.edu (John Lacey) (08/06/89)
Well, I have managed to fix my earlier problem, but I'm not sure how ... With the from_ followed immeditately by the from: line, but with the from: line prepended with a ">", Mush generated the most interesting values for %n. Sometimes it was the address as it appeared on the from: line, and other times is was the tail of the address on the from_ line (which was derived from "Path:". How did it know where in the bang-path to start looking? The bang-paths I was getting were roughly equivalent to the Internet domain addresses, that is, somehow, Mush was truncating the bang-path. Now, I have it set up so that the From_ header is given (again, in rn notation) by "From %T %`date`". I am leaving the "Article %a of %C" line intact, and also the path and from: headers (with no ">"). This setup appears to work. If anyone has any explainations for some of this behavior, or knows of a problem with my current setup, I would appreciate hearing from you. Cheers, -- John Lacey lacey@tcgould.tn.cornell.edu cornell!batcomputer!lacey After August 16: jjlacey@owucomcn.bitnet If you have to, try mdl@sppy00.UUCP or maybe {...}!osu-cis!sppy00!mdl