[pmmail-list] Converting folder to mbox file

Frank Winkler @home pmmail-list@blueprintsoftwareworks.com
Fri, 04 Jan 2002 13:43:38 +0100 (CET)


On 03 Jan 2002 11:12:37 -0800, Kenneth Porter wrote:

 >Anyone know of a utility for converting a folder full of individual
 >messages into a standard mbox file?

This direction should be rather easy ... just glue all the files to one single 
file, separating the messages by a blank line or a five subsequent CTRL-As in 
case of a MMDF file. Better make sure that every message starts with a copy of 
the "From: " line, omitting the colon.

So, in sh style and using the well-known UNIX tools, something like

	cp NUL: mbox
	for file in *.msg do
	  grep "From: " $file | tr -d ':' >> mbox
	  cat $file >> mbox
	  echo "" >> mbox
	done

should do the job. This can easily adapted to any other shell like 4OS2 but I  
use this one only as my interactive shell ;) ...

Regards

-- 
----------------------------------------------------------------------------
Frank Winkler                                                frank@consol.de
ConSol GmbH
Franziskanerstr. 38                                   Voice +49 89 45841.275
81669 Munich - Germany                                  Fax +49 89 45841.189

- pmmail-list - The PMMail Dicussion List ---------------------------
To POST to the list, send your message to:
pmmail-list@blueprintsoftwareworks.com

To UNSUBSCRIBE, send a message to mdaemon@bmtmicro.com with the first 
line of the message body being...
UNSUBSCRIBE pmmail-list@blueprintsoftwareworks.com
---------------------------------------------------------------------