Newsgroups: fj.mail
Path: galaxy.trc.rwcp.or.jp!coconuts.jaist!wnoc-tyo-news!tokyonet.ad.jp!tokyonet.ad.jp!tyo-noc-news!jh1ynw!nsdnews!nsc-ei-salome!nsc-ei-buriki!netsys-ixa-news!nscnews!wnoc-sfc-news!venus.sun.com!cs.utexas.edu!news.sprintlink.net!news.gdbnet.ad.jp!sinetnews!news.join.ad.jp!news.imnet.ad.jp!ripspost.aist.go.jp!news.tisn.ad.jp!is.s.u-tokyo!mech.t.u-tokyo.ac.jp!t-server!news.nc.u-tokyo.ac.jp!kappa!isspsun!news
From: aonuma@kappa.issp.u-tokyo.ac.jp (Shuji AONUMA)
Subject: Re: [Q] Separete spool file
Message-ID: <963OfY1.aonuma@kappa.issp.u-tokyo.ac.jp>
To: hiroomi@souken.dic.co.jp
Sender: news@isspsun.issp.u-tokyo.ac.jp
Organization: Institute for Solid State Physics, Tokyo, Japan
X-Newsreader: qnn.awk  (3.1)
References: <4jd9f8$rau@dicimn01.dic.co.jp>
Date: Fri, 29 Mar 1996 13:59:01 GMT
Lines: 50
Xref: galaxy.trc.rwcp.or.jp fj.mail:3880
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.mail&nb=3880&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

Hiroomi MATSUMOTO (hiroomi@souken.dic.co.jp) wrote:
|H> spool/mail/username$B%U%!%$%k$K$D$$$F<ALd$,$"$j$^$9!#(B
|H> 
|H> $B$3$N%U%!%$%k$r<+J,$G%a!<%kKh$K@Z$jJ,$1$h$&$H9M$($^$7$?!#(B

$B$4=jK>$NJ}K!$G$O$J$$$+$bCN$l$^$;$s$,!";d$O(Bawk$B$N(Bscript$B$G(B
$B@Z$jJ,$1$F$$$^$9!#(B
$BD6<jH4$-$J(Bscript$B$J$N$G%a!<%k$NJ8Cf$K(BFrom user@domain$B$,(B
$B$"$C$?>l9g$O8mF0:n$7$^$9!#(B
$B$J$*!"(Bheader$B$N$&$AITMQ(B($B;d$K$H$C$F(B)$B$J$b$N$O:o$k$h$&$K(B
$B$7$F$$$^$9$N$G(B(NegleFieldList$B;2>H(B)$B!"$4Cm0U2<$5$$!#(B
#!/usr/bin/gawk -f 
# um2file.awk: UNIX `from' to separated file 
# $Id: $

BEGIN{
Header=1

# list of neglected headers for news or mail, do not miss the last `:'
NegleFieldList="Path:Mime-Version:NNTP-Posting-Host:Content-Type:\
Content-Transfer-Encoding:Lines:Xref:Received:"
BaseName="mail"
}

{
# check header neglected
if (Header && $0=="") Header=0 # blank line terminates header part

if (Negle) {# continued line of neglected field? If not, Negle=0 
if ($0 !~ /^[ \t]/) Negle=0
}

if (Header && index(NegleFieldList,substr($0,1,index($0,":")))) Negle=1

if ($0 ~ /^From .+[SMTWF][uoehra][nedwitu][ ][JFMASOND][aepuco][nbrylgptvc][ ][0-9 ][0-9][ ][0-2][0-9]:[0-5][0-9]:[0-5][0-9][ ][12][0-9][0-9][0-9]/ ) { 
ExtName++
Header=1
Negle=1
}

# print out
if (!Negle) print $0 > BaseName"."ExtName
}

--  ___
  (~._.~)    
  _{ Y }_    $B9A6hO;K\LZ(B 7-22-1
( )_~~~_( )  $BJ*@-8&5f=j(B $B?7J*<A3+H/ItLg(B
 (_)---(_)   $B@D(B $B>B(B  $B=((B $B;y(B (aonuma@kappa.issp.u-tokyo.ac.jp)

