Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!sun-barr!olivea!samsung!caen!sol.ctr.columbia.edu!cunixf.cc.columbia.edu!cunixa.cc.columbia.edu!das15 From: das15@cunixa.cc.columbia.edu (Douglas A Scott) Newsgroups: comp.sys.next Subject: Here's how to put news into Mail.app Message-ID: <1991May6.014658.12686@cunixf.cc.columbia.edu> Date: 6 May 91 01:46:58 GMT Sender: usenet@cunixf.cc.columbia.edu (The Network News) Reply-To: das15@cunixa.cc.columbia.edu (Douglas A Scott) Organization: Columbia University Lines: 40 Nntp-Posting-Host: cunixa.cc.columbia.edu I had posted an awk script which was my first attempt at reformatting mboxes and news mailbox-style files for the NeXT, but I just sat down and rewrote it so that it works 98% of the time. Just take any mbox that currently causes Mail.app to barf (vax mboxes did, and so do all saved news mailboxes) and say convert bad.mbox > good.mbox save this script as "convert" (or whatever) and just run it as a shell script. ++++++++++++++++++++++++++++++++++++ $1 !~ /^Date:/ && $1 !~ /^From: / { entry[line]=$0; line++;} /^From: / { printf ("%s %s %s\n", "From", name, fromdate); print origfrom; print origdate; while(i < line-1) { print (entry[i]); i++;} i=0; line=0; printf ("\n\n\n\n"); origfrom=$0; if ( $2 !~ /^[A-Za-z]/ ) name = substr($2,2,length($2)); else name = $2; } /^Date: / { origdate=$0; if ( $2 ~ /^[0-9]/ ) { if( length($7) == 0 ) $7="Sun"; fromdate=sprintf("%s %s %s %s 19%s", $7, $3, $2, $5, $4) ; } else if ( $3 ~ /^[0-9]/ ) fromdate=sprintf("%s %s %s %s 19%s", substr($2,0,length( $2)-1), $4, $3, $6, $5); else fromdate=sprintf("%s %s %s %s %s", $2, $3, $4, $5, $6); } ' $1 This works much better than the old one! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Douglas Scott Columbia University Computer Music Studio Internet: UUCP: ...!columbia!woof!zardoz!doug Phone: (703)765-4771