procmail
[Top] [All Lists]

Re: Help w/splitting

1998-09-13 13:21:59
On Sun, 13 Sep 1998 03:52:00 -0700 (PDT), 
Dave Wells <wellsian(_at_)netgate(_dot_)net> said:

D> Can anyone tell me what's wrong with this?  I'm trying to split some old
D> email archives into individual files while stripping unimportant header
D> fields.

   If I use formail for this, I write a small shell script first to do the
   dirty work:

         #!/bin/sh
         # doit.sh: store each message
         exec /bin/cat > $FILENO.txt

   I use exec to reduce the number of processes created.  Then use formail:

         formail -k -X ... -ds ./doit < input-mail-folder

   If the mail folders involved are large, I use some C programs to split
   them up by month, by week, or one-file-per-message.  The C routines use
   the same regular expression that procmail uses for the start of a mail
   message; they're quite a bit faster because it's just one process being
   started.

-- 
Karl Vogel
ASC/YCOA, Wright-Patterson AFB, OH 45433, USA
vogelke(_at_)c17mis(_dot_)region2(_dot_)wpafb(_dot_)af(_dot_)mil

Advertising may be described as the science of arresting
human intelligence long enough to get money from it.    --Stephen Leacock

<Prev in Thread] Current Thread [Next in Thread>