On Tue, Apr 26, 2011 at 1:23 PM, Nobody <nob...@nowhere.com> wrote: > E.g. the following script reads a mailbox on stdin and writes a separate > file for each message: > > #!/usr/bin/awk -f > BEGIN { > num = 0; > ofile = ""; > } > > /^From / { > if (ofile != "") close(ofile); > ofile = sprintf("%06d.mbox", num); > num ++; > } > > { > print > ofile; > }
For the archive: This assumes traditional mbox. A SysV-ish sendmail, for example, may not like it. -- http://mail.python.org/mailman/listinfo/python-list