procmail
[Top] [All Lists]

Re: Converting message files to mbox

2002-02-01 18:56:32
At 17:11 2002-02-01 -0800, Kenneth Porter did say:

I'm changing mail clients and need to migrate directories of individual
messages (names like GXYZ01.MSG) to mbox files. From scanning the
archives it looks like formail might do it, but I haven't seen a
complete solution yet. The date on the From line can probably be the
time stamp for each file.

That is so vague as to not be helpful at all - why not just post the header lines from an example message?

Are you suggesting that the timestamp of the message be used to produce a from line? Is there a reason you'd expect your new mail program to actually _care_ about it?


Why not just use a simple shell script:

for x in `ls -r -t *.MSG`
 do
  formail < $x >> oldmail.mbx
 done

This would at least escape each message mbx formatting, and would assemble the mbx file in date order (from file timestamps, note the ls invocation). If the messages need to be altered in any way (weird lines stripped, whatever), you could easily pipe it through a script to deal with that, but since I haven't the faintest idea of what the files look like, I can't begin to suggest what sort of expression you'd use, or if you even need one.

- Sean ( wishing people didn't go out of their way to be vague ) Straw

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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