On Sat, Nov 15, 2003 at 06:03:06AM -0800, Karsten M. Self wrote:
> I've prepared a couple of scripts which I'm using to report swen headers
> and body to originating ISPs.
> 
>   - Scripts work on directory-based mail folders (Maildir, MH, etc.).
>     *NOT* mbox.  Sorry.

Pipe the mbox into this quick and clunky mbox-splitter:

#!/bin/bash
IFS=$'\n'
i=0
BASENAME="split.mbox"
while read x; do
    echo "$x" | grep '^From ' && i=$(( i + 1 ))
    echo "$x" >> $BASENAME.$i
done


-- 
Pigeon

Be kind to pigeons
Get my GPG key here: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x21C61F7F

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to